Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'integrating over general step functions' topicStudent Support Forum > General > "integrating over general step functions"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Henry Lamb
10/03/03 7:18pm

UnitStep can be used to define piecewise functions regardless of the pieces or their domains. Think of it as a switch, which turns on a function piece within its domain and turns it off otherwise. The definition of UnitStep is

0, x<0,
1, x>=0.

To turn the switch on at some value of x, say x1, we need a term (x-x1) in the argument of UnitStep. To turn it off at another value of x, say x2, we need a term -(x-x2) or (x2-x). If we take the product of these, both terms must be positive for the switch to be on. This is true only if x is between x1 and x2.

For example, suppose you have a piecewise function defined as

f1[x],x<x1,
f2[x],x1<=x<x2,
f3[x],x<=x2

Here you have three pieces. The first piece begins at -Infinity and ends at x1, so its term is

f1[x]UnitStep[-(x-x1)] or
f1[x]UnitStep[x1-x].

The middle piece extends from x1 to x2, so its term is

f2[x]UnitStep[-(x-x1)(x-x2)] or
f2[x]UnitStep[(x-x1)(x2-x)].

The third piece begins at x2 and ends at Infinity, so its term is

f3[x]UnitStep[(x-x2)].

The complete function is then the sum of these terms.



URL: ,

Subject (listing for 'integrating over general step functions')
Author Date Posted
integrating over general step functions Jeff Hamrick 09/24/03 11:14am
Re: integrating over general step functions Henry Lamb 09/30/03 01:02am
Re: integrating over general step functions Jeff Hamrick 10/02/03 4:51pm
Re: integrating over general step functions Henry Lamb 10/03/03 7:18pm
< Previous CommentHelp | Reply To Comment | Reply To Topic