02-16-2015 10:15 AM
Hi, i am having a problem fitting raw data to a certain formula. The formula is f(x) =- ax+b+c(x/d)^e. I am using the Nonlinear Curve Fit VI, Lev-Mar: formula string. I am able to calculate 4 of the 5 parameters (a,b,c,d). I can't calculate e, but it should be around 10. When running the VI, it gives me "Error -20068 occured at NI_Gmath.lvib:LM get new coefficients.vi:1. Analysis : Input parameters has at least one element that is Inf, NaN, DBL_MAX, or DBL_MIN "
All it does is plot the equation based on the initial parameters without actually finding the best fit parameters. I've also tried using the VI version of creating the formula, but it gives me the same error. What can I do to prevent this error? I have attached the vi and a data file.
Solved! Go to Solution.
02-16-2015 11:34 AM - edited 02-16-2015 12:13 PM
Some of your early X values are negative. Remove them and things will work just fine.
(You get a negative input for the exponentiation, which is only allowed if the input is complex or the exponent is an integer. This is not the case here, where the exponent is not an integer. The exponent is an integer on the first function call, but not anymore once it tries to calculate the partial derivatives of the model. Try with a starting guess of 9.9 instead of 10, and it will fail immediately)
02-16-2015 01:04 PM
Thank you! The nonlinear curve fit finally worked!