# What's the meaning of this AnyMuscleModelUsr1 ContactMuscleModel2? How does Direction0Muscle work?

Hi, I found some code in the example. But I can't get the meaning of it.

1. In AnyMuscleModelUsr1 ContactMuscleModel2, only Fo and S were defined, what's the relationship between its length and force? Does it mean that if it's shorter than the optimal length, the force is zero? When longer than optimal length, the force is ContactStrengthSmoothed? Where can I find the optimal length? Or it is just a constant force?
2. A NormalDirectionMuscle was generated. I want to know how this muscle works. Does it mean that this NormalDirectionMuscle is a positive constant force that its derection is from BaseObject to TargetObject?

Thanks!

Best,

TJ

Blockquote
AnyKinLinear Lin={
AnyRefFrame &Box =..BaseObject;
AnyRefFrame &Hand = ..TargetObject;
Ref=0;
};
AnyMuscleModelUsr1 ContactMuscleModel2=
{
F0 = 0.000000;
//S = .UserDefinedStrengthFunction;
S = .ContactStrengthSmoothed;
};
AnyFolder Direction0Muscle ={
AnyGeneralMuscle NormalDirectionMuscle={
AnyKinMeasureOrg NormalDir={
AnyKinLinear &ref=...Lin;
MeasureOrganizer={....Direction[0]}; //always pick first element
};
AnyMuscleModelUsr1 &ref1=..ContactMuscleModel2;
ForceDirection=1;
//AnyVar StrengthTestVal =
EXCLUDE_MUSCLE_METABOLISM
};
};

Hi TJ,

I believe your questions are answered in the reference manual. Please see the AnyScript reference manual for AnyMuscleModelUsr1 and AnyGeneralMuscle. Please also consider seeing their parent classes as child classes inherit the properties of their parent classes.

The normal direction muscle will act on kinematic measure referred and along the direction specified by ForceDirection. Please note, that it will not be a "constant" force. Muscle forces are solved through the muscle recruitment algorithm.

Best,
Dave

Thanks for your explanation, I think I have gotten the basic idea of it. However, I still can't understand what's the purpose of introducing the AnyKinMeasureOrg. Could you explain it more? I have read the tutorials. Does it mean that the force is along the direction of "Z" of the measure reference coordinate system? Thanks!

Best,

TJ

TJ,

AnyKinMeasureOrg has a rather good description in the ref. manual It is used to "organize" your kinematic measures, hence the Org. And in this particular example it composes a kinematic measure that corresponds to the relevant degree of freedom.

Kind regards,
Pavel

Yes, the AnyKinMeasureOrg is used to choose the measure, but what's the meaning of this measure in the muscle generated? In the tutorials, it is said that AnyGeneralMuscle can provide moment as well as force depending on the nature of its kinematic measure. The kinematic measure is supplied by the user. For instance, you can make a “rotational” muscle by applying a revolute joint as kinematic measure in your muscle object. But what's the meaning of the nature of its kinematic measure? What's the nature of this particular example-NormalDir? Thanks!

Best,

TJ

Since you are looking to a contact modelling using AnyGeneralMuscle - the meaning of all this code is to generate a force object, activated under certain conditions, which will be given a direction/plane of action using the specified kinematic measure. And this direction is the normal direction to the surface, represented by AnyRefFrame &Box. Ref=0; means that the coordinate system is positioned in the BaseObject (according to ref. manual).

NormalDir in this case is the specification of the contact force direction.

Great, thank you for your help!

Best,

TJ

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.