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 for Programming
 Forum for Origin C
 how to add function : exponential assoc 1 ?

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
taya Posted - 04/26/2008 : 4:49:05 PM
Hello,

I try to add an exponential assoc order 1 function to the OriginPro 7.0, but I always get an error message when I try to use it to analyse my data. It is said that my parameters are not properly initialized. I do not have a good basic in C language, so I just try to modify the existing equation and its programming.

The equation I want to use is : y = y0 + A1*(1 - exp(-x/t1))

I try to use :
y0 = max( y_data );
x_y_curve = ln( x_y_curve );
double coeff[2];
fitpoly( x_y_curve, 1, coeff);
A1 = exp( coeff[0] );
t1 = -1.0 / coeff[1];

but I got an error message while I was try to execute and use it from the wizard.

I also try to use :
double ya = yatasymt(x_y_curve);
x_y_curve = ya - x_y_curve;
double coeff[4];
fitpoly(x_y_curve,3,coeff);
y0=ya-coeff[0];
x_y_curve=ln(x_y_curve);
fitpoly(x_y_curve,1,coeff);
A1=exp(coeff[0];
t1=-1.0/coeff[1];

but still I got an error message.

Can anyone help me??

Thanks in advance.
3   L A T E S T    R E P L I E S    (Newest First)
Deanna Posted - 02/09/2009 : 02:15:26 AM
Most of the time, you can just try to give initial values for the parameters and see if you can get a good fit. In your case, I would try A=0.3, B=2 or something like that.

For writing initial code, the basic idea is to get some data points from the source data and set up equations to solve the parameter values.

Deanna
OriginLab Technical Services
Pasiphae Posted - 02/07/2009 : 1:27:06 PM
Hi... I´ve been having the same problem... the thing is I have no idea on how to write anything in C. I wanted to adjust my data to the following function:
y=(A+x)^B

Where both A and B are parameters I want to find. I know B varies between 0.3 and 0.4, but nothing on A.

I have no idea how to initialise properly my parameters or anything of the sort... so any help whould be great!
Thank you in advance!

"When the power of love overcomes the love of power the world will know peace" - Jimi Hendrix
Echo_Chu Posted - 04/30/2008 : 04:53:58 AM
Hi,

I have tried your initial code and it looks work fine. When you update the function, did you also update Parameter Names as "y0,A1,t1"?

When I try your initial codes.
First paragraph of codes does not work fine if there is negative value in dataset. I think it is because this line "x_y_curve = ln( x_y_curve );"


There is a mistake in 2nd paragraph of initial codes.

A1=exp(coeff[0]);

")" is missing in your origin codes. However, the initial codes work fine after ")" is added.

Echo
OriginLab Corp


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