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
 Equation and Sample curve for User created Functio
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dwearly

USA
Posts

Posted - 05/29/2007 :  8:36:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (7.5):
Operating System: Win XP

I created a user function that is working as expected, but I would like it to paste the equation when I "Paste Parameters to Plot". The equation is displayed for the built in functions, so I am assumig that I am just missing something. I wold also like to preview the equation and the line when deciding the function, but am not sure on how to do that.

Thanks

larry_lan

China
Posts

Posted - 05/29/2007 :  9:20:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

Yes, just built-in function equations will be pasted on the graph after fitting.

quote:

I wold also like to preview the equation and the line when deciding the function, but am not sure on how to do that.



For user-defined functions, I think you can enter some parameter values and simulate a curve:



Larry
OriginLab Technical Services
Go to Top of Page

dwearly

USA
Posts

Posted - 05/29/2007 :  9:51:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the help.
I am able to get the line and the parameters to the plot, but the parameter box on the plot does not contain the equation.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/29/2007 :  11:49:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
but the parameter box on the plot does not contain the equation.
That's only automatic for built in equations. Of course you can create your own output for plot label or result log and run from the After Fitting scripts.
quote:
I wold also like to preview the equation and the line when deciding the function
If your fitting function is called MyFunction create a WMF file to be shown in Equation pane and name it MyFunction.wmf. Create another WMF file to be shown in Sample Curve pane and name it MyFunction.cuv. Copy both files to the FitFunc subfolder on your User path or the Program path along with MyFunction.fdf. Equation and Sample Curve figures should show up automatically in the Advanced Fitter the next time you open it.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/29/2007 11:59:27 PM
Go to Top of Page

dwearly

USA
Posts

Posted - 05/30/2007 :  8:13:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I looked through the help file and the forum, but couldn't find basic info on how to make scripts for this purpose. Is there a knowledge base or other information on how to do that?

I should be able to figure out the WMF file.
Thanks
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/30/2007 :  10:06:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
I looked through the help file and the forum, but couldn't find basic info on how to make scripts for this purpose. Is there a knowledge base or other information on how to do that?
Here are a couple examples...

http://www.originlab.com/forum/topic.asp?TOPIC_ID=4753&ARCHIVE=

http://www.originlab.com/www/support/resultstech.aspx?ID=704&language=English&Version=All

...Those examples only print to the result log. The following LabTalk script also creates a graph label with the information in the first example. If your FDF file is typical then the script will be able to read the function directly from file.

%A=nlsf.fitdata$;
%B=nlsf.func$;
%Z=Data: %A\r\nModel: %B;
ini.file$=%YFitFunc\%B.fdf;
%A=ini.Formula.y$;
%Z=%Z\r\nEqn: %A;
%Z=%Z\r\n\r\nR^2: $(nlsf.cod^2);
%Z=%Z\r\n\r\nCO [ppm]: $(nlsf.p1) +/- $(nlsf.e1);
%Z=%Z\r\nD [cm^2/s]: $(nlsf.p2) +/- $(nlsf.e2);
%Z=%Z\r\nt [s]: $(nlsf.p3) +/- $(nlsf.e3);
label -s -sa -n FitLabel %Z; // create graph label;
savered=type.redirection;
type.redirection=16;
type.beginresults();
ty %Z; // print to results log
separator 3;
type.endresults();
type.redirection=savered;

Graph label looks like this...

Data: Data1_B
Model: MyFunc
Eqn: y = f(x)

R^2: 0.9999

CO [ppm]: CO +/- dCO
D [cm^2/s]: D +/- dD
t [s]: T +/- dT

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/31/2007 02:07:00 AM
Go to Top of Page

dwearly

USA
Posts

Posted - 06/02/2007 :  10:17:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks.
I was able to use that to get the results I wanted.
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