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
 All Forums
 Origin Forum
 Origin Forum
 Problem with stretched-exponential function (Fit)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
mej Posted - 12/01/2004 : 09:46:44 AM
Origin Version (Select Help-->About Origin): 6.1 Pro
Operating System: win 2000

Hi everybody,

i try to fit non-exponential decay time curves with strectched-exponential function (P1*exp[(x/P2)^P3]). The problem is that the fit procedure is very slow (the iterations take a lot of time).

Thanks

Edited by - mej on 12/01/2004 09:47:37 AM
3   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 12/03/2004 : 10:21:09 AM
Hi Mej,

You can try this in the demo version of 7.5 that you can download from our website.

The NLSF tool will pretty much look the same. On the function definiton page, there is now a new option - the default is that the function is defined using Origin C code. Origin C is ANSI C compatible and so basically this just means you can write multiple lines of code to define your function, such as:
double temp = P1 * x;
y = temp + P2;
etc

There is a button to click that opens the code in a color-coded editor window, which then allows for easy editing/defining of the function.

For simple one-line functions, this works exactly like the script definition, except that the fitting will be faster.

A couple of things to note when defining functions with Origin C:
1> if you want to compute any temporary quantities in your function, you need to define the temporary variables, so need to write as
double temp = P1 * x;
and not just
temp = P1 * x
as in LabTalk
2> when doing math operations, need to follow C syntax
1/2 is not same as 1.0/2
1/2 will give 0, whereas 1.0/2 will be 0.5 etc
which is different from LabTalk

In the demo, there is a sample file:
\Samples\Analysis\Curve Fitting\NLSF User Def Func
that you could look at, as well.

Easwar
OriginLab


mej Posted - 12/03/2004 : 09:22:01 AM
Hi Easwar

Do you know if there are examples to define my function using Origin C.

Mej

easwar Posted - 12/01/2004 : 11:27:50 AM
Hi,

In versions prior to 7, you can create an external DLL and call that from your fitting function to speed things up.

In versions 7.0 and higher, you can define your function using Origin C which will be faster than LabTalk script for fitting.

Easwar
OriginLab


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000