Origin 7.5 SR2 on XP.
Hi,
I use the NonLinear Curve Fitting with a user defined C function. This function is defined via the code builder.
myfun(double P1, double P2, double x, double & y) {
P1=P1*1.0e-9;
// Here is the body of the function itself // }
I fit with P2 by keeping P1 constant to a value val0 in the graphical interface. However the fit does not converge properly.
If I remove the line P1=P1*1.0e-9; in the program and fit by keeping P1 constant to val0*1e-9, the fit works perfectly.
Is it forbidden to change the value of one parameter in the body of the fit function? I thought it would be ok, since parameters are passed by value and not by reference.
Hope you can help.
Thanks
|