//Small application made to display how to create an output file with some output //which could be usefull for an FE analysis //It produces an output file which contains a force vector for each muscles. The force vector is given in the local coordinate system of the segment. //Note: this model is in principle instable when the arm is vertical (zero moment arms for the muscles), but this is not important for this illustration Main = { // The actual body model goes in this folder AnyFolder MyModel = { // Global Reference Frame AnyFixedRefFrame GlobalRef = { AnyDrawRefFrame drw={}; AnyRefNode node1={sRel={0,1,0};}; AnyRefNode node2={sRel={0,-1,0};}; }; // Global reference frame AnySeg arm ={ Mass=10; Jii={0.1,0.1,0.1}; AnyRefNode node1={ sRel={-0.5,0,0}; }; AnyRefNode node2={ sRel={0.5,0,0}; }; AnyDrawSeg drw={}; }; AnyRevoluteJoint jnt ={ AnyFixedRefFrame &ref1= .GlobalRef; AnyRefNode &ref2=.arm.node1; }; AnyKinEqSimpleDriver drv={ AnyRevoluteJoint &ref=.jnt; DriverPos={0}; DriverVel={2*pi}; Reaction.Type={Off}; }; AnyViaPointMuscle mus1={ AnyMuscleModel mdl1={F0=1000;}; AnyRefNode &org =.GlobalRef.node1; AnyRefNode &ins =.arm.node2; AnyDrawMuscle drw={}; }; AnyViaPointMuscle mus2={ AnyMuscleModel mdl1={F0=1000;}; AnyRefNode &org =.GlobalRef.node2; AnyRefNode &ins =.arm.node2; AnyDrawMuscle drw={}; }; }; // MyModel // The study: Operations to be performed on the model AnyBodyStudy MyStudy = { AnyFolder &Model = .MyModel; RecruitmentSolver = MinMaxSimplex; Gravity = {0.0, -9.81, 0.0}; AnyFolder Measures ={ //Measure the force and moment created by the muscle in its insertation point AnyForceMomentMeasure Mus1Measure ={ AnyRefNode &ref1= ..Model.mus1.ins; AnyViaPointMuscle &mus =..Model.mus1; }; //Measure the force and moment created by the muscle in its insertation point AnyForceMomentMeasure Mus2Measure ={ AnyRefNode &ref1= ..Model.mus2.ins; AnyViaPointMuscle &mus =..Model.mus2; }; }; //Small example on output which could be usefull for an FE analysis AnyOutputFile FEOutput ={ FileName ="FEData.txt"; //muscle insertation points in global cooridnates AnyVec3 mus1insertation=.Model.mus1.ins.r; AnyVec3 mus1origin=.Model.mus1.org.r; //muscle insertation points in global cooridnates AnyVec3 mus2insertation=.Model.mus2.ins.r; AnyVec3 mus2origin= .Model.mus2.org.r; //Position of the arm seg in global coordinates AnyVec3 armpos=.Model.arm.r; //Orientation of the arm seg in global coordinates AnyMat33 armorientation=.Model.arm.Axes; //this is the muscle force vector in local cooridnates of the arm seg AnyVec3 Mus1ForceVectorLocal = .Measures.Mus1Measure.F*.Model.arm.Axes; AnyVec3 Mus2ForceVectorLocal = .Measures.Mus2Measure.F*.Model.arm.Axes; }; }; }; // Main