opty icon indicating copy to clipboard operation
opty copied to clipboard

Implement analytic specification of the cost function.

Open moorepants opened this issue 10 years ago • 3 comments

  • [ ] Support the integral a general function of the states and inputs.

moorepants avatar May 22 '15 22:05 moorepants

@tvdbogert I'm going to try to implement functionality that lets you pass in an analytic cost function. I'm basically going to support integrals (or combinations of integrals) that get converted to the proper numerical code underneath. The cost function will allow integrals of functions of the state, exogenous inputs, extra values (like the measurement of the states for tracking), and the system parameters. My main example case would be something like the sum of two integrals: an effort term and a tracking term, where the tracking could be a complicated function of the states (like tracking GRFs in walking). Do you have other examples of cost functions that may be good to support?

moorepants avatar Jun 05 '15 05:06 moorepants

Other cost functions that can be useful:

"minus speed" (for sprint optimization). This is simply the horizontal position of the body at the final node, divided by movement duration

"metabolic energy" which is the integral of energy rate, which is a function of muscle state variables and controls. The model that is most commonly used (Umberger 2010) has some "if" statements though and some discontinuities. This will need some work. Even if made continuous, it may be hard to code as an analytical function. Maybe allow for numerical functions too? With user-provided derivatives?

tvdbogert avatar Jun 05 '15 13:06 tvdbogert

Oh, and various formulations of effort can be possible.

Instead of squared muscle controls, using cubed.

Or first take the mean of each muscle control over time, then square or cube them, and add them up. This is (theoretically) closer to a minimum fatigue function than when you cube it first and then integrate. This is no longer an integral of a function of states and controls, so this one also may require a user-supplied piece of code rather than an analytical function.

Let's focus on the cost function you need now (which is just tracking cost) but it is good to have the possibility of adding others.

tvdbogert avatar Jun 05 '15 13:06 tvdbogert