Attached is a library containg the VIs I have written in an attempt to fit to the magnitude of the S11 (reflection) scattering parameter as a function of frequency. I am measuring two to three resonances of a microwave cavity. The signal, S11, is the ratio of incident voltage to reflected voltage - at resonance this is a minimum. There are four fit parameters: resonant frequency (location of minimum, typically ~ 460 MHz and 6.8 GHz); quality factor (ratio of frequency to width, typically ~ 800 and 300); coupling parameter (related to depth of resonance, typically ~ 0.018 and 1); and attenuation parameter (related to off-resonance value of S11). In the VI library are two modified "Non-linear Lev-Mar fit.vi" which are identical except that one uses the standa
rd CIN to estimate the new parameters and the other uses a specific VI written by me for this particular function. They seem to have the exact same performance; I can get neither to work well. I have tried changing the convergence criterion (change in chisqd) from 0.001 to 0.000001, but this seemed to have no effect. Finally, below is the Igor Pro code defining the function I am fitting to, which, when used with the standard Igor curve-fitting routines, works very well. Thanks.
Function MagnS11(w,x)
Wave w; Variable x // w = (f, Q, beta, alphaL)
variable atten = -2*w[3]
variable epsilon = 2*(x-w[0])/w[0]
variable epsilonQsqd = (epsilon*w[1])^2
variable numerator = (1-w[2])^2+epsilonQsqd
variable denominator = (1+w[2])^2+epsilonQsqd
return exp(atten)*sqrt(numerator/denominator)
End