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
 How do I create a Sin*Cos 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
chrothenbach Posted - 10/21/2009 : 11:54:15 AM
Origin Ver. and Service Release: V7.5885 (B885)
Operating System: Vista

For my PhD project I need to fit some curves to a function. I tried all the formulas that come within OriginPro and the best fit I could achieve was with the ECS formula, but I do not believe it is exactly what I need.

What I need is some sort of Sin*Cos, which comes from solving the electrical field for a diffraction grating using Maxwell's Equations. This formula should be of the form:

y=C*Sin(A*x)*Cos(Pi*B*x).

A,B,C are parameters that I do not know the values for.

How can I define a formula for that? I tried to do it myself and miserably failed. Can someone give me a hand here?

-Christian
4   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 10/21/2009 : 1:14:01 PM
Hi,

In your 7.5 installation, look at this help topic:
Analysis: Curve Fitting>The NLSF Advanced Fitting Tool>User-Defined Fitting Functions>
to learn more about creating user-defined functions.

Easwar
OriginLab
chrothenbach Posted - 10/21/2009 : 12:56:14 PM
thanks for the reply...

Could I create a fdf file? I am not very familiar on how to use a C file yet, and I also do not know how to use a C file when curve fitting.

Do I have to define variables?
easwar Posted - 10/21/2009 : 12:19:08 PM
quote:
Originally posted by chrothenbach

y=(C*Sin(A*x)*Cos(Pi*B*x))^2 should be the correct formula.




Hi,

By default Origin C is used when defining a new fitting function. And Origin C is case sensitive, so instead of Sin() need to use sin().

So try changing your function definition to:
y=(C*sin(A*x)*cos(Pi*B*x))^2;

Pi is okay, as pi, Pi and PI are all predefined.

You can click the Edit in Code Builder button and then try compiling the code to get error messages that can then tell what is wrong.

Easwar
OriginLab
chrothenbach Posted - 10/21/2009 : 12:00:45 PM
y=(C*Sin(A*x)*Cos(Pi*B*x))^2 should be the correct formula.

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