
How can I optimize 2 parameters of my ODE system (with 3 deferential equation) to minimize distance between theorical and experimental value
1 回表示 (過去 30 日間)
古いコメントを表示
Jeremy Brasseur
2020 年 5 月 27 日
コメント済み: Jeremy Brasseur
2020 年 5 月 28 日

Hello,
I want to develope a model in mathlab but i don't know how can i find best K and De (constant parameter) from my models to minimaze the sum of distance betwen theorical and expermental value of C.
Thanks you advance for your help.
0 件のコメント
採用された回答
Bjorn Gustavsson
2020 年 5 月 27 日
編集済み: Bjorn Gustavsson
2020 年 5 月 27 日
The way you've written the equations above only gives you 2 differential equations, in your odethreevariable function you code it as if the first equation was:

Either your odethreevariables function or your equations are correct, you'll have to decide which it is.
To solve this type of problems you can do something like:
K_De_0 = [1 1]; % Or a more appropriate start-guess
K_De_optimal = fminsearch(@(K_De) sum((C_B_obs-C_B_fcn(tC,K_De)).^2),K_De_0);
That is a standard least-square fit of your function C_B_fcn with parameters K_De evaluated at times tC (that should be the instances in time for which you have your estimates of C_B). The only thing you'll need to do is to integrate your ODEs inside C_B_fcn to get the C_B-curve, something like this:
function C_B = C_B_fcn(tC,K_De)
ICs=zeros(3,1);
ICs(1,1) = 0.0035;
ICs(2,1) = 0;
[t,X]=ode45(@(t,X) ode2variable(t,X,K_De),tC,ICs);
C_B = X(:,2);
end
function [dX_dt]=ode2variable(t,X,K_De)
% EDIT:
K = K_De(1);
De = K_De(2);
rc = X(1);
Cb = X(1);
rg = 0.0035;
Y0 = 182;
a = 190.47;
Jb = 1/((rg^2/(rc^2*(K*Y0)))+((rg*(rg-rc))/(rc*De)));
dX_dt = [-((Jb*(rg^2))/(Y0*rc^2)) ; Jb*a]; % ODE (system of 2 diferential equations)
end
This is not tested but should at least give you a starting point.
HTH
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!