Fit of groups of data

Hi,
I have two groups of data. Both of them have the same x-axis but differ in y-axis. I want to to solve an equation that depend on these two groups of data.
The x-axis is representing time x=[1; 2; 3; 4; 5; 10; 15; 30; 45; 60; 90]
and y-axis for the first group is: y1=[56.88; 62.75; 87.07; 114.54; 139.14; 177.24; 216.39; 285.77; 399.99; 357.28; 359.53]
and y-axis for the second group is: y2=[353.64; 343.60; 303.67; 312.73; 328.91; 306.76; 299.97; 259.01; 222.10; 190.04; 228.87]
Here is my equation: y1/(y1+y2)=[k1/(k1+k2)]*{1-exp[-(k1+k2)*t]}
Note: all the equation parameters are known except k1 and k2.
How can I find them by fitting the data please?

6 commentaires

the cyclist
the cyclist le 22 Août 2013
In your equation, you wrote t. I assume that should be x.
the cyclist
the cyclist le 22 Août 2013
I suggest you simplify by defining
z = y2./y1
Then you just have 1/(1+z) on the left.
Hisham
Hisham le 22 Août 2013
sorry sir, I did not understand the last comment. Why did you do z = y2./y1 ?
the cyclist
the cyclist le 22 Août 2013
An equation with one variable is simpler than an equation with two variables. If you use z = y2./y1, then you can write 1./(1+z) instead of y1./(y1+y2).
Matt J
Matt J le 22 Août 2013
Modifié(e) : Matt J le 22 Août 2013
You could even define
z = y1/(y1+y2)
and perform a fit to the equation
z=A*{1-exp[-B*t]}
There aren't truly 2 data sets being fitted, here.
Walter Roberson
Walter Roberson le 24 Août 2013
Hisham commented "yes, t should be x"

Connectez-vous pour commenter.

 Réponse acceptée

the cyclist
the cyclist le 22 Août 2013

0 votes

If you have the Statistics Toolbox, I think the nlinfit() function will do what you need: http://www.mathworks.com/help/stats/nlinfit.html

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by