Azzera filtri
Azzera filtri

Estimate differential equation parameters

13 visualizzazioni (ultimi 30 giorni)
Dear all,
I need to estimate a parameter of a second order differential equation. This equation is a law of the displacement of a floating body. I know a solution in time domain coming from the experimental investigation but the roblem are the values of the parameters. Is there any function to estimate a differetial equation parameters?
Thanking in advance
Alessandro Antonini

Risposta accettata

Shashank Prasanna
Shashank Prasanna il 31 Gen 2013
You can set up an optimization problem to 'fit' your ode to the experimental data for certain parameters that minimize the error between the fitted and real data.
Here is a link in the documentation that explains how to go about this: http://www.mathworks.com/help/optim/ug/optimizing-a-simulation-or-ordinary-differential-equation.html
  3 Commenti
Shashank Prasanna
Shashank Prasanna il 1 Feb 2013
Modificato: Shashank Prasanna il 1 Feb 2013
Ok, at this point i am assuming you know how to set up an ode and solve it using ODE45, if you are not sure then please look through some examples in: http://www.mathworks.com/help/matlab/ref/ode45.html
I am going to assume you ode function is 'odefun' as in some examples in the link, but with an extra parameter p passed by the optimizer.
Create your objective function such that it minimizes the error between your fitted ode result for a given parameter(s) p.
function err = odefit(exp_t,exp_y,p)
[t,y] = ode45(@(t,y)odefun(t,y,p),exp_t,0) % i am using y0=0 you can choose whatever.
err = sum((y-exp_y).^2); % compute error between experimental y and fitted y
end
p_estimate = fminsearch(@(p)odefit(exp_t,exp_y,p),p0);
Choice of optimization function is left to you and some dangers are listed in the link i gave in the previous post.
Alessandro Antonini
Alessandro Antonini il 1 Feb 2013
Yes I know how set up ODE. Thanks

Accedi per commentare.

Più risposte (1)

Matt J
Matt J il 31 Gen 2013
Modificato: Matt J il 31 Gen 2013
If it's a linear differential equation with constant unknown coefficients, just evaluate both sides of your differential equation at lots of time points. This will result in a linear system of equalities in the unknown parameters x(i), representable in matrix/vector form as
A*x=b
Then solve by doing x=A\b.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by