How to speed up fmincon?
8 views (last 30 days)
Show older comments
Hello, I'm trying to get optimized two parameters in the differential equations. I've already gotten very helpful answers when I asked here using a simple example. So now I know how to make my code, but my actual system is consisted of 64 differential equations. In other words, my goal is to find out two parameters that are in all differential equations, while solving 64 differential equations to make one objective function to minimum. But when I run the code, it was running for several hours. And it's still 'busy'. Does that mean my code has a problem? I'm attaching my code. Please help me. Thank you.
0 Comments
Accepted Answer
Matt J
on 19 Jun 2014
Your tolerances 'TolX',1e-100,'TolCon',1e-100 are extremely small. That can protract the optimization.
7 Comments
Marc
on 23 Jun 2014
First off it should not surprise you that two different ODE integrators give you different results.
Second, when optimizing odes like this, you should first off try to "optimize" which ode integrator to use by timing the solution to the ode equation. If it takes ode15s 0.1s to solve your system, expect the optimization to take awhile. Since you are only looking at two parameters, a quick sensitivity analysis of time vs ode integrator, along with "accuracy" should be easy.
Now back to your problem... Try fminsearch. I have found that the nelder mead simplex routines which do not rely on jacobians or hessians to be more robust to these kinds of systems.
Be careful how you are defining your objective function. Scaling this could be of help.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!