Author |
Topic |
|
mwmarmw
Poland
1 Posts |
Posted - 07/05/2021 : 07:13:09 AM
|
Hello, I am doing NLCF. My question is how do I set up parameter initialization for a function of the following form: y=k*(x^c)+l*(x^d)+a*(1-exp(-b*x))
I tried something like that: sort( x_y_curve ); //smooth( x_y_curve, 2 ); Dataset dx; x_y_curve.AttachX(dx); dx = ln(dx); x_y_curve = ln( x_y_curve ); Dataset coeff; coeff.SetSize(2); fitpoly( x_y_curve, 1, coeff); k= exp( coeff[0] ); c = coeff[1];
coeff.SetSize(3); fitpoly( x_y_curve, 1, coeff); l = exp( coeff[0] ); d = coeff[1];
int sign; double a1; b = -get_exponent_cuv(x_y_curve, &a1, &a, &sign); a = (a1-sign*exp(a)) / 2;
but there is definitely some error in it (maybe in a different place of the function being built?), Because although the curve fits well, the parameters obtained have undefined values.
I will appreciate any help |
|
Chris D
428 Posts |
|
|
Topic |
|
|
|