OpenSim Moco  0.4.0
Frequently Asked Questions


Frequently Asked Questions

This page contains a list of answers to miscellaneous questions. If you have a question that is not answered here, contact the OpenSim Moco team.

How do I define a custom goal or cost term?

If Moco does not contain a cost term you need, you can create your own in C++ by deriving from the MocoGoal class. If you do not want to use C++, you can draft your goal in Matlab, send us your Matlab code, and we will consider implementing it in C++ for you. See Defining a custom goal or cost for more information.

How do I interrupt an optimization in MATLAB?

Sometimes, you may want to interrupt an optimization before it is complete. In MATLAB, we commonly use Ctrl-C to interrupt code, but this does not work during a Moco optimization.

Use this alternative: During an optimization, Moco tries to write a text file to your current directory named "delete_this...". Delete this file to interrupt the optimization.