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
 General introduction for Parameter Initialization
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

DER-TYP

Germany
1 Posts

Posted - 04/23/2009 :  07:49:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello @all

I'm trying to write my own fitting function with the functionorganizer. The simulation of the curves works fine, but if i try to fit a curve the constants were totally wrong.
I've tryed to copy some intialization expressions from other fits but this did not work very well.
So what i'm looking for is an introduction, how the Origin-C code works.

For example:

int sign;
A = get_exponent(y_data,x_data,&B,&sign);


what means "int sign;" and how does effect the result of "A", what happens if did not mention it in the expression for "A".

In addition the 3 function i try to fit

y = A*(x*x)*exp(B*x)+y0

y = A*(x*x)*exp(-B/x)+y0

y = A*x*exp(-B)*exp(C*sqrt(D*x))+y0


I'm working with the ORIGIN PRO 8G SR2 on Win XP Pro SP3

thx at all for reading
regards
Ronny

greg

USA
1378 Posts

Posted - 06/10/2009 :  4:51:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You could just assign some arbitrary value to each parameter and hope that the fitter can find its way to a good fit, but Origin Parameter intializations are designed to estimate an initial value for each parameter to get the fitter reasonably close before starting to fit.

We make use of several OriginC functions in trying to estimate initial parameter values. In this case, we used the get_exponent function which takes four arguments:
y_data The Y data for the fit
s_data The X data for the fit
B One of the parameters (passed by reference with &)
sign A variable (passed by reference with &)
Since 'sign' is not a parameter or dataset it needs to be declared. The line:
int sign;
declares sign as a variable of type integer.

Most of the functions you see in the built-in parameter initializations have been designed for our specific use, but there many functions available for user parameter initialization. Look in the Programming help under
Origin C\Origin C Reference\Global Functions\Mathematics\Curve
for useful functions.
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