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 my own exp fitting function

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
marasneo Posted - 04/20/2015 : 11:08:42 AM
Hi!
I have tried to modify standard Origin ExpDecay2 function to solve equation like this:

Z=C0+C1*exp(x1*t)+C2*exp(x2*t)

where t is my x (independent variable) and Z is dependent (y)
I am interested in determination of x1 and x2 roots which should be always negative.
Unfortunately, after fitting, they are always positive. Probably I am doing something wrong...

There is my modified code below (probably with errors). I need to take into account also the offset x0 (I do not know if the formula will be the same as for ExpDecay2 or not).

Always before each fitting I am just setting the Auto Parameter Initialization and checking "fixed" for C0 and x0 offset values (the same for function like ExpDecay2 - is it ok?).

FUNCTION

C0 + C1*exp(-(x-x0)*ex1) + C2*exp(-(x-x0)*ex2)

PARAMETER INIT

x0 = min(x_data);
int sign;
ex1 = get_exponent(x_data, y_data, &C0, &C1, &sign);
if (ex1 > 0)
{
int nSize = x_data.GetSize();
C0 = y_data[0] + y_data[nSize-1] - C0;
C1 = C2 = -0.5 * sign * exp(C1+ex1*(x_data[0]+x_data[nSize-1])-x0*ex1);
ex1 = ex2 = 1 / ex1;
}
else
{
ex1 = ex2 = -1 / ex1;
C1 = C2 = 0.5 * sign * exp(C1 - x0/ex1);
}


Please, help me with this problem.
1   L A T E S T    R E P L I E S    (Newest First)
JacquelineHe Posted - 04/21/2015 : 04:27:59 AM
Hi,

In Origin ExpDecay2 function, the parameter is /ex1.
But in you new function, that is *ex1.

So it can not follow the ExpDecay2 function initialization code of those parameters.

Thanks
Jacqueline
OriginLab

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