//This is a small model made to illustrate a user defined muscle model (AnyMuscleModeUsr1) which is dependent on muscle lenght and velocity. //The active part is dependent on length and velocity and there is a passive element added as well. //Please note that this way of creating muscle models neclects the effect of the internal dof inside the muscle which is part of //three element muscles AnyMuscleModel3E. This means for example that the passive element will not stretch the tendon etc. //On the other hand this model is very flexible in terms of input, since this can be interpolation curves or expressions. Main = { AnyFolder OneMuscleTest = { // Global Reference Frame AnyFixedRefFrame GlobalRef1 = { AnyDrawRefFrame DrwGlobalRef ={ ScaleXYZ ={0.1,0.1,0.1}; }; };//GlobalRef1 AnyFixedRefFrame GlobalRef2 = { Origin ={0,0,-0.3}; AnyDrawRefFrame DrwGlobalRef ={ ScaleXYZ ={0.1,0.1,0.1}; }; };//GlobalRef2 // Segment AnySeg Slider = { r0 = {0,0,0}; Mass = 5.0; Jii = {0.01,0.01,0.01}; AnyRefNode MuscleInsertation = { sRel = {0,0,0}; }; AnyDrawSeg DrwSeg= {}; };//Slider // Joints AnyPrismaticJoint Rail = { Axis = z; AnyFixedRefFrame &ref = Main.OneMuscleTest.GlobalRef1; AnyRefNode &Slider = .Slider.MuscleInsertation; };//Rail // Motion Drivers // Notice that the reaction force's type is set to zero // This indicates that the reactions is inactive, // i.e. it does not carry any load AnyKinEqSimpleDriver SliderMotion = { AnyPrismaticJoint &Jnt = .Rail; DriverPos = {-0.13}; DriverVel = {-0.09}; Reaction.Type = {Off}; };//SliderMotion //Force length relation AnyFunInterpol ForceLength = { Type = Bspline; BsplineOrder = 4; T ={0,0.1,0.15,0.2,0.3} ; //lmt values Data = {{0,0.75,1,0.75,0}}; //fl coefficient }; //Force velocity relation AnyFunInterpol ForceVel = { Type = Bspline; BsplineOrder = 4; T ={-2,-1,-0.5,0,0.5,1,2} ; //lmt values Data = {{0.2,0.4,0.6,1.2,1.3,1.3,1.3}}; //fv coefficients }; // MuscleModel dependent on length and velocity AnyMuscleModelUsr1 TestMuscleMdl1 = { S=.ForceLength(.Muscle1.Line.Pos[0])[0]*.ForceVel(.Muscle1.Line.Vel[0])[0]*100; F0=0; }; AnyViaPointMuscle Muscle1 = { AnyMuscleModel &MusMdl = .TestMuscleMdl1; AnyFixedRefFrame &Org = Main.OneMuscleTest.GlobalRef1; AnyRefNode &Ins = .Slider.MuscleInsertation; AnyDrawMuscle DrwMus = {Bulging=1;}; }; //passive element of the muscle dependent on the muscle length AnyForce PassiveElement ={ F= -{100}*.Muscle1.Line.Pos[0]; AnyKinPLine &ref3=.Muscle1.Line; }; }; // The study: Operations to be performed on the model AnyBodyStudy MyStudy = { AnyFolder &Model = .OneMuscleTest; RecruitmentSolver = MinMaxSimplex; Gravity = {0.0,0.0,-9.81}; nStep=501; // tEnd=0.31; //tStart=0.2; }; }; // Main