Hold and constraints
mssmtrainee
K0 = a2
display Ypost vs Xpost
Make/O/T/N = 1 T_constraints
T_constraints[0] = {"K2>0"}
print a2
CurveFit/Q/H="100" poly 3, Ypost[0,(YCRIT_ind-fit_ind)]/X=Xpost/D/C=T_constraints
duplicate W_coef poly_coef
display Ypost vs Xpost
Make/O/T/N = 1 T_constraints
T_constraints[0] = {"K2>0"}
print a2
CurveFit/Q/H="100" poly 3, Ypost[0,(YCRIT_ind-fit_ind)]/X=Xpost/D/C=T_constraints
duplicate W_coef poly_coef
Wave w
Variable x
return poly(w, x)
End
Copy my function into your Procedure window (Windows->Procedure Windows->Procedure Window). It can fit any order of polynomial; it decides the order based on the number of elements in the coefficient wave. The drawback of this flexibility is that you must make a suitable coefficient wave before opening the Curve Fit dialog. When the dialog complains that it doesn't know how many coefficients there are, go to the Coefficients tab and select your pre-made wave. For the equivalent of Poly 3 built-in fit function you would need a 3-element wave. That gets you a second-order polynomial.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 29, 2012 at 02:56 pm - Permalink