Estimate differential equation parameters

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

 채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 1월 31일

1 개 추천

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

Can you suggest an example,I did not understand too much about that link.
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.
Yes I know how set up ODE. Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2013년 1월 31일
편집: Matt J 2013년 1월 31일

0 개 추천

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.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by