>
> Hi, you cannot mix python syntax with building a symbolic expression when
> solving ... the root problem is, that expressions are "built up" and not
> evaluated, while python functions are evaluated from the inside.
>
Thank you. Where can I find some more documentation on this?
Try: g
Thank you for your help
With
g(x) = heaviside(f(x)) * f(x)
plotting seems to work correctly in all cases.
However
solve([g(x)==y,y==4],[x,y])
still does not work. Of course I could simply do g(4), but I'm providing a
simplified exemple of a more general and complicated case. My point is: i
I need to define a function like the following (the function cannot assume
negative values):
y = 5 - 2x if f(x)>0
0 otherwise
I tried different solutions:
f(x) = 5 - 2*x
def g(x): return max(f(x),0)
or:
f(x) = 5 - 2*x
def g(x): return f(x) if f(x)>0 else 0
However,