Origin Ver. and Service Release (Select Help-->About Origin): 8.1 SR3 Operating System: Win XP
I have a user-defined non-linear fit that has worked in the past but will no longer fit data due to parameter dependencies. The Function Form is Origin C, and it's fitting a single column of data (w/ an associated weighting curve) representing a Lorentzian peak.
The functional form has not changed since it was used , yet the fitting routine insists there are unity dependencies between the variable "amp" and "f0" (and occasionally other variables) and cannot reduce chi squared (though I can by manually adjusting paratmeters). I'm struggling to discover why the LevMar fitting routine won't work.
Anyone had similar problems or have any suggestions?
Thanks, -Josh
The code for the fit is as follows:
void _nlsfnewPSDnw( // Fit Parameter(s): double f0, double width, double amp, double theta, double phaseOff, double uncorrOff, double slope1, double slope2, // Independent Variable(s): double x, // Dependent Variable(s): double& fit) { double inPhase,outofPhase,modX,modY; inPhase = (x^2-f0^2)/((x^2-f0^2)^2+x^2*width^2); outofPhase = x*width/((x^2-f0^2)^2+x^2*width^2); modX = inPhase*cos(theta) - outofPhase*sin(theta) + slope1*(x-f0); modY = inPhase*sin(theta) + outofPhase*cos(theta) + slope2*(x-f0) + phaseOff; fit = amp*(modX^2 + modY^2) + uncorrOff; } |