Optimization of ODE parameters
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Torsten
am 13 Mär. 2018
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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!