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
 Fit building with multiple coefficent-functions

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
AxelSve Posted - 07/26/2018 : 09:18:40 AM
Origin Ver. 2016
Operating System: Windows

Hello everyone,

I want to fit my data to a non-linear fit-function that is rather long (see attached file).

My background in programming is yet extremely low and I was wondering if there is a possibility to integrate the different functions of the coefficients (C+, B+, ...) into my equotation M(t) using the Fitting function builder. For example including a initializing script function before running the fit. The fitted parameters from that model are only kappa and lambda, whereby n2=nc=2.

Nevertheless I have failed so far to come up with a good solution.

Thank you very much for your help!
Axel

2   L A T E S T    R E P L I E S    (Newest First)
AxelSve Posted - 07/26/2018 : 11:11:01 AM
Hi James,

thank you for the fast answer!
I will try to work it out!

Best,
Axel
YimingChen Posted - 07/26/2018 : 09:52:27 AM
Hi,

Please check the following OC code for defining your fitting function, you will need to set Function Type to Origin C:

void _nlsfAxe(
// Fit Parameter(s):
double k, double l, double M,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
	const double n2=2;
	const double nc=2;
	// Beginning of editable part
	double Cp = l^2/(2*k^2);
	double Cm = -l^2/(2*k^2);
	double ki = sqrt(2*k^2/(n2*(n2+1))+2*l^2/nc);
	double kip = sqrt(ki^2-4*Cp*Cm*k^2);
	double Bp = (ki+kip)/2/k;
	double Bm = (ki-kip)/2/k;	
	y = M*(1-((Bp+Cp)/(Bp+Cp*exp(k*x))*(Bm+Cp*exp(k*x))/(Bm+Cp))^(ki^2/k/kip^2)*exp(-ki/k));
	// End of editable part
}


Please also contact <tech@originlab.com> if you need further help. Thank you.

James

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