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
 All Forums
 Origin Forum
 Origin Forum
 user-defined fitting function issue, dependency

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jrmontag Posted - 04/20/2011 : 4:54:13 PM
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;
}

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000