Parameter estimation of a set of ODE
5 次查看(过去 30 天)
显示 更早的评论
I want to fit the parameters and in the following set of coupled differential equations:
where y, z and w depend on time and m is a constant, while P is a given set of data for every time, . The given (measured) data sets are and and I can obtain the set from them. I have tried to follow the procedure described in the Lorenz System example (see here: https://la.mathworks.com/help/optim/ug/fit-differential-equation-ode.html?lang=en) which uses the function lsqcurvefit, but I can't figure out how to include the time variation of the P data set.
Is there any other optimization tool or procedure that may help? Or how should I include the variation of P in the function?
Thanks in advance!
0 个评论
回答(1 个)
Alan Weiss
2019-10-6
I'm not sure how your function is given to MATLAB. But suppose that it is in a function file PofT.m. You simply have to include a call to PofT in your differential equation, like this:
function f = odef(t,a,m,sigma)
f(1) = a(3);
f(2) = a(3) - a(2)*abs(a(3));
f(3) = (1/m)*(PofT(t) - sigma(1)*a(2) - sigma(2)*f(2) + sigma(3)*a(3));
end
Or something to that effect. I used the response variable a = [y,z,w] and sigma having indices 1,2,3 instead of 0,1,2.
If you have measured then you will have to include a call to interp1 or some such function in your definition of for all times t.
Alan Weiss
MATLAB mathematical toolbox documentation
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!