Hi,
I am trying to use the functionality of adding overlapping intervals from piecewise functions :
>>> p1 = Piecewise ( (1,(0 <= x) & (x < 1)) )
>>> p2 = Piecewise ( (1,(0.5 <= x) & (x < 1.5)) )
>>> p3 = p1 + p2
>>> p3
>>> p3._eval_interval(x,0,1.4)
What I expect is :
0 < x <= 0.5 --> 1
0.5 < x <= 1 --> 2
1 < x < 1.4 --> 1
What I get is :
0
Can sympy Piecewise do this? Is this the right tool for the job?