MATLAB: Optimization of multiple parameters in 4th order Runga Kutta

lsqnonlinode45optimization

I am trying to model multiple serial and simultaneous kinetic reactions using a 4th order runga kutta. I have 8 parameters (rate constants) that need to be optimized. I am having limited success using lsqnonlin however it will not let me set the upper or lower bounds. I only need the values to remain positive. When I put in a value for the lower bounds it crashes. Is there a different optimization procedure I should use that would be better? This is what I have that is working to a limited degree. Thanks!!!
LB = [];
UB = [];
X0=[a,b,c,d,e,f,h,i];
OPTIONS = optimset('TolX',1e-50,'TolFun',1e-50);
[X,RESNORM,RESIDUAL,EXITFLAG,OUTPUT,LAMBDA] = lsqnonlin('optim_k',X0,LB,UB,OPTIONS);
a=X(1);
b=X(2);
c=X(3);
d=X(4);
e=X(5);
f=X(6);
h=X(7);
i=X(8);
[T,y] = ode45('RK4',tspan,y0);

Best Answer

This may provide some guidance: Monod kinetics and curve fitting.