# Changes between Version 3 and Version 5 of Ticket #11653

Ignore:
Timestamp:
08/06/11 02:09:19 (9 years ago)
Comment:

Thanks, Jose! Just a few pointers:

• You can use some formatting to do stuff here. There are links on the main Trac page, but the most useful one is putting code examples in triples { braces.
• The 'author' is the author of the patch. You are the reporter :) though perhaps also the eventual author as well!

Unmodified
Removed
Modified
• ## Ticket #11653

• Property Cc kcrisman nbruin added; sjm.guzman@… removed
• Property Keywords maxima at desolve added
• Property Authors changed from `JGuzman` to
• ## Ticket #11653 – Description

 v3 When trying to solve a simple ODE whose rhs contains a function, Sage fails to interpret the Maxima output. Here a minimal example is  #========================================================================= sage: x=var('x') # independent variable Here a minimal example is {{{ #===================== sage: x=var('x') # independent variable sage: v=function('v', x) # dependent variable # we define a custom square pulse function def pulse(tonset, tdur, amp): """ returns a square pulse as a function of x, f(x) the pulse is defined as follows:  t onset -- start of pulse  tdur   -- duration of pulse  amp    -- amplitude of pulse """ """ returns a square pulse as a function of x, f(x) the pulse is defined as follows: t onset -- start of pulse tdur   -- duration of pulse amp    -- amplitude of pulse """ f(x)= amp*(sign(x-tonset)/2-sign(x-tonset-tdur)/2) return f # create my pulse function sage: mypulse = pulse(tonset=5, tdur=5, amp=2) # define differential equation s sage: dvdx = diff(v, x)-x -mypulse == 0 # mypulse(x) is function # get the evolution of v myvolt = desolve(de=dvdx, ivar=x, dvar=v, ics=[0,0]) #========================================================================= The error message is: #======= The error message is: ''TypeError: unable to make sense of Maxima expression 'v(x)=-(2*(at(integrate(signum(x-5)-signum(x-13),x),[x=0,v(x)=0]))-2*int\ egrate(signum(x-5)-signum(x-13),x)-x^2)/2' in Sage^'' }}} desolve_laplace leads to similar error: {{{ sage: desolve(de=dvdx, ivar=x, dvar=v, ics=[0,0]) ''TypeError: unable to make sense of Maxima expression 'ilt(((laplace(signum(x-5),x,?g2733)-laplace(signum(x-13),x,?g2733)+v(0)\ )*?g2733^2+1)/?g2733^3,?g2733,x)' in Sage'' }}} According to Nils Bruin, the problem is that Maxima 'at' function. As described in Ticket #385, this can be a problem with the implementation of 'at' for SR. Strange enough, when using other functions, the solver works nicely {{{ sage: dvdx = diff(v, x)-x -sin(x) == 0 sage: desolve(de=dvdx, ivar=x, dvar=v, ics=[http://trac.sagemath.org/sage_trac/log/?revs=0 "[0,0]"]) }}} now Sage returns 1/2*x!^2 - cos(x) + 1