Solving coupled ODE (chemical kinetic)
Show older comments
Hello!
I am trying to solve the unknown parameters by fitting two ODEs with experimental data:
- dS/dt = (B(1)*x(1) + x(2)*x(3) - x(4)*S - V*k_6M*x(6)*S+V*k_GA*x(6)*x(7) - A_r*h_m * (S – Cs) + Q_inf*x(8) - Q_exf*S)/V;
- dCs/dt = h_m*(S-Cs)/B(2);
x(1), x(2), x(3), x(4), x(6), x(7), x(8), and S were determined experimentally at different time, t.
V, k_6M, k_GA, A_r, h_m, Q_inf, and Q_exf are known constants.
B(1), B(2), and initial value of Cs (Cs_0) are the unknown parameters that I am trying to figure out.
The difficult part for me is that the Cs cannot be determined experimentally, and it can only be estimated after determining Cs_0.
I have went through the following links, but still cannot find an answer:
I really appreciate it if anyone could provide some advice.
Thank you in advance!
1 Comment
Tianren Wu
on 3 Aug 2020
Answers (1)
Star Strider
on 3 Aug 2020
0 votes
It is difficult for me to understand what you are doing.
I assume that ‘x(1)’ ... ‘x(9)’ are the parameters that you are intending to optimise in your ‘kinetics’ function. I would append ‘B(1)’ ... ‘B(3)’ (and perhaps also the initial conditions) to the parameter vector and let the optimisation function (lsqcurvefit or ga or whatever one you choose) estimate all of them. You then need only to provide appropriate initial parameter estimates for the entire parameter vector.
Note that you will need to have more data sets (time and concentrations at that particular time) than the number of parameters that you want to estimate, or it will not be possible to estimate any of them.
2 Comments
Tianren Wu
on 4 Aug 2020
Star Strider
on 4 Aug 2020
I am still somewhat lost.
Just assign the known values for ‘x(1)’...‘x(8)’ inside the ‘kinetics’ function, since there is no need to pass them as arguments, and only pass the parameters you want to solve for as the parameter arguments ‘B’. Use them appropriately in the ‘kinetics’ code. The optimiser you choose will estimate them correctly if given appropriate initial estimates for them.
Also, do not change ‘DifEq’. Keep it as it is:
function dS = DifEq(t,x)
xdot = zeros(2,1);
xdot(1) = (B(1)*x(1) + x(2)*x(3) - x(4)*x(5) - V*k_6M*x(6)*x(5)+V*k_GA*x(6)*x(7) - A_r*h_m * (x(5) – x(9)) + Q_inf*x(8) - Q_exf*x(5))/V;
xdot(2) = h_m*(x(5)-x(9))/B(2);
dS = xdot;
end
.
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!