フィルターのクリア

Optimization of ODE parameters

4 ビュー (過去 30 日間)
Murad Nazari
Murad Nazari 2018 年 3 月 13 日
コメント済み: Torsten 2018 年 3 月 13 日
I have a set of data experimental data and want to solve a differential equation with two unknown variable. Those two unknown variable should be tuned that the solution of ode will match the experimental data.I have written the following code but I couldn't move forward. Any help will be appreciated.
Thanks in advance.
load data.mat
expTime = Data (1:6,1);
Tr = Data (1:6,2);
tSpan = [0 10];
T0 = Data(1,2);
x = [10522;53555];
myfun = @(t,T) (5.4675e-4)*exp(-(x(1))/(8.314*T))*(x(2));
T = ode45 (myfun,tSpan,T0);
simY = deval(T, expTime);
A = [ 1 , 0];
b =1;
ab0 = [1 ;1];
x = lsqnonlin(@ObjFnc,ab0,0,15000)
In the following code I tried to write an objective function that takes input of two unknown variables, solves ODE, and calculates the error. I couldn't find a way how to calculate the error.
function cost = ObjFnc(a,b)
tSpan = [0 10];
load data.mat
T0 = Data(1,2);
expTime = Data (1:6,1);
myfun = @(t,T) (5.4675e-4)*exp(-a/(8.314*T))*b;
T = ode45 (myfun,tSpan,T0);
Tp = deval(T,expTime);
end
  1 件のコメント
Torsten
Torsten 2018 年 3 月 13 日
Take a look at our "reference code" for this kind of problem:
https://de.mathworks.com/matlabcentral/answers/43439-monod-kinetics-and-curve-fitting
Best wishes
Torsten.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by