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
 How to get the function of the fitting curve?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Jeffrey

1 Posts

Posted - 06/19/2000 :  3:48:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear Sir/Ms,

I have a question about the using of the origin, and hope that can get your kindly help:

Plot a curve based on the data given, and then fitting this curve, now I want to get the function of this fitting curve, how can I get it?

Thank you for your concern!

Yours truely,
Jeffrey

rtoomey

USA
184 Posts

Posted - 06/21/2000 :  3:34:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

Jeffrey,

When performing any fit in Origin (from the Analysis menu, from a tool, or from the nonlinear curve fitter), the results of the fit, including the parameter values, are reported to the Results Log. (This response to your post assumes you are running Origin 6.0 since the Results Log is new to 6.0.) If you need the parameters to be displayed in equation form you will have to create the equation yourself. One way to do this is to manually enter it into a text label using the Text tool on the Tools toolbar. If this method is not desirable to you, there are many other ways to accomplish the task. However, since I am not sure where you would like to store the equation and since I am not sure which fitting function you are fitting your data to, I provide an example of one way to do it below:


Example

Suppose you have data plotted in a graph which follows a linear pattern. You would like to fit the data and then automatically place the equation on the graph window in a text label. Here's one way to do it:


  1. Select Tools:Linear Fit, set up the Settings and Operations tabs the way you like and click the Fit button. Alternatively, select Analysis:Fit Linear. Your data is fitted and the results are placed in the Results Log.
  2. Open the Script Window by selecting Window:Script Window.
  3. Place your cursor in the text box and enter the following LabTalk scripting statement:

    label -s -sa -n LinearEq "y = $(stat.lr.a) + $(stat.lr.b)*X";

    Note: The label command uses the stat.lr.a and stat.lr.b object properties. These properties store the values for the parameters (A and B) and are interpreted correctly by including the -s, -sa, and $( ) notations. For any other information regarding this LabTalk scripting statement, consult your Origin LabTalk manual.

  4. Highlight the statement and press the ENTER key on your keyboard to execute it.

    => A label displaying the linear fit equation with the correct parameter values should be reported in the right top corner of the graph window (you may need to move your legend out of the way to see it).

Important Notes

Note 1: The labeling process can be automated in many different ways. If you are interested in finding out more, please check out page 5 and page 6 of our Batch Processing article. Three examples are provided there which should be very helpful.

Note 2: If you use the nonlinear curve fitter you should find out more about the After Fitting Scripts window (in the nonlinear curve fitter). A label command line similar to the one in step 4 could be placed in the After Fitting Scripts text box in this window so that the equation is automatically reported on the graph once you click the Done button to end a fitting session. This also applies to the following Analysis: Fit menus since the fitter runs in the background: Exponential Decay (all three orders), Exponential Growth, Sigmoidal, Gaussian, Lorentzian, and Multi-peak (both Gaussian and Lorentzian).

Note 3: The Linear and Polynomial fit selections from the Analysis menu and their respective tools do not use the nonlinear curve fitter. Instead, they are run from the LR.OGS and PR.OGS files, respectively in your Origin installation folder. These files can be edited to include the label command line. If you need help doing this I suggest you contact your local technical support representative. Furthermore, if you do not want to edit any OGS files, there is a hidden Polynomial group in the nonlinear curve fitter which can be enabled by following the steps outlined in a Knowledge Base entry. To see this entry, click here or search the Knowledge Base using the keyword hidden.


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