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
 Help with fitting to non-standard function.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Wwrawr

USA
Posts

Posted - 11/19/2007 :  12:09:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): Origin Pro8
Operating System: Windows Vista 32

I am new to origin and am having trouble adding a function to the fitting organizer. The function is of the form y = D*(1-e^(-B*(x-r)))^2 where D, B and r are the parameters to be determined by the fit. Without taking too much of anyones time on so trivial a problem, are there any tutorials/old posts you could reference me to that describe how to correctly input and fit to a non-standard function?

Origin includes the exponential MnMolecular function y = A*(1-e^(-k*(x-xc))), would it be easier to just fit using this and modify it somehow?

larry_lan

China
Posts

Posted - 11/19/2007 :  02:57:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

We are preparing the video examples. Before it is done, you can follow these steps:

1. Open Function Organizer (F9). New a Category and give a proper name.



2. New a function and give a proper name.



3. In your case, enter the Parameters (seperated by comma) and Function as follow:



Note: You function is y = D*(1-e^(-B*(x-r)))^2. Do you want to calculate the exponential of e? If so, you should use the exp() function. So the function should be y = D*(1-exp(-B*(x-r)))^2.

Click OK button to save the function. Then you can see the new fitting function in Nonlinear Fitting dialog. More information please read this chapter of Origin Help:

Regression and Curve Fitting > Nonlinear Curve Fitting > Origin Fitting Functions and the Fitting Function Organizer > User-Defined Fitting Functions

Thanks
Larry
OriginLab Technical Services

Edited by - larry_lan on 11/19/2007 03:00:43 AM
Go to Top of Page

Wwrawr

USA
Posts

Posted - 11/19/2007 :  6:36:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Larry,

I appreciate your help with this problem, I've now read all of the help files on non-linear fitting and decided it was probably better to just ask someone more knowledgeable.

My need is to fit a data set to the function from my first post, "y=D*(1-exp(-B*(x-R)))^2" where D, B and R are the parameters to be solved by the fit. I understand how to insert the function into the organizer, what I don't understand is if/how to initialize parameters or set boundary conditions. With just the function and parameters entered, a fit on my dataset does not converge, however the dataset was generated from a plot of the function in MathCAD and so it should converge with a correlation of 1. I have provided the dataset as well as the parameter values the fit should produce for this data below. I appreciate any help you can lend in this problem.

~Ryan


D=4.0327585E+03 cm-1
B=2.33142 Angstrom-1
R=2.1000 Angstrom

x
Angstrom

1.7
1.75
1.8
1.85
1.9
1.95
2
2.05
2.1
2.15
2.2
2.25
2.3
2.35
2.4
2.45
2.5
2.55
2.6
2.65
2.7
2.75
2.8
2.85
2.9
2.95
3
3.05
3.1
3.15
3.2
3.25
3.3
3.35
3.4
3.45
3.5
3.55
3.6
3.65
3.7
3.75
3.8
3.85
3.9
3.95
4
4.05
4.1
4.15
4.2
4.25
4.3
4.35
4.4
4.45
4.5
4.55
4.6
4.65
4.7
4.75
4.8
4.85
4.9
4.95
5

y
cm-1

9577.45
6417.29
4135.2
2524.24
1423.23
706.8649
278.0157
61.64611
4.77341E-25
48.82562
174.40283
351.20666
560.07284
786.75919
1020.82
1254.72
1483.16
1702.51
1910.45
2105.58
2287.21
2455.18
2609.66
2751.12
2880.14
2997.46
3103.83
3200.06
3286.94
3365.23
3435.69
3499
3555.84
3606.8
3652.47
3693.35
3729.92
3762.62
3791.84
3817.94
3841.25
3862.04
3880.6
3897.16
3911.92
3925.08
3936.81
3947.26
3956.58
3964.88
3972.27
3978.86
3984.73
3989.95
3994.6
3998.74
4002.43
4005.72
4008.64
4011.24
4013.56
4015.62
4017.46
4019.1
4020.55
4021.85
4023


Edited by - Wwrawr on 11/19/2007 9:36:05 PM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/19/2007 :  8:59:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is something odd about your data because the Y values of a curve simulated in Origin using your equation and parameters (D, B, R) are 100 times smaller than the Y values you obtained in MathCad. (See Book2) When I start with the initial values D=4E+05, B=2, R=2 I get the fit to your MathCad data shown in Graph2 at the bottom.

Simulation:


Fit:


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/19/2007 9:04:08 PM
Go to Top of Page

Wwrawr

USA
Posts

Posted - 11/19/2007 :  9:21:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yeah, I'm sorry about that, the numbers obtained by the equation are right, the ones I supplied were actually in m-1 due to a unit conversion error. I will edit my original post with the corrected numbers.
Go to Top of Page

Wwrawr

USA
Posts

Posted - 11/19/2007 :  10:05:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I seem to have fixed whatever the problem was. Somewhere between not supplying initial values and trying to use the derived parameters feature I was doing something that broke the fit. Starting from a clean slate with the correct numbers it worked fine. Thank you for your help. :-)
Go to Top of Page
  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