Modifying the cost function of static optimization?

Hello Anybody community!
I'm working on the LowerExtremity mocap model of AMMR 3.0.4 without FDK, with the moving-axis knee developed by Dzialo et al.
During the static optimization, I would like to modify the cost-function in Anybody so that, in addition to taking into account the minimization of muscle activations, it also takes into account the minimization of knee contact forces.
I saw that a similar topic had been discussed in 2013 (Optimise joint force), I was wondering if any updates had been made in the meantime allowing more customization of the cost-function or if the solution remains to replace knee reactions with AnyGeneralMuscle?
Thank you very much for your help.
Best regards,
Elisa

Hi Elisa,

Welcome to the AnyScript Forum!

I think the discussion that you searched already is still valid today. There is still no possibility to minimize reaction force. So, your option is to replace the reaction force with a recruited force. Now, we have further possibilities in recruited force. We have a new AnyRecruitedActuator class that can be relevant. Functionally, it is a recruited force and is minimized by the solver during muscle recruitment, so you can consider its behavior exactly as a muscle in the inverse dynamics problem. However, it is easier to use AnyRecruitedActuator as you can recruit bilateral force instead of the unidirectional force from the AnyMuscleGeneric (AnyGeneralMuscle has been renamed) class. Also, you can provide multiple kinematic measures within a single instance of AnyRecruitedActuator. As is the case with AnyMuscleGeneric that needs a muscle model, you must specify a strength (which can be a function of kinematic outputs) for the recruited actuator. Please see the reference manual.

In the end, it doesn't matter if you use AnyRecruitedActuator or AnyMuscleGeneric. It should give you the same outputs if they are setup equally. Feel free to use whatever you are comfortable with.

Best regards,
Dave

Hi,
Thank you so much for your response.
Best regards,
Elisa