AFAIK, Sage cannot at this time take the inverse Laplace transform of something of the form e^{-5s}/s.
I think Sympy (included with Sage) can http://docs.sympy.org/dev/modules/integrals/integrals.html#integral-transforms but I don't think it's been integrated together with initial conditions: >>> y = Function('y') >>> dsolve(Derivative(y(x),x) - Heaviside(-5 + x), y(x)) / | y(x) = C1 + | Heaviside(x - 5) dx | / (Cross-posted to sympy's support list.) On Mon, Jan 9, 2012 at 12:39 PM, Renan Birck Pinheiro <renan.ee.u...@gmail.com> wrote: > Hi, > > I'm trying to solve a differential equation with unit step, e.g. the > equation y'(x) = U(x-5) - where U is the unit step, and the inicial > condition y(0) is 0. > > The result is 0 for 0<x<5 and x-5 for x>5 (it's a simple integral of the > unit step function). WolframAlpha gives the correct result [1], however sage > fails: > > sage: x=var('x') > sage: y=function('y',x) > > sage: desolve(diff(y,x) - unit_step(x-5),y,ics=[0,1]) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /home/renan/<ipython console> in <module>() > > /opt/sage/local/lib/python2.6/site-packages/sage/calculus/desolvers.pyc in > desolve(de, dvar, ics, ivar, show_method, contrib_ode) > 488 raise NotImplementedError, "Maxima was unable to > solve this BVP. Remove the initial condition to get the general > solution." > 489 > --> 490 soln=soln.sage() > 491 if is_SymbolicEquation(soln) and soln.lhs() == dvar: > 492 # Remark: Here we do not check that the right hand side does > not depend on dvar. > > /opt/sage/local/lib/python2.6/site-packages/sage/interfaces/interface.pyc in > sage(self) > 866 Rational Field > 867 """ > --> 868 return self._sage_() > 869 > 870 def __repr__(self): > > /opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima_abstract.pyc > in _sage_(self) > 1222 import sage.calculus.calculus as calculus > 1223 return > calculus.symbolic_expression_from_maxima_string(self.name(), > -> 1224 maxima=self.parent()) > 1225 > 1226 def _symbolic_(self, R): > > /opt/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc in > symbolic_expression_from_maxima_string(x, equals_sub, maxima) > 1699 return symbolic_expression_from_string(s, syms, > accept_sequence=True) > 1700 except SyntaxError: > -> 1701 raise TypeError, "unable to make sense of Maxima expression > '%s' in Sage"%s > 1702 finally: > 1703 is_simplified = False > > TypeError: unable to make sense of Maxima expression > 'y(x)=-at(integrate(unit_step(x-5),x),[x=0,y(x)=1])+integrate(unit_step(x-5),x)+1' > in Sage > > desolve_laplace is no better: > > sage: desolve_laplace(diff(y,x) - unit_step(x-5),y,ics=[0,1]) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > /home/renan/<ipython console> in <module>() > > /opt/sage/local/lib/python2.6/site-packages/sage/calculus/desolvers.pyc in > desolve_laplace(de, dvar, ics, ivar) > 657 if str(soln).strip() == 'false': > 658 raise NotImplementedError, "Maxima was unable to solve this > ODE." > --> 659 soln=soln.sage() > 660 if ics!=None: > 661 d = len(ics) > > /opt/sage/local/lib/python2.6/site-packages/sage/interfaces/interface.pyc in > sage(self) > 866 Rational Field > 867 """ > --> 868 return self._sage_() > 869 > 870 def __repr__(self): > > /opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima_abstract.pyc > in _sage_(self) > 1222 import sage.calculus.calculus as calculus > 1223 return > calculus.symbolic_expression_from_maxima_string(self.name(), > -> 1224 maxima=self.parent()) > 1225 > 1226 def _symbolic_(self, R): > > /opt/sage/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc in > symbolic_expression_from_maxima_string(x, equals_sub, maxima) > 1699 return symbolic_expression_from_string(s, syms, > accept_sequence=True) > 1700 except SyntaxError: > -> 1701 raise TypeError, "unable to make sense of Maxima expression > '%s' in Sage"%s > 1702 finally: > 1703 is_simplified = False > > TypeError: unable to make sense of Maxima expression > 'ilt(e^-(5*?g2652)*(y(0)*?g2652*e^(5*?g2652)+1)/?g2652^2,?g2652,x)' in Sage > > Any suggestions? I seached but couldn't find an example of ODEs with > unit_step being solved in Sage. I'm using Sage 4.7.2. > > Thanks! > > [1] > http://www.wolframalpha.com/input/?i=y%27%28x%29+%3D+unit+step%28x-5%29%2C+y%280%29+%3D+0 > -- > Renan Birck Pinheiro, Grupo de Microeletrônica, Engenharia Elétrica, UFSM - > Santa Maria, Brazil > > http://renanbirck.blogspot.com / skype: renan.ee.ufsm / (55) 91433210 > > > > -- > To post to this group, send email to sage-support@googlegroups.com > To unsubscribe from this group, send email to > sage-support+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org