Using the API, I'd like to implement an OptimizerSystem that specifies both an objective function a constraint function.
Using the arm optimization example as a starting point, I've been able to implement a OptimizerSystem with an objective function, but now I'm a bit lost trying to implement the constraint function.
Beyond what's in the doxygen, is there any documentation on this? Are there any examples I've missed that may do something similar? If not, does anyone have any code they wouldn't mind sharing?!
Thanks,
Zach
Specifying an OptimizerSystem with Constraints
- Zach Lerner
- Posts: 5
- Joined: Fri May 27, 2011 1:47 pm
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Specifying an OptimizerSystem with Constraints
Hi, Zach. I don't know if there are OpenSim examples available, but in case not there are some examples in the Simbody code base -- ConstrainedOptimization.cpp and ConstrainedNumericalDiffOptimization.cpp, depending on whether you can write an analytical Jacobian for your constraints. You can get these from the Simbody source for whatever version you're using. I've attached the Simbody 3.0 versions of these examples.
Regards,
Sherm
Regards,
Sherm
- Attachments
-
- ConstrainedNumericalDiffOptimization.cpp
- example with numerical Jacobian
- (4.42 KiB) Downloaded 77 times
-
- ConstrainedOptimization.cpp
- example with analytic Jacobian
- (5.55 KiB) Downloaded 83 times
- Zach Lerner
- Posts: 5
- Joined: Fri May 27, 2011 1:47 pm
Re: Specifying an OptimizerSystem with Constraints
Thanks Sherm, this will be very helpful.