/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2006                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

motionSolverLibs    (    "librigidBodyDynamicsCOM.so"
    "libforcesCOM.so"
    "librigidBodyMeshMotionCOM.so");

dynamicFvMesh       dynamicOversetFvMesh;

motionSolver        rigidBodyMotion;

report          off;
rho rhoInf;
rhoInf 1.293;
g               ( 0 0 -9.8065 );

// parameter definition 
// total mass:	2.3g -> 0.51 
// body mass:	0.7g -> 0.35,	i.e., 1/2
// wing mass: 	1.6 -> 0.16, i.e., /10

solver
{
    type NewmarkCOM;
//    gamma   0.75;    // Velocity integration coefficient:	"gamma > 0.5" is unconditionary stable, but low accuracy.  
//    beta    0.390625;    // Position integration coefficient:	beta = (gamma+0.5)^2/4	
}

Iteration_number_for_MB	200;

OutputFiles	(thoraxpart L12part R12part);	// save the center of rotation.

#include        "COMs.dat"

golocalCoordinateSystem	(1 0 0  0 1 0  0 0 1);

bodies
{
    thoraxpart
    {
        type            rigidBody;
        parent          root;
        mass            0.162e-3;	// 0.323g
        inertia         (0.647e-9 0 0  2.404e-9 0  2.404e-9);	// (1.294e-9 0 0  4.807e-9 0  4.807e-9);
        centreOfMass    $thoraxCOM;			/* global coordinate system */
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (thorax);
        innerDistance   100;
        outerDistance   101;
    }

    abdomenpart
    {
        type            rigidBody;
        parent          root;
        mass            0.198e-3;	//	0.396g
        inertia         (0.840e-9 0 0  3.750e-9 0  3.750e-9);	//(1.679e-9 0 0  7.499e-9 0  7.499e-9);
        centreOfMass    $abdomenCOM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (abdomen);
        innerDistance   100;
        outerDistance   101;
    }

    R00part
    {
        type            rigidBody;
        parent          root;
        mass            0.0131e-3;	
        inertia         (0.3025e-9 0.0401e-9 0  0.1976e-9 0  0.4993e-9);	
        centreOfMass    $R00COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R00);
        innerDistance   0;
        outerDistance   101;
    }
    R02part
    {
        type            rigidBody;
        parent          root;
        mass            0.0033e-3;	
        inertia         (0.0274e-9 0.0008e-9 0  0.085e-9 0  0.0357e-9);	
        centreOfMass    $R02COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R02);
        innerDistance   0;
        outerDistance   101;
    }
    R03part
    {
        type            rigidBody;
        parent          root;
        mass            0.0032e-3;	
        inertia         (0.026e-9 -0.0014e-9 0  0.075e-9 0  0.0334e-9);	
        centreOfMass    $R03COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R03);
        innerDistance   0;
        outerDistance   101;
    }
    R04part
    {
        type            rigidBody;
        parent          root;
        mass            0.0021e-3;	
        inertia         (0.0213e-9 -0.0031e-9 0  0.027e-9 0  0.0239e-9);	
        centreOfMass    $R04COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R04);
        innerDistance   0;
        outerDistance   101;
    }
    R12part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $R12COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R12);
        innerDistance   0;
        outerDistance   101;
    }
    R13part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $R13COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R13);
        innerDistance   0;
        outerDistance   101;
    }
    R14part
    {
        type            rigidBody;
        parent          root;
        mass            0.0047e-3;	
        inertia         (0.0462e-9 0.0173e-9 0  0.0317e-9 0  0.0777e-9);	
        centreOfMass    $R14COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R14);
        innerDistance   0;
        outerDistance   101;
    }
    R20part
    {
        type            rigidBody;
        parent          root;
        mass            0.0029e-3;	
        inertia         (0.0063e-9 -0.001e-9 0  0.0264e-9 0  0.0325e-9);	
        centreOfMass    $R20COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R20);
        innerDistance   0;
        outerDistance   101;
    }
    R21part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $R21COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R21);
        innerDistance   0;
        outerDistance   101;
    }
    R22part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $R22COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R22);
        innerDistance   0;
        outerDistance   101;
    }
    R23part
    {
        type            rigidBody;
        parent          root;
        mass            0.0036e-3;	
        inertia         (0.0289e-9 0.012e-9 0  0.0202e-9 0  0.0489e-9);	
        centreOfMass    $R23COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R23);
        innerDistance   0;
        outerDistance   101;
    }
    R30part
    {
        type            rigidBody;
        parent          root;
        mass            0.004e-3;	
        inertia         (0.0155e-9 0.002e-9 0  0.0324e-9 0  0.0477e-9);	
        centreOfMass    $R30COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R30);
        innerDistance   0;
        outerDistance   101;
    }
    R31part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $R31COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R31);
        innerDistance   0;
        outerDistance   101;
    }
    R32part
    {
        type            rigidBody;
        parent          root;
        mass            0.005e-3;	
        inertia         (0.0337e-9 0.0084e-9 0  0.04e-9 0  0.0734e-9);	
        centreOfMass    $R32COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R32);
        innerDistance   0;
        outerDistance   101;
    }
    R40part
    {
        type            rigidBody;
        parent          root;
        mass            0.0021e-3;	
        inertia         (0.0083e-9 -0.0014e-9 0  0.0052e-9 0  0.0134e-9);	
        centreOfMass    $R40COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R40);
        innerDistance   0;
        outerDistance   101;
    }
    R41part
    {
        type            rigidBody;
        parent          root;
        mass            0.0036e-3;	
        inertia         (0.0272e-9 0.0023e-9 0  0.0119e-9 0  0.0388e-9);	
        centreOfMass    $R41COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R41);
        innerDistance   0;
        outerDistance   101;
    }
    R42part
    {
        type            rigidBody;
        parent          root;
        mass            0.0008e-3;	
        inertia         (0.0015e-9 0.0005e-9 0  0.0009e-9 0  0.0023e-9);	
        centreOfMass    $R42COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R42);
        innerDistance   0;
        outerDistance   101;
    }
    R51part	// tail
    {
        type            rigidBody;
        parent          root;
        mass            0.0007e-3;	
        inertia         (0.0003e-9 -0.0004e-9 0  0.0022e-9 0  0.0025e-9);	
        centreOfMass    $R51COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R51);
        innerDistance   0;
        outerDistance   101;
    }
    R61part	// tail
    {
        type            rigidBody;
        parent          root;
        mass            0.0008e-3;	
        inertia         (0.0004e-9 -0.0005e-9 0  0.0031e-9 0  0.0034e-9);	
        centreOfMass    $R61COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (R61);
        innerDistance   0;
        outerDistance   101;
    }

    L00part
    {
        type            rigidBody;
        parent          root;
        mass            0.0131e-3;	
        inertia         (0.3025e-9 -0.0401e-9 0  0.1976e-9 0  0.4993e-9);	
        centreOfMass    $L00COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L00);
        innerDistance   0;
        outerDistance   101;
    }
    L02part
    {
        type            rigidBody;
        parent          root;
        mass            0.0033e-3;	
        inertia         (0.0274e-9 -0.0008e-9 0  0.085e-9 0  0.0357e-9);	
        centreOfMass    $L02COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L02);
        innerDistance   0;
        outerDistance   101;
    }
    L03part
    {
        type            rigidBody;
        parent          root;
        mass            0.0032e-3;	
        inertia         (0.026e-9 0.0014e-9 0  0.075e-9 0  0.0334e-9);	
        centreOfMass    $L03COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L03);
        innerDistance   0;
        outerDistance   101;
    }
    L04part
    {
        type            rigidBody;
        parent          root;
        mass            0.0021e-3;	
        inertia         (0.0213e-9 0.0031e-9 0  0.027e-9 0  0.0239e-9);	
        centreOfMass    $L04COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L04);
        innerDistance   0;
        outerDistance   101;
    }
    L12part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $L12COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L12);
        innerDistance   0;
        outerDistance   101;
    }
    L13part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $L13COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L13);
        innerDistance   0;
        outerDistance   101;
    }
    L14part
    {
        type            rigidBody;
        parent          root;
        mass            0.0047e-3;	
        inertia         (0.0462e-9 -0.0173e-9 0  0.0317e-9 0  0.0777e-9);	
        centreOfMass    $L14COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L14);
        innerDistance   0;
        outerDistance   101;
    }
    L20part
    {
        type            rigidBody;
        parent          root;
        mass            0.0029e-3;	
        inertia         (0.0063e-9 0.001e-9 0  0.0264e-9 0  0.0325e-9);	
        centreOfMass    $L20COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L20);
        innerDistance   0;
        outerDistance   101;
    }
    L21part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $L21COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L21);
        innerDistance   0;
        outerDistance   101;
    }
    L22part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $L22COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L22);
        innerDistance   0;
        outerDistance   101;
    }
    L23part
    {
        type            rigidBody;
        parent          root;
        mass            0.0036e-3;	
        inertia         (0.0289e-9 -0.012e-9 0  0.0202e-9 0  0.0489e-9);	
        centreOfMass    $L23COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L23);
        innerDistance   0;
        outerDistance   101;
    }
    L30part
    {
        type            rigidBody;
        parent          root;
        mass            0.004e-3;	
        inertia         (0.0155e-9 -0.002e-9 0  0.0324e-9 0  0.0477e-9);	
        centreOfMass    $L30COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L30);
        innerDistance   0;
        outerDistance   101;
    }
    L31part
    {
        type            rigidBody;
        parent          root;
        mass            0.006e-3;	
        inertia         (0.0502e-9 0.0e-9 0  0.0502e-9 0  0.1e-9);	
        centreOfMass    $L31COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L31);
        innerDistance   0;
        outerDistance   101;
    }
    L32part
    {
        type            rigidBody;
        parent          root;
        mass            0.005e-3;	
        inertia         (0.0337e-9 -0.0084e-9 0  0.04e-9 0  0.0734e-9);	
        centreOfMass    $L32COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L32);
        innerDistance   0;
        outerDistance   101;
    }
    L40part
    {
        type            rigidBody;
        parent          root;
        mass            0.0021e-3;	
        inertia         (0.0083e-9 0.0014e-9 0  0.0052e-9 0  0.0134e-9);	
        centreOfMass    $L40COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L40);
        innerDistance   0;
        outerDistance   101;
    }
    L41part
    {
        type            rigidBody;
        parent          root;
        mass            0.0036e-3;	
        inertia         (0.0272e-9 -0.0023e-9 0  0.0119e-9 0  0.0388e-9);	
        centreOfMass    $L41COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L41);
        innerDistance   0;
        outerDistance   101;
    }
    L42part
    {
        type            rigidBody;
        parent          root;
        mass            0.0008e-3;	
        inertia         (0.0015e-9 -0.0005e-9 0  0.0009e-9 0  0.0023e-9);	
        centreOfMass    $L42COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L42);
        innerDistance   0;
        outerDistance   101;
    }
    L51part	// tail
    {
        type            rigidBody;
        parent          root;
        mass            0.0007e-3;	
        inertia         (0.0003e-9 0.0004e-9 0  0.0022e-9 0  0.0025e-9);	
        centreOfMass    $L51COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L51);
        innerDistance   0;
        outerDistance   101;
    }
    L61part	// tail
    {
        type            rigidBody;
        parent          root;
        mass            0.0008e-3;	
        inertia         (0.0004e-9 0.0005e-9 0  0.0031e-9 0  0.0034e-9);	
        centreOfMass    $L61COM;			
        transform       $golocalCoordinateSystem $centreOfMass;
        joint {
            type            composite;
            joints ( 
                {   type Pxyz;	}
                {   type Rxyz;	}
            );
        }
        patches         (L61);
        innerDistance   0;
        outerDistance   101;
    }
}

// parameter definition
translational_spring   ( 100 0.1 0 );	// ( 1.0e+2 1 0 ); spring coefficient, Damper coefficient, dummy
translational_spring_abdomen   ( 1.0e+4 1.0e+1 0 );	// ( 1.0e+2 1 0 ); spring coefficient, Damper coefficient, dummy
coil_spring_for_leadingedge   ( 1.0e-2 1.0e-5 0 );		// spring coefficient, Damper coefficient, dummy
coil_spring   ( 1.0e-4 1.0e-6 0 );		// spring coefficient, Damper coefficient, dummy
collision_para   ( 0.1 1.0e-4 0.001 );		// spring coefficient, Damper coefficient, threshold [m]

restraints
{
	//  ********** Rigid body connections *****************
    thorax_abdomenC
    {
        type           	rigidbodyConnectionCOM;
        body            thoraxpart;
	reaction	abdomenpart;	
	connection_point (0.011 0 -0.005);	// global position
        gain    	$translational_spring_abdomen;
    }

    thorax_R00Ca
    {
        type           	rigidbodyConnectionCOM;
        body            thoraxpart;
	reaction	R00part;	
	connection_point (0 0.003 0);	// global position
        gain    	$translational_spring;
    }
    thorax_R00Cb
    {
        type           	rigidbodyConnectionCOM;
        body            thoraxpart;
	reaction	R00part;	
	connection_point (0.005 0.003 0);	// global position
        gain    	$translational_spring;
    }

    R00_R02Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R02part;	
	connection_point (-0.005 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R00_R02Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R02part;	
	connection_point (0 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R02_R03Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R02part;
	reaction	R03part;	
	connection_point (-0.005 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R02_R03Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R02part;
	reaction	R03part;	
	connection_point (0 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R03_R04Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R03part;
	reaction	R04part;	
	connection_point (-0.005 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R03_R04Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R03part;
	reaction	R04part;	
	connection_point (0 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R00_R12Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R12part;	
	connection_point (0 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R00_R12Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R12part;	
	connection_point (0.01 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R12_R13Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R12part;
	reaction	R13part;	
	connection_point (0 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R12_R13Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R12part;
	reaction	R13part;	
	connection_point (0.01 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R13_R14Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R13part;
	reaction	R14part;	
	connection_point (0 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R13_R14Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R13part;
	reaction	R14part;	
	connection_point (0.01 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R20_R21Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R20part;
	reaction	R21part;	
	connection_point (0.01 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R20_R21Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R20part;
	reaction	R21part;	
	connection_point (0.02 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R21_R22Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R21part;
	reaction	R22part;	
	connection_point (0.01 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R21_R22Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R21part;
	reaction	R22part;	
	connection_point (0.02 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R22_R23Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R22part;
	reaction	R23part;	
	connection_point (0.01 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R22_R23Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R22part;
	reaction	R23part;	
	connection_point (0.02 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R30_R31Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R30part;
	reaction	R31part;	
	connection_point (0.02 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R30_R31Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R30part;
	reaction	R31part;	
	connection_point (0.03 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R31_R32Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R31part;
	reaction	R32part;	
	connection_point (0.02 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R31_R32Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R31part;
	reaction	R32part;	
	connection_point (0.03 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R40_R41Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R40part;
	reaction	R41part;	
	connection_point (0.03 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R40_R41Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R40part;
	reaction	R41part;	
	connection_point (0.037 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R41_R42Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R41part;
	reaction	R42part;	
	connection_point (0.03 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R41_R42Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R41part;
	reaction	R42part;	
	connection_point (0.034 0.02 0);	// global position
        gain    	$translational_spring;
    }

    R00_R20Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R20part;	
	connection_point (0.01 0.004 0);	// global position
        gain    	$translational_spring;
    }
    R00_R20Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R20part;	
	connection_point (0.01 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R20_R30Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R20part;
	reaction	R30part;	
	connection_point (0.02 0.004 0);	// global position
        gain    	$translational_spring;
    }
    R20_R30Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R20part;
	reaction	R30part;	
	connection_point (0.02 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R30_R40Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R30part;
	reaction	R40part;	
	connection_point (0.03 0.003 0);	// global position
        gain    	$translational_spring;
    }
    R30_R40Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R30part;
	reaction	R40part;	
	connection_point (0.03 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R00_R21Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R21part;	
	connection_point (0.01 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R00_R21Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R00part;
	reaction	R21part;	
	connection_point (0.01 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R21_R31Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R21part;
	reaction	R31part;	
	connection_point (0.02 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R21_R31Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R21part;
	reaction	R31part;	
	connection_point (0.02 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R31_R41Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R31part;
	reaction	R41part;	
	connection_point (0.03 0.01 0);	// global position
        gain    	$translational_spring;
    }
    R31_R41Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R31part;
	reaction	R41part;	
	connection_point (0.03 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R41_R51Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R41part;
	reaction	R51part;	
	connection_point (0.037 0.015 0);	// global position
        gain    	$translational_spring;
    }
    R51_R61Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R51part;
	reaction	R61part;	
	connection_point (0.043 0.015 0);	// global position
        gain    	$translational_spring;
    }
    R02_R12Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R02part;
	reaction	R12part;	
	connection_point (0 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R02_R12Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R02part;
	reaction	R12part;	
	connection_point (0 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R12_R22Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R12part;
	reaction	R22part;	
	connection_point (0.01 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R12_R22Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R12part;
	reaction	R22part;	
	connection_point (0.01 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R22_R32Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R22part;
	reaction	R32part;	
	connection_point (0.02 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R22_R32Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R22part;
	reaction	R32part;	
	connection_point (0.02 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R32_R42Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R32part;
	reaction	R42part;	
	connection_point (0.03 0.02 0);	// global position
        gain    	$translational_spring;
    }
    R32_R42Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R32part;
	reaction	R42part;	
	connection_point (0.03 0.025 0);	// global position
        gain    	$translational_spring;
    }
    R03_R13Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R03part;
	reaction	R13part;	
	connection_point (0 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R03_R13Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R03part;
	reaction	R13part;	
	connection_point (0 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R13_R23Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R13part;
	reaction	R23part;	
	connection_point (0.01 0.03 0);	// global position
        gain    	$translational_spring;
    }
    R13_R23Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R13part;
	reaction	R23part;	
	connection_point (0.01 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R04_R14Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R04part;
	reaction	R14part;	
	connection_point (0 0.04 0);	// global position
        gain    	$translational_spring;
    }
    R04_R14Cb
    {
        type           	rigidbodyConnectionCOM;
        body            R04part;
	reaction	R14part;	
	connection_point (0 0.05 0);	// global position
        gain    	$translational_spring;
    }

    thorax_L00Ca
    {
        type           	rigidbodyConnectionCOM;
        body            thoraxpart;
	reaction	L00part;	
	connection_point (0 -0.003 0);	// global position
        gain    	$translational_spring;
    }
    thorax_L00Cb
    {
        type           	rigidbodyConnectionCOM;
        body            thoraxpart;
	reaction	L00part;	
	connection_point (0.005 -0.003 0);	// global position
        gain    	$translational_spring;
    }

    L00_L02Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L02part;	
	connection_point (-0.005 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L00_L02Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L02part;	
	connection_point (0 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L02_L03Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L02part;
	reaction	L03part;	
	connection_point (-0.005 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L02_L03Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L02part;
	reaction	L03part;	
	connection_point (0 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L03_L04Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L03part;
	reaction	L04part;	
	connection_point (-0.005 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L03_L04Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L03part;
	reaction	L04part;	
	connection_point (0 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L00_L12Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L12part;	
	connection_point (0 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L00_L12Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L12part;	
	connection_point (0.01 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L12_L13Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L12part;
	reaction	L13part;	
	connection_point (0 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L12_L13Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L12part;
	reaction	L13part;	
	connection_point (0.01 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L13_L14Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L13part;
	reaction	L14part;	
	connection_point (0 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L13_L14Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L13part;
	reaction	L14part;	
	connection_point (0.01 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L20_L21Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L20part;
	reaction	L21part;	
	connection_point (0.01 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L20_L21Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L20part;
	reaction	L21part;	
	connection_point (0.02 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L21_L22Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L21part;
	reaction	L22part;	
	connection_point (0.01 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L21_L22Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L21part;
	reaction	L22part;	
	connection_point (0.02 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    R22_R23Ca
    {
        type           	rigidbodyConnectionCOM;
        body            R22part;
	reaction	R23part;	
	connection_point (0.01 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L22_L23Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L22part;
	reaction	L23part;	
	connection_point (0.02 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L30_L31Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L30part;
	reaction	L31part;	
	connection_point (0.02 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L30_L31Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L30part;
	reaction	L31part;	
	connection_point (0.03 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L31_L32Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L31part;
	reaction	L32part;	
	connection_point (0.02 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L31_L32Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L31part;
	reaction	L32part;	
	connection_point (0.03 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L40_L41Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L40part;
	reaction	L41part;	
	connection_point (0.03 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L40_L41Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L40part;
	reaction	L41part;	
	connection_point (0.037 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L41_L42Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L41part;
	reaction	L42part;	
	connection_point (0.03 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L41_L42Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L41part;
	reaction	L42part;	
	connection_point (0.034 -0.02 0);	// global position
        gain    	$translational_spring;
    }

    L00_L20Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L20part;	
	connection_point (0.01 -0.004 0);	// global position
        gain    	$translational_spring;
    }
    L00_L20Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L20part;	
	connection_point (0.01 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L20_L30Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L20part;
	reaction	L30part;	
	connection_point (0.02 -0.004 0);	// global position
        gain    	$translational_spring;
    }
    L20_L30Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L20part;
	reaction	L30part;	
	connection_point (0.02 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L30_L40Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L30part;
	reaction	L40part;	
	connection_point (0.03 -0.003 0);	// global position
        gain    	$translational_spring;
    }
    L30_L40Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L30part;
	reaction	L40part;	
	connection_point (0.03 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L00_L21Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L21part;	
	connection_point (0.01 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L00_L21Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L00part;
	reaction	L21part;	
	connection_point (0.01 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L21_L31Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L21part;
	reaction	L31part;	
	connection_point (0.02 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L21_L31Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L21part;
	reaction	L31part;	
	connection_point (0.02 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L31_L41Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L31part;
	reaction	L41part;	
	connection_point (0.03 -0.01 0);	// global position
        gain    	$translational_spring;
    }
    L31_L41Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L31part;
	reaction	L41part;	
	connection_point (0.03 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L41_L51Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L41part;
	reaction	L51part;	
	connection_point (0.037 -0.015 0);	// global position
        gain    	$translational_spring;
    }
    L51_L61Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L51part;
	reaction	L61part;	
	connection_point (0.043 -0.015 0);	// global position
        gain    	$translational_spring;
    }
    L02_L12Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L02part;
	reaction	L12part;	
	connection_point (0 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L02_L12Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L02part;
	reaction	L12part;	
	connection_point (0 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L12_L22Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L12part;
	reaction	L22part;	
	connection_point (0.01 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L12_L22Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L12part;
	reaction	L22part;	
	connection_point (0.01 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L22_L32Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L22part;
	reaction	L32part;	
	connection_point (0.02 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L22_L32Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L22part;
	reaction	L32part;	
	connection_point (0.02 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L32_L42Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L32part;
	reaction	L42part;	
	connection_point (0.03 -0.02 0);	// global position
        gain    	$translational_spring;
    }
    L32_L42Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L32part;
	reaction	L42part;	
	connection_point (0.03 -0.025 0);	// global position
        gain    	$translational_spring;
    }
    L03_L13Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L03part;
	reaction	L13part;	
	connection_point (0 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L03_L13Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L03part;
	reaction	L13part;	
	connection_point (0 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L13_L23Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L13part;
	reaction	L23part;	
	connection_point (0.01 -0.03 0);	// global position
        gain    	$translational_spring;
    }
    L13_L23Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L13part;
	reaction	L23part;	
	connection_point (0.01 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L04_L14Ca
    {
        type           	rigidbodyConnectionCOM;
        body            L04part;
	reaction	L14part;	
	connection_point (0 -0.04 0);	// global position
        gain    	$translational_spring;
    }
    L04_L14Cb
    {
        type           	rigidbodyConnectionCOM;
        body            L04part;
	reaction	L14part;	
	connection_point (0 -0.05 0);	// global position
        gain    	$translational_spring;
    }

//  ********** rigidbody attitude *****************

    thorax_abdomen
    {
        type           	coilSpringDamperCOM;
        body            thoraxpart;
	reaction	abdomenpart;	/* body ID for reaction torque */
        gain    	$coil_spring;
    }

    thorax_R00
    {
        type           	coilSpringDamperCOM;
        body            thoraxpart;
	reaction	R00part;	
        gain    	$coil_spring_for_leadingedge;
    }
    R00_R02
    {
        type           	coilSpringDamperCOM;
        body            R00part;
	reaction	R02part;	
        gain    	$coil_spring_for_leadingedge;
    }
    R02_R03
    {
        type           	coilSpringDamperCOM;
        body            R02part;
	reaction	R03part;	
        gain    	$coil_spring_for_leadingedge;
    }
    R03_R04
    {
        type           	coilSpringDamperCOM;
        body            R03part;
	reaction	R04part;	
        gain    	$coil_spring_for_leadingedge;
    }
    R00_R12
    {
        type           	coilSpringDamperCOM;
        body            R00part;
	reaction	R02part;	
        gain    	$coil_spring;
    }
    R12_R13
    {
        type           	coilSpringDamperCOM;
        body            R02part;
	reaction	R03part;	
        gain    	$coil_spring;
    }
    R13_R14
    {
        type           	coilSpringDamperCOM;
        body            R03part;
	reaction	R04part;	
        gain    	$coil_spring;
    }
    R20_R21
    {
        type           	coilSpringDamperCOM;
        body            R20part;
	reaction	R21part;	
        gain    	$coil_spring;
    }
    R21_R22
    {
        type           	coilSpringDamperCOM;
        body            R21part;
	reaction	R22part;	
        gain    	$coil_spring;
    }
    R22_R23
    {
        type           	coilSpringDamperCOM;
        body            R22part;
	reaction	R23part;	
        gain    	$coil_spring;
    }
    R30_R31
    {
        type           	coilSpringDamperCOM;
        body            R30part;
	reaction	R31part;	
        gain    	$coil_spring;
    }
    R31_R32
    {
        type           	coilSpringDamperCOM;
        body            R31part;
	reaction	R32part;	
        gain    	$coil_spring;
    }
    R40_R41
    {
        type           	coilSpringDamperCOM;
        body            R40part;
	reaction	R41part;	
        gain    	$coil_spring;
    }
    R41_R42
    {
        type           	coilSpringDamperCOM;
        body            R41part;
	reaction	R42part;	
        gain    	$coil_spring;
    }

    R00_R20
    {
        type           	coilSpringDamperCOM;
        body            R00part;
	reaction	R20part;	
        gain    	$coil_spring;
    }
    R20_R30
    {
        type           	coilSpringDamperCOM;
        body            R20part;
	reaction	R30part;	
        gain    	$coil_spring;
    }
    R30_R40
    {
        type           	coilSpringDamperCOM;
        body            R30part;
	reaction	R40part;	
        gain    	$coil_spring;
    }
    R00_R21
    {
        type           	coilSpringDamperCOM;
        body            R00part;
	reaction	R21part;	
        gain    	$coil_spring;
    }
    R21_R31
    {
        type           	coilSpringDamperCOM;
        body            R21part;
	reaction	R31part;	
        gain    	$coil_spring;
    }
    R31_R41
    {
        type           	coilSpringDamperCOM;
        body            R31part;
	reaction	R41part;	
        gain    	$coil_spring;
    }
    R41_R51
    {
        type           	coilSpringDamperCOM;
        body            R41part;
	reaction	R51part;	
        gain    	$coil_spring;
    }
    R51_R61
    {
        type           	coilSpringDamperCOM;
        body            R51part;
	reaction	R61part;	
        gain    	$coil_spring;
    }
    R02_R12
    {
        type           	coilSpringDamperCOM;
        body            R02part;
	reaction	R12part;	
        gain    	$coil_spring;
    }
    R12_R22
    {
        type           	coilSpringDamperCOM;
        body            R12part;
	reaction	R22part;	
        gain    	$coil_spring;
    }
    R22_R32
    {
        type           	coilSpringDamperCOM;
        body            R22part;
	reaction	R32part;	
        gain    	$coil_spring;
    }
    R32_R42
    {
        type           	coilSpringDamperCOM;
        body            R32part;
	reaction	R42part;	
        gain    	$coil_spring;
    }
    R03_R13
    {
        type           	coilSpringDamperCOM;
        body            R03part;
	reaction	R13part;	
        gain    	$coil_spring;
    }
    R13_R23
    {
        type           	coilSpringDamperCOM;
        body            R13part;
	reaction	R23part;	
        gain    	$coil_spring;
    }
    R04_R14
    {
        type           	coilSpringDamperCOM;
        body            R04part;
	reaction	R14part;	
        gain    	$coil_spring;
    }

    thorax_L00
    {
        type           	coilSpringDamperCOM;
        body            thoraxpart;
	reaction	L00part;	
        gain    	$coil_spring_for_leadingedge;
    }
    L00_L02
    {
        type           	coilSpringDamperCOM;
        body            L00part;
	reaction	L02part;	
        gain    	$coil_spring_for_leadingedge;
    }
    L02_L03
    {
        type           	coilSpringDamperCOM;
        body            L02part;
	reaction	L03part;	
        gain    	$coil_spring_for_leadingedge;
    }
    L03_L04
    {
        type           	coilSpringDamperCOM;
        body            L03part;
	reaction	L04part;	
        gain    	$coil_spring_for_leadingedge;
    }
    L00_L12
    {
        type           	coilSpringDamperCOM;
        body            L00part;
	reaction	L02part;	
        gain    	$coil_spring;
    }
    L12_L13
    {
        type           	coilSpringDamperCOM;
        body            L02part;
	reaction	L03part;	
        gain    	$coil_spring;
    }
    L13_L14
    {
        type           	coilSpringDamperCOM;
        body            L03part;
	reaction	L04part;	
        gain    	$coil_spring;
    }
    L20_L21
    {
        type           	coilSpringDamperCOM;
        body            L20part;
	reaction	L21part;	
        gain    	$coil_spring;
    }
    L21_L22
    {
        type           	coilSpringDamperCOM;
        body            L21part;
	reaction	L22part;	
        gain    	$coil_spring;
    }
    L22_L23
    {
        type           	coilSpringDamperCOM;
        body            L22part;
	reaction	L23part;	
        gain    	$coil_spring;
    }
    L30_L31
    {
        type           	coilSpringDamperCOM;
        body            L30part;
	reaction	L31part;	
        gain    	$coil_spring;
    }
    L31_L32
    {
        type           	coilSpringDamperCOM;
        body            L31part;
	reaction	L32part;	
        gain    	$coil_spring;
    }
    L40_L41
    {
        type           	coilSpringDamperCOM;
        body            L40part;
	reaction	L41part;	
        gain    	$coil_spring;
    }
    L41_L42
    {
        type           	coilSpringDamperCOM;
        body            L41part;
	reaction	L42part;	
        gain    	$coil_spring;
    }

    L00_L20
    {
        type           	coilSpringDamperCOM;
        body            L00part;
	reaction	L20part;	
        gain    	$coil_spring;
    }
    L20_L30
    {
        type           	coilSpringDamperCOM;
        body            L20part;
	reaction	L30part;	
        gain    	$coil_spring;
    }
    L30_L40
    {
        type           	coilSpringDamperCOM;
        body            L30part;
	reaction	L40part;	
        gain    	$coil_spring;
    }
    L00_L21
    {
        type           	coilSpringDamperCOM;
        body            L00part;
	reaction	L21part;	
        gain    	$coil_spring;
    }
    L21_L31
    {
        type           	coilSpringDamperCOM;
        body            L21part;
	reaction	L31part;	
        gain    	$coil_spring;
    }
    L31_L41
    {
        type           	coilSpringDamperCOM;
        body            L31part;
	reaction	L41part;	
        gain    	$coil_spring;
    }
    L41_L51
    {
        type           	coilSpringDamperCOM;
        body            L41part;
	reaction	L51part;	
        gain    	$coil_spring;
    }
    L51_L61
    {
        type           	coilSpringDamperCOM;
        body            L51part;
	reaction	L61part;	
        gain    	$coil_spring;
    }
    L02_L12
    {
        type           	coilSpringDamperCOM;
        body            L02part;
	reaction	L12part;	
        gain    	$coil_spring;
    }
    L12_L22
    {
        type           	coilSpringDamperCOM;
        body            L12part;
	reaction	L22part;	
        gain    	$coil_spring;
    }
    L22_L32
    {
        type           	coilSpringDamperCOM;
        body            L22part;
	reaction	L32part;	
        gain    	$coil_spring;
    }
    L32_L42
    {
        type           	coilSpringDamperCOM;
        body            L32part;
	reaction	L42part;	
        gain    	$coil_spring;
    }
    L03_L13
    {
        type           	coilSpringDamperCOM;
        body            L03part;
	reaction	L13part;	
        gain    	$coil_spring;
    }
    L13_L23
    {
        type           	coilSpringDamperCOM;
        body            L13part;
	reaction	L23part;	
        gain    	$coil_spring;
    }
    L04_L14
    {
        type           	coilSpringDamperCOM;
        body            L04part;
	reaction	L14part;	
        gain    	$coil_spring;
    }

	//  ********** collision *****************
    wing_tips
    {
        type           	collisionCOM;
        body            R14part;
	target_point 	(0  0.052 0);	// global position
	reaction	L14part;	
	reaction_point 	(0 -0.052 0);	// global position
        gain    	$collision_para;
    }
    wing_bases
    {
        type           	collisionCOM;
        body            R40part;
	target_point 	(0.034  0.03 0);	// global position
	reaction	L40part;	
	reaction_point 	(0.034 -0.03 0);	// global position
        gain    	$collision_para;
    }
    tails
    {
        type           	collisionCOM;
        body            R61part;
	target_point 	(0.05  0.017 0);	// global position
	reaction	L61part;	
	reaction_point 	(0.05 -0.017 0);	// global position
        gain    	$collision_para;
    }
    abdomen_wingR
    {
        type           	collisionCOM;
        body            abdomenpart;
	target_point 	(0.024 0.017 -0.005);	// global position
	reaction	R30part;	
	reaction_point 	(0.024 0.003 0);	// global position
        gain    	( 0.01 1.0e-5 0.002 );
    }
    abdomen_wingL
    {
        type           	collisionCOM;
        body            abdomenpart;
	target_point 	(0.024 0.017 -0.005);	// global position
	reaction	L30part;	
	reaction_point 	(0.024 -0.003 0);	// global position
        gain    	( 0.01 1.0e-5 0.002 );
    }

	// *************** flapping and abdomen swing *************
    flappingR
    {
        type           	angleControlWaveCOM;
        body            R00part;
        parameters      (0.04 4.0e-5 0.01 -1.0472 10.0 0.16745  0.17453 0 0.001);	// (P gain, D gain, max input, A [rad], f [Hz], P [rad], S [rad], axis(x:0, y:1, z:2), R time ): A*sin(2pi*f*t+P) + S
	reaction	thoraxpart;	// body name for reaction torque
    }
    flappingL
    {
        type           	angleControlWaveCOM;
        body            L00part;
        parameters      (0.04 4.0e-5 0.01  1.0472 10.0 0.16745 -0.17453 0 0.001);	// (P gain, D gain, max input, A [rad], f [Hz], P [rad], S [rad], axis(x:0, y:1, z:2), R time ): A*sin(2pi*f*t+P) + S
	reaction	thoraxpart;	// body name for reaction torque
    }
    abdomenswing
    {
        type           	angleControlWaveCOM;
        body            abdomenpart;
        parameters      (0.08 8.0e-5 0.02  -0.34907 10.0 0.0  0.0 1.0 0);
	reaction	thoraxpart;	/* body ID for reaction torque */
    }
}

// ************************************************************************* //
