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
 heavyside 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
nebiha2006 Posted - 07/28/2006 : 10:17:49 AM
Origin Version (Select Help-->About Origin):
Operating System:
HI, i'm trying to search the heavyside function in the Origin Lab, but no result! does it exist as a function?
or else can u help me to program it?
thank u.
6   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 08/11/2006 : 07:31:14 AM
Hi Richard,

Adding the function to the System folder will not automatically make it available for use in other OC files. You must also prototype in each file...

double Heavyside(double);

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/11/2006 07:53:54 AM
verrallr@a Posted - 08/10/2006 : 4:50:05 PM
Or you can use Code Builder to establish Heavyside function thus,

double Heavyside(double x)
{if (x<0) return 0;
else return 1;}

and then put that function in the Systems directory (located on the left side of Code Builder).

That way the Heavyside function is started whenever you load Origin, and you can use it whenever you want. (You don't need to link it to another function, which you may not always want to use.)

Richard.
nebiha2006 Posted - 07/29/2006 : 06:55:09 AM
thank u
Mike Buess Posted - 07/28/2006 : 8:24:54 PM
The compiler is looking for an OriginC function called h(x) which doesn't exist. This should work assuming (....) is a sensible expression...

double h = 0;
if( x>0 ) h = 1;
y = (....)*h;


It's even easier than that...

if( x<0 ) y = 0;
else y = (....);

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/29/2006 2:32:47 PM
nebiha2006 Posted - 07/28/2006 : 5:18:26 PM
actually, the problem isn't to set a column value, but im doing a non linear curve fit, so i have to put an analytical expression in which there is the heavyside function, that's why i want to program this function
i did:
if (x<0) h(x)=0;
else h(x)=1;
y=(......)*h(x);
but it doesn't want to compile,
that's the main problem

thanks for help.
Mike Buess Posted - 07/28/2006 : 10:36:49 AM
As far as I know, Heaviside is merely the step function...

H(x) = 0 (x<0)
H(x) = 1 (x>0)

Programming example:
If column A contains the X values you can fill column B with Heaviside values like this...

col(B) = col(A) > 0 ? 1 : 0;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/28/2006 10:59:58 AM

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