Loi Cheng Poon wrote: How to execute Minimize() function to get the slope and intercept for the straight lines?
You have not shown in your sheet what you tried to get the optimal parameters, so I don't know if you used minimize() in an incorrect way or you simply struggled because Minimize() won't change any of the parameters.
The latter case happens when you try to minize in your sheet - minize would spit out the guess values without changing any. The reson for this are the huge x values. The numeric algorith would change them slighty(!!) but the ErrFunc will shoe no noticeable change within the given tolerance value. So minimize() decides that the fit is already good enough. Decreasing the value of TOL (or even CTOL ?) does not help in your case.
So one way out is to scale your data (multiply every x value by 10^-9 and of course you would have to multiply ever slope guess by 10^9). Doing so enables minimize() to find a better fit and decreasing the value of TOL even gives you a slight improvement. You may now multiply the slopes found by 10^-9 to get the appropriate values for your data.
I also tried an approach using minerr() (again with the scaled data) but it takes a bit more time to calculate and the fit is slightly worse. Changing TOL or CTOL does not change the result here.

Welcome to the PTC Community
No account yet? Create an account
Please use your PTC eSupport account.
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.

