ODE and Data fitting

7 vues (au cours des 30 derniers jours)
Ehsan Homaee
Ehsan Homaee le 8 Jan 2020
Commenté : Star Strider le 13 Jan 2020
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?

Réponse acceptée

Star Strider
Star Strider le 8 Jan 2020
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 commentaires
Star Strider
Star Strider le 13 Jan 2020
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 le 13 Jan 2020
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by