I am trying to work out how to include some constraints in the optimization example, e.g. limit how far a coordinate can move. I can see there is a function constraintFunc, but I'm not quite sure how to include it in the code or where it should be called from. Are there any simple examples available that I could get a start from?
Thanks!
Including constraints in the optimization example
- Moe Curtin
- Posts: 43
- Joined: Fri Oct 02, 2009 5:40 am
- Brad Humphreys
- Posts: 79
- Joined: Thu Feb 03, 2011 11:32 am
Re: Including constraints in the optimization example
I am also looking for the same.... an example of using contraintFunc in an optimizer. any help would be appreciated.
Regards,
Brad
Regards,
Brad
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Including constraints in the optimization example
Hi, Moe and Brad.
The logic for constraintFunc() is just like objectiveFunc() -- you write the method but you don't call it yourself. Instead the optimizer will make calls to it when needed.
I don't see an OpenSim example program using this, but it is used internally in OpenSim in the StaticOptimization analysis and a few other places. Simbody has some simple examples of constrained optimization: with numerical derivatives or with analytical derivatives.
Regards,
Sherm
The logic for constraintFunc() is just like objectiveFunc() -- you write the method but you don't call it yourself. Instead the optimizer will make calls to it when needed.
I don't see an OpenSim example program using this, but it is used internally in OpenSim in the StaticOptimization analysis and a few other places. Simbody has some simple examples of constrained optimization: with numerical derivatives or with analytical derivatives.
Regards,
Sherm