How to estimate coefficients for a system of ODE's?

조회 수: 28 (최근 30일)
Danny Helwegen
Danny Helwegen 2019년 1월 24일
댓글: Nisrina Pargustan 2020년 11월 21일
Hi guys, I need some help with how to process the code in matlab. I have set up a system of ODE's, got the initial values and have values for A at specific times and now I need to estimate the values of k1, k2 and k3. I tried several things, but I still don't have a clue on how to process this into matlab, this is what i got:
ODE's
dAdt = -k1*A*B-k2*A*C-k3*A*D
dBdt = -k1*A*B
dCdt = k1*A*B-k2*A*C
dDdt = k1*A*B+k2*A*C-k3*A*D
dEdt = k3*A*D
dFdt = k2*A*C+k3*A*D
Inital values
A = 20.09; B = 6.96; C = 0; D = 0; E = 0; F = 0
Specific values for A at different times:
numdata = xlsread('dataset.xlsx')
t = numdata(:,1);
A = numdata(:,2);
eg. numdata =
4.5000 15.4000
8.6700 14.2200
12.6700 13.3500
Is there someone that can help me?
  댓글 수: 1
Nisrina Pargustan
Nisrina Pargustan 2020년 11월 21일
hai danny, i got the exact same problem as you. so i tried to run your code but i got the error message. can you please send me your matlab code for this problem?

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2019년 1월 24일
If you are doing parameter estimation of a system of ordinary differential equations, these will likely provide some guidance:
This is usually a fairly straightforward problem.
  댓글 수: 9
Danny Helwegen
Danny Helwegen 2019년 1월 25일
Than the following plot is obtained:
untitled.jpg
Star Strider
Star Strider 2019년 1월 25일
Here it is (a version of previous code, this time using ga), attached.
Since all the parameters are positive (by definition of the model), I constrained them to be greater than or equal to zero. Change that if your parameters are allowed to be negative.
Note that you will have to re-state your objective function in terms of the fitness function (in this code, ‘ftns’):
ftns = @(B) norm(A_data - Kinetics(B, time));
You mentioned that your parameters are on the order of 100, so change the options structure to:
opts = optimoptions('ga', 'PopulationSize',PopSz, 'InitialPopulationMatrix',randi(1E+2,PopSz,Parms), 'MaxGenerations',2E3, 'PlotFcn','gaplotbestf');
That should make it converge faster, however it will likely still take a few minutes. Also, ‘theta’ in my code is ‘B’ in yours.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Stochastic Differential Equation (SDE) Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by