ODE and Data fitting

7 次查看(过去 30 天)
I have 3 differential equations:
The initial condition for all the equations at timepoint=0 equal to 0. After solving this equaitons, I want to a data fitting on the equation below in order to find the nest fitted A, B, and C.
Can someone help me on this, because I face several errors when I tried to do it.
Maybe the best way is to find the u, v, and w functions and then place them in equations x and y; but how can I do it? is there any way that ode45 give the formula of u,v, and w?

采纳的回答

Star Strider
Star Strider 2020-1-8
All I can do is to point you in the direction of successful efforts to do what you want.
We can’t help without seeing your code.
  5 个评论
Star Strider
Star Strider 2020-1-13
Ehsan Homaee’s Answer moved here —
Thanks for your response. Why the output has 6 diffeent B? Since the objective function only has 3 parameters,what is the other 3 parameters?
Furthermore, if I want to restrict the parameters to only possitive values, how can I do it?
Star Strider
Star Strider 2020-1-13
As always, my pleasure!
The first 3 ‘B’ parameters correspond to ‘A’, ‘B’, and ‘C’. The last 3 are the initial conditions of the system of differential equations, since I always let the optimization function estimate them as well.
To restrict the first 3 to positive values, the lsqcurvefit call changes to:
[B,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat]=lsqcurvefit(@Objfcn,B0,tdata,Crodata1, [zeros(1,3), -Inf(1,3)]);
I would not constrain the initial conditions. However if you want to constrain them as well to be positive:
[B,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat]=lsqcurvefit(@Objfcn,B0,tdata,Crodata1,zeros(1,6));
I suspect the ga function would come up with the best parameter set, since it searches the entire parameter space and is not usually affected by local minima.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by