Ask Your Question
0

case distinction in symbolic expression

asked 12 years ago

MvG gravatar image

Is it possible to include a case distinction in a symbolic expression?

More precisely, I'm currently trying to understand how to include a truncated power function into a symbolic expression, if that is at all possible.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 12 years ago

ndomes gravatar image

To distinct two cases you can use the heaviside function:

f(x) = heaviside(x)*x^2
print type(f)
f(2); f(0); f(-2)
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 710 times

Last updated: Mar 13 '13