willsALMANJ/Igor-ProW

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
executable file 543 lines (446 sloc) 17.5 KB
 #pragma rtGlobals=1 // Use modern global access method. //All simple fit functions that do not depend on other user defined functions Function/S findCoefList(fitFunction) String fitFunction String coefList="" strswitch(fitFunction) Case "BesselPlusLinear": coefList="peakmax;peakpos;slope" break endswitch Return coefList end //Absolute value of the jinc function Function AbsJinc(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = amplitude*abs(bessj(1,x*freq)/x); //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 2 //CurveFitDialog/ w[0] = amplitude //CurveFitDialog/ w[1] = frequency return w[0]*abs(bessj(1,x*w[1])/x); End //Interferometric signal for a low-finesse cavity with one of the mirrors attached to a simple //harmonic oscillator. The function gives the amplitude of reflected light at the oscillator's //resonant frequency. The function also allows for a linear correction to the signal due to //the optical lever effect. Function BesselPlusLinearFit(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = peakmax*abs(bessj(1,x*1.84/peakpos)/.582 +slope*x); //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 3 //CurveFitDialog/ w[0] = peakmax //CurveFitDialog/ w[1] = peakpos //CurveFitDialog/ w[2] = slope return w[0]*abs(bessj(1,x*1.84/w[1])/.582 +w[2]*x); End Function Gaussian(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = offset+amplitude*(1/sqrt(2*pi*stddev^2))*exp(-(x-mean)^2/(2*stddev^2)) //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ B //CurveFitDialog/ Coefficients 4 //CurveFitDialog/ w[0] = amplitude //CurveFitDialog/ w[1] = mean //CurveFitDialog/ w[2] = stddev //CurveFitDialog/ w[3] = offset Variable amplitude=w[0] Variable meanavg=w[1] Variable stddev=w[2] //standard deviation Variable offset=w[3] Return offset+amplitude*(1/sqrt(2*pi*stddev^2))*exp(-(x-meanavg)^2/(2*stddev^2)) end //Magnetic field penetration depth as a function of temperature from Ginzburg Landau theory Function GLpenetrationDepth(w,T) : FitFunc Wave w Variable T //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(T) = lambda0 / (1 - T/Tc)^2 //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ B //CurveFitDialog/ Coefficients 2 //CurveFitDialog/ w[0] = lambda0 //CurveFitDialog/ w[1] = Tc return w[0] / (1 - T / w[1])^2; End //Coherence length as a function of temperature from Ginzburg-Landau theory Function GLxi(w,T) : FitFunc Wave w Variable T //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(T) = xi0 / sqrt(1 - (T/Tc)) //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ B //CurveFitDialog/ Coefficients 2 //CurveFitDialog/ w[0] = xi0 //CurveFitDialog/ w[1] = Tc return w[0] / sqrt(1 - (T/w[1])); End //Critical magnetic field as a function of temperature from Ginzburg Landau theory Function HcGL(w,temp): FitFunc Wave w Variable temp //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(temp) = (3^.5*6.626e-34/pi/2/1.6e-19)*(1-temp/Tc)^.5/linewidth/xi0 //CurveFitDialog/ //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ temp //CurveFitDialog/ Coefficients 2 //CurveFitDialog/ w[0] = xi0 //CurveFitDialog/ w[1] = Tc //CurveFitDialog/ w[2] = linewidth Variable xi0 = w[0] Variable Tc = w[1] Variable lw = w[2] //Wire linewidth (80e-9 for October 2008 cooldown) Variable hplanck=6.626e-34 Variable echarge=1.6e-19 If(temp