First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One easy way is to use the Piecewise function. Some examples are given in the reference manual.

click to hide/show revision 2
No.2 Revision

One easy way Will the following suit your needs?

def f(x,a):
    if x <= a:
        return 0
    else:
        return (x-a)^2

There is to use the also a Piecewise function. Some examples are given in the reference manual.class, but it doesn't look like it will work for what you want.