minimization fmincon with ode

1 visualización (últimos 30 días)
AM
AM el 8 de En. de 2019
Comentada: Torsten el 8 de En. de 2019
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,

Respuesta aceptada

Torsten
Torsten el 8 de En. de 2019
Editada: Torsten el 8 de En. de 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.
Best wishes
Torsten.
  2 comentarios
AM
AM el 8 de En. de 2019
I see, thank you!
Does that mean that if all the other aspects of my code were optimized (which isn't the case yet), there is nothing else that can be done regarding this bottleneck to improve overall efficiency? I can't provide an anlytical expression of the gradient so I wanted to see if it could be done numerically.
Torsten
Torsten el 8 de En. de 2019
You can use derivative-free optimization methods, e.g. fminsearch.
For methods that need the Jacobian, nothing can be done.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by