Solving the Kinetic equations by Matlab coding
古いコメントを表示
1. R=R∞[1-exp -kt]
2. R= R∞ {1-1/ kt [1-exp(-kt)]}
where R is the recovery in %; k is the first-order rate constant, t is the time [s], and R∞ is the maximum (theoretical) recovery. These ara 2 example of Kinetic rate eqaction.
I have values of R and t, R∞ is a maximum value of R(recovery), I want to know the value of k..? in this eqations
How to solve this eqactions by using Matlab coding and finally plot the graph of time(t) v/s recovery (R)..?
Example values
Time(t)= 0 , 10, 30, 60,120, 210
Recovery(R) % = 0, 44.90, 71.39, 76.37, 82.81, 87.68
回答 (1 件)
Star Strider
2020 年 8 月 5 日
Try this:
% % % k(1) = R_Inf, k(2) = k
R1fcn = @(k,t) k(1).*(1-exp(-k(2).*t));
R2fcn = @(k,t) k(1).*(1 - (1-exp(-k(2).*t))./(k(2).*t));
t = [0 10 30 60 120 210];
R = [0 44.90 71.39 76.37 82.81 87.68];
[k1,fv1] = fminsearch(@(k) norm(R - R1fcn(k,t)), [100; 0.05]);
[k2,fv2] = fminsearch(@(k) norm(R - R2fcn(k,t)), [100; 0.05]);
figure
plot(t, R, 'p')
hold on
plot(t, R1fcn(k1,t))
plot(t, R2fcn(k2,t))
hold off
grid
legend('Data', 'R_1', 'R_2', 'Location','SE')
For whatever reason, ‘R2fcn’ is not fitting at all well. If I understand your expression for it, it appears to be coded correctly.
The ‘k’ constant is ‘k(2)’ in both functions.
4 件のコメント
Bharath KL
2020 年 8 月 10 日
Star Strider
2020 年 8 月 10 日
My pleasure!
The second equation (that I call ‘R2fcn’) does not appear to be a good fit to your data, and may not even be valid. Look carefully at it, since your original posting of it may not be correct.
You will likely need to have fminsearch continue to iterate in order to find an acceptable fit, or use a different optimisation routine (such as lsqcurvefit or ga, the genetic algorithm function). That will give you the parameter estimates you want.
Bharath KL
2020 年 8 月 11 日
Star Strider
2020 年 8 月 11 日
Those parameter estimates (as noted previously) are the elements of ‘k’:
% % % k(1) = R_Inf, k(2) = k
You will have to calculate ‘R2( R- squear)’ from whatever information is available, since I have no idea what it refers to.
カテゴリ
ヘルプ センター および File Exchange で Spline Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!