Examples with Graphics and  Conditional Definitions

As a another example, let's define the Sign function. It should be -1 when its argument is negative, 0 when its argument is zero, and +1 when its argument is positive.  There are lots of ways to write this function, there is no best way. Whatever works is good.

"index_173.gif"

"index_174.gif"

Here we write our own version, we don' t "name'' the pattern because it is not needed in the function definition.  It is a bit harder to read this way, but I use it here to be instructive.

"index_175.gif"

"index_176.gif"

"index_177.gif"

"index_178.gif"

"index_179.gif"

Functions with Conditional Definitions

In thermodynamics, x ln(x) appears frequently in expressions that involve entropy.  The variable x is restricted to 0 ≤x≤1.

"index_180.gif"

"index_181.gif"

"index_182.gif"

"index_183.gif"

"index_184.gif"

"index_185.gif"


Created by Wolfram Mathematica 6.0  (06 September 2007) Valid XHTML 1.1!