The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 user-defined fitting function issue, dependency
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jrmontag

USA
1 Posts

Posted - 04/20/2011 :  4:54:13 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;
}
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000