Another one from the notebook's report a problem bugtracker about ODEs:

assume(n, 'integer') causes desolve to fail

Here is the code that fails :

var('t n')
assume(n, 'integer')
f = function('f',t)
ode = diff(f,t) + (-1)^n*f == 0
desolve(ode, f, [0,1], t)

It should do the same as :

var('t n')
f = function('f',t)
ode = diff(f,t) + (-1)^n*f == 0
desolve(ode, f, [0,1], t)

Confirmed by me in 4.1.1, traceback:

sage: var('t n')
(t, n)
sage: assume(n, 'integer')
sage: f = function('f',t)
sage: ode = diff(f,t) + (-1)^n*f == 0
sage: desolve(ode, f, [0,1], t)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/schilly/<ipython console> in <module>()

/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/desolvers.pyc
in desolve(de, dvar, ics, ivar)
    111     if ics is not None:
    112         if len(ics) == 2:
--> 113             ics = to_eqns([ivar, dvar], ics)
    114             soln = soln.ic1(ics[0], ics[1])
    115         if len(ics) == 3:

/usr/local/sage/local/lib/python2.6/site-packages/sage/calculus/desolvers.pyc
in to_eqns(lhs, exprs)
    104                 eqns.append(expr)
    105             else:
--> 106                 if lhs == dvar and len(exprs) == 2:
    107                     ivar_ic = exprs[0] # figure this out...
    108                     lhs = lhs.subs(lhs.default_variable()==ivar_ic)

/usr/local/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.__nonzero__
(sage/symbolic/expression.cpp:7553)()

AttributeError: 'GenericDeclaration' object has no attribute 'variables'


H

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to