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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Split user defined function into smaller pieces
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nihonlabmonkey

Japan
1 Posts

Posted - 07/29/2009 :  01:54:24 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

larry_lan

China
Posts

Posted - 07/29/2009 :  02:48:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000