Can I apply a Force which accounts for an OutputVar variable?

Hi everyone,

I ask for your precious help about AMMR full-body model.

I need to apply a force (F) which at time step n accounts for the contribution of a reaction force (Fr) calculated at the previous time step (n-1). In particular, F is applied to a lumbar joint, and Fr is the 'y' component of Fr in the same joint.
Actually it seems that it is not feasible, since Fr is an 'OutputVar' and thus is not ready for evaluation when the model computes F at the beginning of the simulation. I wonder if there is any solution, for example by setting an initial value for Fr before running the inverse dynamics process, and let the model to use that value in applying F at time step 1.

Many thanks in advance.

Hi Tito,

You are right, this is not possible within AnyBody. A reaction force is computed as an output of the inverse dynamics analysis. An applied force can't be made as a variable of a force computed in the previous step.

You can look into the Python hook. This can probably be useful for you. However, please be aware of the caveats, like you would need to consider an initial value and the outputs will depend on the number of time-steps in the simulation. Also, generally, any external force that you would apply like this will not change the motion and that may deviate the simulation from reality.

Best regards,

Many thanks Dave for your quick reply!


You are welcome :slight_smile: