Hi I have a question regarding to find the best parameters for my model to fit my data.
I have 3 ordinary equation, and I now just picked some parameters (k1 = 7.32*10^-5; k2 = 8.09*10^-9
) for my ODE.
Defined all the constant values:
k1 = 7.32*10^-5;
k2 = 8.09*10^-9;
Da = 1.33*10 - 4;
Nd0 = 0.001;
HR0 = 0.2;
H0908 = 0.004;
x0 = 0.007;
And define the 3 ODE equations:
Equation1908 = {Nd0*
Caf908'[t] == -k1*(Nd0*HR0)/H0908*Caf908[t]*Cbf908[t]/Hf908[t] +
k2*(0.2 - 3*HR0*Cbf908[t]),
HR0*Cbf908'[t] == -3*k1*(Nd0*HR0)/H0908*Caf908[t]*
Cbf908[t]/Hf908[t] + 3*k2*(0.2 - 3*HR0*Cbf908[t]),
H0908*Hf908'[t] ==
3*k1*(Nd0*HR0)/H0908*Caf908[t]*Cbf908[t]/Hf908[t] -
3*k2*(0.2 - 3*HR0*Cbf908[t]),
Caf908[0] == 1, Cbf908[0] == 1, Hf908[0] == 1};
Using NDSolve
:
BC1908 = NDSolve[
Equation1908, {Caf908[t], Cbf908[t], Hf908[t]}, {t, 0, 1000}]
At the end, I obtained 3 interpolating function, for Caf908[t]
, Cbf908[t]
, and Hf908[t]
... I used the solution (Caf908[t]
) to fit my data. X-axis (tfexp0908
) versus y-axis (fexp0908
):
fexp0908 = .001*{1.009790523`, 0.898335138`, 0.878948419`,
0.830114856`, 0.767123385`, 0.732170062`, 0.672106602`,
0.637589428`, 0.59141947`, 0.523944512`, 0.554584169`,
0.451444203`, 0.396545111`, 0.444125908`, 0.352355452`,
0.272913948`, 0.33877861`, 0.287900412`, 0.276936425`};
tfexp0908 = {0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 180, 210,
245, 270, 300, 330, 360, 390};
And I obtained a good fit. But I would like to know how I can use Mathematica to obtain the best parameter, k1
& k2
, for my model (Caf908[t]
) and get the best fit to my data. Thank you!