Optimization constraints

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Erik Dijkstra
Posts: 21
Joined: Wed Aug 18, 2010 5:24 am

Optimization constraints

Post by Erik Dijkstra » Tue Mar 05, 2013 7:14 am

Hi,

I am working with the example: 'Create an Optimization' with OpenSim 3.0 and manage to run the optimization. However, I noticed that the elbow is excessively over-extending. To prevent this from happening I though I could easily add a constraint or bounds to the optimization. But I can't figure out how to do this. Somewhere I have to introduce additional parameters(joint angles) which are not taking in as design parameters in the optimization but are used as constraints.

Does someone has an idea how to incorporate this in the example?

Kind regards,
Erik

User avatar
Ayman Habib
Posts: 2255
Joined: Fri Apr 01, 2005 12:24 pm

Re: Optimization constraints

Post by Ayman Habib » Fri Mar 08, 2013 10:55 am

Hi Eric,

The bounds on coordinates are not part of the model as you'd have to model how the elbow is handled at/near the limit and what forces are applied to enforce it. You could do the limits during the optimization or if you want to build it into the model add a CoordinateLimitForce to stop the elbow from hyper-extending.

Hope this helps,
-Ayman

User avatar
Erik Dijkstra
Posts: 21
Joined: Wed Aug 18, 2010 5:24 am

Re: Optimization constraints

Post by Erik Dijkstra » Tue Mar 12, 2013 8:22 am

Hi Ayman,

Thank you for your reply. I successfully build the coordinate limits in the model. However, I can't seem to get the limits working by constraining in the optimization instead of in the model. I wrote an inequality constraint by getting the elbow coordinate value and specify that it should be greater or equal to zero.

Since it didn't work I looked at an optimization example from SimTKmath and noticed that I might have to provide the jacobian. Is there a way to I get the Jacobian with respect to opensim model coordinates?

Best regards,
Erik

User avatar
Michael Sherman
Posts: 814
Joined: Fri Apr 01, 2005 6:05 pm

Re: Optimization constraints

Post by Michael Sherman » Tue Mar 12, 2013 9:20 am

Hi, Erik. The Simbody optimizers can compute the Jacobian numerically if you don't supply one. There is a SimTKmath example called ConstrainedNumericalDiffOptimization that demonstrates.

Regards,
Sherm

POST REPLY