minimization fmincon with ode
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I am using fmincon to fit my model to data.
I have a set of differential equations that give me the model results:
dy/dt=f(x,y,t)
where y are the points I want to compare to experimental points, x are my decision variables and t is time.
My objective function objfun is the sum of the squares of the residuals (y-data)^2
I profiled my code and I saw that it spends the most time solving the ode. I wanted to know if there is a way, numerically, to use my set of ODE dy/dt to determine the gradient dobjfun/dx so I can give it to fmincon beforehand instead of it using finite differences to determine it.
Thank you,
댓글 수: 0
채택된 답변
Torsten
2019년 1월 8일
편집: Torsten
2019년 1월 8일
To get dobjectfun/dx numerically, you had to solve even more ODEs:
Section: Use a Gradient Evaluation Function.
I wouldn't advice you to do so.
Best wishes
Torsten.
댓글 수: 2
Torsten
2019년 1월 8일
You can use derivative-free optimization methods, e.g. fminsearch.
For methods that need the Jacobian, nothing can be done.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!