Change objective function

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Weronika R
Posts: 1
Joined: Tue Mar 12, 2019 12:12 pm

Change objective function

Post by Weronika R » Tue Apr 16, 2019 1:53 pm


I'm scripting in C++. I want to change objective function in Static Optimization and Computed Muscle Control. Is it necessary to build OpenSim from source whether can I do this using the OpenSim API?
Is it possible to write the objective function as in the example: ... timization
and define it as a public member of the class?

Which solution will be the best and the simplest?



User avatar
Thomas Uchida
Posts: 1061
Joined: Wed May 16, 2012 11:40 am

Re: Change objective function

Post by Thomas Uchida » Tue Apr 16, 2019 6:36 pm

You could write a plugin. See, for example, these projects on simtk:
- "An OpenSim plugin to minimize joint reaction forces and muscle activations" (
- "Synergy Optimization: A plug-in to couple muscle activity in OpenSim" (