minimization fmincon with ode
3 views (last 30 days)
Hello, I am using fmincon to fit my model to data.
I have a set of differential equations that give me the model results:
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.
Torsten on 8 Jan 2019
Edited: Torsten on 8 Jan 2019
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.