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
 Split user defined function into smaller pieces

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
nihonlabmonkey Posted - 07/29/2009 : 01:54:24 AM
Origin Ver. 8.0951 and Service Release 4:
Operating System:Vista

Hello,

I am sure that this is a simple problem, but for the life of me I cannot find out how to do this.

I have a simple data set of x and y that I want to fit using a user defined non-linear curve fit. The function I need to fit it to has a number of terms, but all of these terms are simple functions of x. Grossly simplified, I mean something along the lines of:

y=a*cos(x*b+c)*d*(x^e)+f*x

a,b,c,d,e and f are all simple fitting parameters. (Please note that this is not really my function.) What I would like to do is fit this function by doing something like:

y=ALPHA*BETA+GAMMA
where
ALPHA=a*cos(DELTA)
BETA=d*(x^e)
GAMMA=f*x
DELTA=x*b+c

The main reason for doing this is that in reality my function is much more complicated than the example I have given, so typing it all out in one line is very error prone. If anybody could point me along the right lines I would greatly appreciate it because I am sure that there must be a simple way to do this and I will probably feel a little foolish when it is explained to me.

Kindest regards,

Giles
1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 07/29/2009 : 02:48:25 AM
Hi:

Define the function like:

double alpha, beta, gamma, delta;

delta = x*b+c;
alpha = a*cos(delta);
beta = d*(x^e);
gamma = f*x;

y = alpha * beta + gamma;


Thanks
Larry
OriginLab Technical Services

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