Function fit_data with several curves dependent on parameters

Denis Crété denis.crete at thalesgroup.com
Thu Jun 9 10:55:54 CEST 2011


Hello,
 it looks like the function "datafit" can solve the problem for you:
Here V = ln(v/0.0001) is a column vector
// Demo for fitting y=F(x,V) by an analytically defined surface
// W is a 3-column matrix: [x, V, y] (one row corresponds to one
experimental data)
deff('y=F(x,V)', 'y=(a+b*x.^n).*(1+c*V)');
deff('e=G(abcn,z)','a=abcn(1),b=abcn(2), c=abcn(3), n=abcn(4),
x=z(1),V=z(2),y=z(3), e=y-F(x,V)')
// Initial guess for fitting parameters
abcn=[5.43;-5.51;0.4;1]; 
// Experimental data
W=[0,0,1;0,1,3;1,0,4;1,1,5.8];
// Fitting W
[abcn,err]=datafit(G,W',abcn);
a=abcn(1),b=abcn(2),c=abcn(3), n=abcn(4)

I did not run this code, but it is derived from a tested example I have made
some time ago.
The biggest trap is in the definition of F: you may have to replace constant
"1" by "ones(1,size(V,'c'))"  (?). 
n will be accurate only if you have a large range for the set of x ;
similarily, for the unknow parameter m in (1-((T-Tt)/(Tm-Tt))^m) and the
range of variation of T-Tt.

HTH
Denis
 


--
View this message in context: http://mailinglists.scilab.org/Function-fit-data-with-several-curves-dependent-on-parameters-tp3034239p3043054.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list