Hello,

For a soft constrained 1DoF knee joint (AnyRevoluteJoint) I would like to use a weight on the other two rotational DoF that depends on the actual deformation in a non linear way (e.g. scale the weight exponentially with the constraint violation (for the code, see below).

However, i get the problem that I can only calculate this weight until moment 'PosVar’. I’ve tried many things using if statements and such, to make sure that I will not use a kinematic measure before the initialisation is finished and actual kinematics starts. For example using an if statement (iffun) where t is compared to tStart, and thus the relative weight is only calculated when the kinematics are running (when t > tStart). But as soon as I link the cost function value in some way to the kinematics, I get the same problem:

…/Jnt.any : ‘Value’ : Expression evaluation failed at moment ‘DesignVar’ :

…\Jnt.any(48) : Weigth : argument will not be ready for evaluation until moment ‘PosVar’

Now I noticed ‘Value’ is a ‘DesignVar’, does this mean it should be a constant and what I’m trying to do is not possible? If not, could you help me solve this problem.

Thanks in advance and kind regards,

Bart Koning

Code for adaptation ofthe knee joint taken from the GaitLowerExtremity AMMRV1.2 repository model (AnyBody version : 4.2.1.1614):

AnyRevoluteJoint Knee = {

Axis = z;

AnyRefNode &ThighNode = …Seg.Thigh.KneeJoint;

AnyRefNode &ShankNode = …Seg.Shank.KneeJoint;

```
Constraints.CType = {Hard,Hard,Hard,Soft,Soft};
Constraints.WeightFun= {&JointSoftContraint2};
```

AnyFunConst JointSoftContraint2 = {

```
AnyFloat Weigth = exp(.Constraints.Pos[4]);
Value = {1,1,1,Weigth ,0.7};
};
```

}; // End of knee