Parameter Estimation for a System of Differential Equations

332 views (last 30 days)
Igor Moura
Igor Moura on 1 Dec 2016
Edited: Khoi Ly on 21 Feb 2021
Hello. Ok, so I'm new to matlab and I've got a question regarding parameter estimation for a kinetic model. I have 4 different reactants and their concentrations are c1, c2, c3 and c4. I also have 4 differential equations, each one related to a concentration (c1, c2, c3 and c4, respectively -see below-) and experimental data for all these concentrations on 12 different times plus the initial condition. The k's are the rate coefficients. I want to solve this system of ODE's using ode45 and then use the output to compute the experimental data minus the observed data and use these results to estimate the values of k's using lsqnonlin, but apparently I can't solve these ODE's without numerical values for k -which is what I want to know-. Any help on how to set up the command to solve this?
function dcdt=batch(t,c,k)
dcdt=zeros(4,1);
dcdt(1)=-k(1)*c(1)-k(2)*c(1);
dcdt(2)= k(1)*c(1)+k(4)*c(3)-k(3)*c(2)-k(5)*c(2);
dcdt(3)= k(2)*c(1)+k(3)*c(2)-k(4)*c(3)+k(6)*c(4);
dcdt(4)= k(5)*c(2)-k(6)*c(4);
end
Data:
t c1 c2 c3 c4
0 1 0 0 0
0.1 0.902 0.06997 0.02463 0.00218
0.2 0.8072 0.1353 0.0482 0.008192
0.4 0.6757 0.2123 0.0864 0.0289
0.6 0.5569 0.2789 0.1063 0.06233
0.8 0.4297 0.3292 0.1476 0.09756
1 0.3774 0.3457 0.1485 0.1255
1.5 0.2149 0.3486 0.1821 0.2526
2 0.141 0.3254 0.194 0.3401
3 0.04921 0.2445 0.1742 0.5277
4 0.0178 0.1728 0.1732 0.6323
5 0.006431 0.1091 0.1137 0.7702
6 0.002595 0.08301 0.08224 0.835
Thanks in advance!
  7 Comments
Star Strider
Star Strider on 2 Jan 2021
Budda —
Make appropriate changes to the ‘kinetics’ function (specifically to the ‘C’ variable) to output only the variable you need. In that code, there are 4 columns, so address only the column you want returned in ‘C’.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 1 Dec 2016
See if the techniques in Monod kinetics and curve fitting will do what you want.
  31 Comments
Khoi Ly
Khoi Ly on 21 Feb 2021
I was directed by your answer in another post regarding a similar problem.
In that post, I was trying to estimate the parameters of the differential equations using more than one time series data sets.
In the example above, given.
t=[0.1; 0.2; 0.4; 0.6; 0.8; 1; 1.5; 2; 3; 4; 5; 6];
c=[0.902 0.06997 0.02463 0.00218
0.8072 0.1353 0.0482 0.008192
0.6757 0.2123 0.0864 0.0289
0.5569 0.2789 0.1063 0.06233
0.4297 0.3292 0.1476 0.09756
0.3774 0.3457 0.1485 0.1255
0.2149 0.3486 0.1821 0.2526
0.141 0.3254 0.194 0.3401
0.04921 0.2445 0.1742 0.5277
0.0178 0.1728 0.1732 0.6323
0.006431 0.1091 0.1137 0.7702
0.002595 0.08301 0.08224 0.835];
we can estimate the parameters theta. Since the example above uses only one data set, what should I do if I have multiple data sets? Can I just concatenate the time-series data sets together and run the lsqcurvefit as usual?
Also, in my problem, each different time-series data set contains a different initial value. How do I modify the example to allow for different initial values depending on the chosen time-series data set?
Thank you

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!