Turning conditions into numbers.
is a basic function that turns True
. It is sometimes known as the characteristic function
or indicator function
This gives the area of a unit disk.
It is often convenient to have functions with different forms in different regions. You can do this using Piecewise
This plots a piecewise function.
Piecewise functions appear in systems where there is discrete switching between different domains. They are also at the core of many computational methods, including splines and finite elements. Special cases include such functions as Abs
, and Max
handles piecewise functions in both symbolic and numerical situations.
This generates a square wave.
Here is the integral of the square wave.