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
 Simultaneous fitting of several graphs with corresponding variables

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
a_user Posted - 08/13/1998 : 7:47:00 PM
I have 3 different graphs (dispersion curves) and each is fitted
using a different equation, but the same variables, if you see what
I mean. My question is this, is it easy to program Origin to fit
all 3 graphs simultaneously and get 'best fit' values at the end.
Presently I am using an iterative process and it is very labourious
but perhaps the biggest problem I have encountered is that I am finding
a lot of false chi squared minima, by fitting simultaneously I hope these
will fall out.
1   L A T E S T    R E P L I E S    (Newest First)
a_user Posted - 08/13/1998 : 7:49:00 PM
Fitting multiple datasets to different functions using shared parameters

To solve your problem you can make a function definition containing all
three functions where you introduce a extra parameter to select the
function to use.

An example:

Define your function as an Y-script (You select the type in the bottom of the
function definition window) as shown below.

if(r==0) { /* 1. function : */
y=A/(1+B^2*x^2)
} else { /* 2. function : */
y=A*B*x/(1+B^2*x^2)
}

For three and more functions, extend the second branch and include a
test if r==1 etc…
Make sure that you doesn't make any mistakes, Origin doesn't give any warning
if something is wrong (example: replacing (r==0) with (r=0) doesn't give any
error except that the fitting is not working correctly).

Under Action->Dataset make sure that you are in the "Advanced"-mode
(Press More… if it is visible) and put a cross in "Fit Multiple Datsets",
Under "Parameter Sharing" double-click on all parameters (so they are marked
with "Shared") except the r parameter used to select the actual function.
Press the "Add Data" to add a extra dataset Y(2) in the
"Variables" list box (for three function add one more).
Assign datasets to Y(1), Y(2) etc. Activate the fit menu and
fix parameters r=0 and r_2 = 1 (and for three functions r_3=2).
Add some starting values for the other parameters and you can
start the curve fitting.

Be careful when you assign the datasets so you get correct
dataset to correct Y(n), otherwise the fitting result will be
just rubbish. (You can interchange the values of r, r_2, r_3
if you have assigned the datasets in a different order).

If you are using only two functions you could define it as a
expression and use the following form instead

y=(A*r+ A*B*x *(r-1))/(1+B^2*x^2)

where r=0 selects the first function and r=1 the second.

According to the manual it is an easier way to do the fitting
(page 327 (Origin 4.0 User's manual) y_1=…, y_2= …), but it looks
like this method is not working. (The y_2 function is not
evaluated correctly, the problem is reported).

If you send a response showing who you are you can get a copy
of my example as an Origin project file.


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