T O P I C R E V I E W |
sumanluthr |
Posted - 09/16/2004 : 2:31:42 PM Origin Version (Select Help-->About Origin): 5.0(also 7.5 trial ver.) Operating System:XP I use my own fitting fuctions for Non-linear curve fitting. Is there a way to transfer these functions(equations) so that I am able to open the files on some other computer and work on it. Thank you Suman |
11 L A T E S T R E P L I E S (Newest First) |
sumanluthr |
Posted - 09/17/2004 : 4:29:01 PM Hey Eashwar & Mike, Thanks guys!! Suman |
easwar |
Posted - 09/17/2004 : 09:50:14 AM quote:
I would like to fit data to the " Gaussian error function" (erfc). This function, however, is not available in Origin 7.5. How can I do the fit?
Hi,
First of all, please start a new thread/topic for such questions so that we can keep the discussions from running into each other...
The erfc function is available in the collection of NAG functions included in Origin. To use this function, from the NAG collection, do the following in Origin 7.5
1> start defining a new fitting function in NLSF 2> leave the "Use Origin C" checkbox checked 3> click the "Edit in Code Builder" button to open Code Builder 4> scroll to the top and change the include statements so that it looks like (replace existing .h includes with just origin.h): #pragma warning(error : 15618) #include <origin.h> 5> scroll down to editable part of window and enter your function, such as (use whatever parameters and other math expressions you want, using nag_erfc(x): y=P1*nag_erfc(x); 6> compile the function by clicking the Compile Button 7> click "Return to NLSF" and then save the function and fit with it
For documentation on the nag_erfc function, look at the Programming Help file, and the subtopic: Origin C Language Reference->Global Functions->NAG Functions-> NAG Approximation of Special Functions There is also a nag_erf() function in there.
Easwar OriginLab
|
Kosch |
Posted - 09/17/2004 : 02:22:09 AM I would like to fit data to the " Gaussian error function" (erfc). This function, however, is not available in Origin 7.5. How can I do the fit? |
Mike Buess |
Posted - 09/17/2004 : 12:42:39 AM The file might be named User1.pdf. If that doesn't work search for the word or phrase "Function Name=GAB".
...Duh, too late to think straight. There's a sure way to find the file name.
1. Open the Non-linear Curve fitter and note the name of the Category containing your function.
2. Find NLSF.ini in Origin's program folder and open it in Notepad.
3. Find the section with the same name as the Category. Under that section will be a line like this...
GAB=filename
That tells you that your function is saved in filename.fdf.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/17/2004 01:01:26 AM |
sumanluthr |
Posted - 09/16/2004 : 11:14:17 PM I was able to see the file extension but the file that I am looking for doesn't turn up in the search with any extension. I know you would say that it doesn't exist then. But take a look at this. The is the what I copied from the origin program. This is one of the the most confusing things I have seen. The function is there but no file of that name in the computer. [GENERAL INFORMATION] Function Name=GAB Brief Description=user1 Function Source=N/A Function Type=User-Defined Function Form=Y-Script Number Of Parameters=3 Number Of Independent Variables=1 Number Of Dependent Variables=1
[FITTING PARAMETERS] Naming Method=User-Defined Names=Wm,Cg,Kg Meanings=? Initial Values=--(V) Lower Bounds=--(X,OFF) Upper Bounds=--(X,OFF) Number Of Significant Digits=
[FORMULA] y=(Wm*Cg*Kg*x)/((1-(Kg*x))*((1-Kg*x)+(Cg*kg*x)))
[CONSTRAINTS] /*Enter general linear constraints here*/
[CONSTANTS]
[INITIALIZATIONS] /*Scripts to be executed before fitting, a good place for complicated initialization.*/
[AFTER FITTING] /*Scripts to be executed after fitting, a good place for generating results.*/
[INDEPENDENT VARIABLES] x=
[DEPENDENT VARIABLES] y=
[CONTROLS] General Linear Constraints=Off Initialization Scripts=Off Scripts After Fitting=Off Number Of Duplicates=N/A Duplicate Offset=N/A Duplicate Unit=N/A Generate Curves After Fitting=Yes Curve Point Spacing=Same X as Fitting Data Generate Peaks After Fitting=Yes Generate Peaks During Fitting=Yes Generate Peaks with Baseline=Yes Paste Parameters to Plot After Fitting=Yes Paste Parameters to Notes Window After Fitting=Yes Generate Residue After Fitting=No Keep Parameters=No
|
Mike Buess |
Posted - 09/16/2004 : 10:37:24 PM If your function is called MyFunc then search for the file MyFunc.fdf in Windows Explorer.
...XP has the nasty habit of hiding file extensions. (MS considers that a 'feature'.) If you don't see extensions then select 'Folder Options' on Windows Explorers Tools menu. Select the View tab in the resulting dialog and uncheck the 'Hide extensions for known file types' option.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/16/2004 10:46:34 PM |
sumanluthr |
Posted - 09/16/2004 : 9:53:51 PM Thanks for the reply. I don't have any functions written in the demo version yet. I am only trying to retrieve the older functions from ver. 5. Unfortunately, the functions show up clearly in origin (and actually work) just not in the program path. |
Mike Buess |
Posted - 09/16/2004 : 9:20:46 PM 1. Adobe's forms documents and Origin's function files share the same extension. All files in the fitfunc folder that claim to belong to Adobe are actually Origin function files. Your function must be there or you would not be able to use it.
2. You said you are using both Origin 5.0 and the 7.5 demo. Those versions have somewhat different directory structures. In Origin 5.0 the fitfunc folder is on Origin's program path. In Origin 7.5 it is on your user path. To find out what your user path is open the script window and type this...
%Y=<press Enter>
Origin's FDF files are normal text files with an INI-like structure. You can open them in Notepad and should be able to tell at a glance which one is yours.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/16/2004 9:28:26 PM |
sumanluthr |
Posted - 09/16/2004 : 7:17:32 PM Hi, I checked again and there are default function files but not the ones I saved. Suman |
sumanluthr |
Posted - 09/16/2004 : 7:10:50 PM Hi Easwar, I appreciate your help. I checked in the \fitfunc folder but there are no such files with .FDF extension.All the files are adobe acrobat forms document type files. Suman |
easwar |
Posted - 09/16/2004 : 3:02:02 PM Hi Suman,
All fitting functions are saved on disk in files with extension .FDF and so once your fitting function is saved, you can copy the FDF file from the \FitFunc subfolder and take it to another computer etc.
On the other machine, you can just drag-and-drop the FDF file onto Origin, and a dialog will come up and allow you to add the function to existing category or to a new category etc.
Easwar OriginLab
|