Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ode and piecewise function

Hi all,

I am trying to solve, using Sage, an ode which includes a piecewise. For that I wrote the following piece of code which raises an error :

f = piecewise([(RealSet.unbounded_below_open(0),0), (RealSet.unbounded_above_closed(0),10)])
u = function('u')(x)
eqn = 2*diff(u,x) + u == f(x)
u = desolve(eqn, u, ivar=x)
show(expand(u))

Since the error vanishses when I replace the function f by either of the functions exp or log, I guess the problem is coming from the piecewise function. Could anyone help me solve this issue and explain what is wrong here?

Thanks