Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Piecewise function of several variables and how to display it

Hi, I need to define a piecewise function of several variables. For a function of one variable I would use probably "Piecewise". I would like to work with a function G of two variables t and s that is of this form:

def G(t,s): if (t < s): return 1 else: return 0

Although this works, I would like to have a nice displaying of this function, like a function generated by "Piecewise" does. Is there another way how to define this function?

Piecewise function of several variables and how to display it

Hi, I need to define a piecewise function of several variables. For a function of one variable I would use probably "Piecewise". Piecewise. I would like to work with a function G of two variables t and s that is of this form:

def G(t,s):
    if (t < s):
        return 1
    else:
        return 0

0

Although this works, I would like to have a nice displaying of this function, like a function generated by "Piecewise" Piecewise does. Is there another way how to define this function?