fitting parameters of ode45 using lsqcurvefit

i have problems while running the below coding (i got from Monod kinetics and curve fitting) i have data for C versus time,and at initial conditions, G=G0 and C=0.
function C = eqdeg(B, t,~) % equation codes the system of differential equations describing one % version of solid and liquid phase: % dG/dt = (m.*(Cseq-C))/-Mg; % dC/dt = (m.*(Cseq-C)-k*Ms*C)./Ms; % with: % Variables: x(1) = C, x(2) = G % Parameters: m = B(1), k = B(2), Cseq = 67.811, Mg=-5, Ms=8.5E-5 x0 = B(1:2); [t,CX] = ode45(@DifEq, t, x0); function dC = DifEq(t, x) xdot = zeros(2,1); xdot(1) = (B(1) .* (67.811-x(2))) ./ -5; xdot(2) = ((B(1) .* (67.811-x(2)))-(B(2).*8.5E-5*x(2)))/8.5E-5; dC = xdot; end
i am not sure why i cannot run the coding. perhaps i make a wrong coding. Matlab also did not mention any errors while running. i used R2013a.
i called the function as follows:- [B,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat] = lsqcurvefit(@eqdeg,B0,Time,Cdata);
i am newbie in this field and still not familiar with some terms
thank you in advanced for your time

1 Kommentar

Jan
Jan am 15 Jun. 2015
You mention, that you cannot run this, but do not get an error message. So how do you start it and what happens?
Do you see, that the code is not readable? Use the "{} Code" button for formatting. Thanks.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 15 Jun. 2015

Kommentiert:

Jan
am 15 Jun. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by