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
 Continuous fits in mulitple range fitting

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
FS_S Posted - 12/17/2012 : 10:10:39 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0 SR3
Operating System: XP

Hey guys,

I try to fit three parts of one experimental dataset with three different polynomials. This is due to the shape of the curve which is nearly linear for small x-values, then becomes rather round-ish for medium x-values and nearly linear again for large x-values. All my ranges overlap in one datapoint, which means that, for example, my first range goes up to x=35 and my second range also starts with x=35.
I managed to select my three distinct ranges and also do the fitting with polynomials of variing degrees (using NLCF-dialog). Unfortunately, the best fitting curves do not have the same y-values at these overlaping points which makes the overall fit non-continous at these points.
No here is my question: Is there a way to force the fitting algorithm to make all fitting curves continuous (and maybe even differentiable) at these overlaping points?

Thanks in advance
Frank
2   L A T E S T    R E P L I E S    (Newest First)
FS_S Posted - 12/18/2012 : 06:07:18 AM
Hi Cecilia,

Thanks for the hint. It put me in the right direction to do the "matching" by simple math.

Regards
Frank
Cecilia_syy Posted - 12/18/2012 : 02:53:49 AM
Hi Frank,

You can define a piece-wise fitting function in the Fitting Function Organizer.
The Parameter Names are x1, y1, x2, y2, k1, k2.
The point (x1,y1) is the intersection of your first range and second range.
The point (x2,y2) is the intersection of your second range and third range.
k1, k2 represent the derivative at the point (x1,y1) and (x2,y2) respectively.

Use x1, y1, k1 to define the fitting function for the first range.
Use x2, y2, k2 to define the fitting function for the third range.
Use all the parameters to define a cubic polynomial for the second part.
Note that, the intersections and their first-order derivatives are continuous.

The body of the Function is:
-------------------------------------------------------------------
if(x<x1) 
		y = k1*(x-x1)+y1;	
	else if (x<x2)
		y = y1*(x-x2)/(x1-x2)+y2*(x-x1)/(x2-x1)+(k1-(y2-y1)/(x2-x1))*(x-x1)*(x-x2)^2/(x1-x2)^2+(k2-(y2-y1)/(x2-x1))*(x-x1)^2*(x-x2)/(x2-x1)^2;	
	else 
		y=k2*(x-x2)+y2;

----------------------------------------------------------------------
You need to fix x1 and x2 in Parameter Settings with your data range intersections.

Save this user-defined fitting function. Then you can use this fitting function to do the fitting after initializing the parameters in the NLFit-dialog.

Cecilia
Originlab Corp.

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