I've been trying to think of ways to increase or decrease duty factors in a running simulation. The release notes for OpenSim 4.5 say
, prompting this thread.Foot-ground contact forces can now be optimized (e.g., maximize contact impulse) via MocoOutputGoal using the new Outputs 'sphere_force' and 'half_space_force' added to SmoothSphereHalfSpaceForce.
I think this goal would allow you to add a cost that minimizes duty factors by adding the vertical component of sphere_force to the goal, setting the exponent higher than 1 so the goal is focused on the peak values, and then setting the weight negative.
1) I've read in earlier forum posts that setting a negative weight results in the maximization of a goal, instead of minimization. I don't fully understand how it works. I thought the optimizer reduces costs to zero, but then the sign of the weight shouldn't matter. Does the optimizer attempt to reduce costs to -inf?
2) If my model has 10 contact-forces per foot, would I need to add a MocoOutputGoal for each force element?
I'm also open to trying other approaches - I was considering is adding differently shaped GRF curves as a tracking cost, but maybe there's a more direct way to constrain duty factors that I'm not thinking of.
Cheers,
Pasha