How to speed up fmincon?

7 次查看(过去 30 天)
kkng
kkng 2014-6-19
评论: Marc 2014-6-23
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.

采纳的回答

Matt J
Matt J 2014-6-19
Your tolerances 'TolX',1e-100,'TolCon',1e-100 are extremely small. That can protract the optimization.
  7 个评论
kkng
kkng 2014-6-23
Thank you again for your comment. You're right. I got the different result when I put the different initial guesses. To reduce the iteration time, I tried ode15s instead of ode113, but the error message was appeared during nonlinearsquare.m. Attempted to access y(24,64); index out of bounds because size(y)=[23,64]
I also tried to solve my 64 differential equations with fixed parameters as a test. It turned out that ode 113 and ode15s gave me the different number. I was surprised that they didn't give the same result. (I'm a beginner in Matlab.) I'm still stuck in the problem. Can I try anything else? Thank you!!!!
Marc
Marc 2014-6-23
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Problem-Based Nonlinear Optimization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by