ODE and Data fitting

39 ビュー (過去 30 日間)
Ehsan Homaee
Ehsan Homaee 2020 年 1 月 8 日
コメント済み: Star Strider 2020 年 1 月 13 日
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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by