nonlinear regression by least square - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

nonlinear regression by least square

charlesphuahcharlesphuah Posts: 1Member
Hi,
I do have one problem with kinetic modeling. Let's say a reaction occurs in such a way
A <------> B (reversible way)
where k1 is a constant for A change to B
and k2 is a constant for B change to A

so I used ODE solver to solve the problem mentioned and successfully get a graph. However, I do not know how to fit my experimental data into the graph and get the reaction constant k1 and k2 using matlab. Anyone can help? How to use matlab nonlinear regression by least square? Thanks in advance.

function dxdt=matlab(t,x)
global k1 k2
k1=0.1; k2=0.01;
dxdt=[-k1*x(1)+k2*x(2);k1*x(1)-k2*x(2)];

[t,x]=ode45{@matlab,[0 50],[0.1 1]}
plot{t,x}

Thanks,
Matlab newbie
Sign In or Register to comment.