Parameter Estimation for a System of Differential Equations

53 views (last 30 days)
The following set of ODE's have been previously used in a research paper to produce best fit curves for concentration vs time data for 3 reactants [3], [4] and [5]:
I am trying to reproduce these best fit curves. Usually I would try to solve these ODE's and then take the sum of the square error's of each with the actual y data and then minimze the output in order to solve for k1, k'-1 and k3. However, solving these ODE's has proven to be extremely chaotic (as demonstrated previously by Walter Roberson) and I'm not sure if my whole approach is best given the complexities. Is there another way to go about doing this?
This is the concentration and time data:
%Consider [3] = a, [4] = b and [5] = c
%x values for a & b
t = [0 2.52 4.42 11.99 22.08 32.18 53.00 73.82 99.05 124.92 155.21 191.17 227.13 278.23 380.44];
T = t';
%y values for a
a_ydata = [0.26 0.27 0.27 0.25 0.21 0.17 0.16 0.13 0.10 0.08 0.05 0.04 0.03 0.02 0.01];
A_Ydata = a_ydata';
%y values for b
b_ydata = [0 0 0.01 0.03 0.04 0.05 0.08 0.11 0.14 0.16 0.15 0.17 0.17 0.18 0.18];
B_Ydata = b_ydata';
%x and y values for c
x_c = [0 99.05 124.92 155.21 191.17 227.13 278.23 380.44];
T_C = x_c';
y_c = [0 0.01 0.015 0.018 0.023 0.024 0.028 0.029];
C_Ydata = y_c';
If anyone is able to help me, I would greatly appreciate it!

Accepted Answer

Star Strider
Star Strider on 9 Nov 2020
See the identically-titled Parameter Estimation for a System of Differential Equations for a working solution. You will need to adapt it to your data.
  7 Comments
Star Strider
Star Strider on 9 Nov 2020
My pleasure!
Unfortunately, no.
All the vectors must have the same number of elements in order to form the matrix.
The correct way to do that is to interpolate it:
c_ydata = interp1(x_c, y_c, t)
This has the disadvantage of ‘creating’ data where none previously existed, however I doubt if that would have any significant effect on the estimated parameters.
I commented-out the original ‘c_ydata’ you provided and added these lines to the function I posted:
x_c = [0 99.05 124.92 155.21 191.17 227.13 278.23 380.44];
y_c = [0 0.01 0.015 0.018 0.023 0.024 0.028 0.029];
c_ydata = interp1(x_c, y_c, t);
C_Ydata = c_ydata(:);
and got these parameters:
Rate Constants:
Theta(1) = 0.00912635
Theta(2) = 0.00086229
Theta(3) = 0.01418786
with a slightly better fit. Use any interpolation method you want, I used the default 'linear' method here. The 'pchip' method may be better. I will let you explore that, since it did not appear to make much difference in the tests I ran with it.
If my Answer helped you solve your problem, please Accept it!
.
Star Strider
Star Strider on 10 Nov 2020
As always, my pleasure!
To change it in your computer, just copy it from my previous Comment and then paste it manually to a new tab in your MATLAB Editor. You can then name the function anything you want, and it will automatically be saved with the function name you provide.
If you want me to change it in the Comment I posted, I can easily do that. I changed it to: parameterestimation_GA. You should see that change when you next acess this thread. I will change it in my system as well, in the event that I want to post it as an example in the future.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!