Optimization of ODE parameters

조회 수: 2 (최근 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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by