T O P I C R E V I E W |
dwearly |
Posted - 05/29/2007 : 8:36:39 PM 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 |
6 L A T E S T R E P L I E S (Newest First) |
dwearly |
Posted - 06/02/2007 : 10:17:39 PM Thanks. I was able to use that to get the results I wanted. |
Mike Buess |
Posted - 05/30/2007 : 10:06:03 PM 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 |
dwearly |
Posted - 05/30/2007 : 8:13:40 PM 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 |
Mike Buess |
Posted - 05/29/2007 : 11:49:35 PM 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 |
dwearly |
Posted - 05/29/2007 : 9:51:46 PM 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. |
larry_lan |
Posted - 05/29/2007 : 9:20:55 PM 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 |