#9961: Allow assumptions on the dependent variable in desolve
-------------------------------------------+--------------------------------
Reporter: robert.marik | Owner: burcin
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.6
Component: symbolics | Keywords:
Author: Burcin Erocal, Robert Marik | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-------------------------------------------+--------------------------------
Changes (by newvalueoldvalue):
* author: => Burcin Erocal, Robert Marik
Comment:
I uploaded a new patch attachment:trac_9961-assume_function.take2.patch.
The previous version caused doctest failures like:
{{{
File
"/home/burcin/sage/sage-4.5.2.rc0/devel/sage-s/sage/calculus/wester.py",
line 386:
sage: assume(real(x) > 0, real(y) > 0)
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[131]>", line 1, in <module>
assume(real(x) > Integer(0), real(y) > Integer(0))###line 386:
sage: assume(real(x) > 0, real(y) > 0)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/symbolic/assumptions.py", line 357, in assume
x.assume()
File "expression.pyx", line 1214, in
sage.symbolic.expression.Expression.assume
(sage/symbolic/expression.cpp:6320)
ValueError: Assumption is redundant
}}}
or
{{{
File
"/home/burcin/sage/sage-4.5.2.rc0/devel/sage-s/sage/symbolic/expression.pyx",
line 7691:
sage: (a*q^k).sum(k, 0, oo)
Exception raised:
Traceback (most recent call last):
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/burcin/sage/sage-4.5.2.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_170[21]>", line 1, in <module>
(a*q**k).sum(k, Integer(0), oo)###line 7691:
sage: (a*q^k).sum(k, 0, oo)
File "expression.pyx", line 7717, in
sage.symbolic.expression.Expression.sum
(sage/symbolic/expression.cpp:30994)
Mathematica, so even if the chosen backend can perform the
summation the
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/calculus/calculus.py", line 503, in symbolic_sum
result = maxima.simplify_sum(sum)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/interfaces/expect.py", line 1387, in __call__
return self._parent.function_call(self._name, list(args), kwds)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/interfaces/expect.py", line 1322, in function_call
return self.new(s)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/interfaces/expect.py", line 1097, in new
return self(code)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/interfaces/expect.py", line 1032, in __call__
return cls(self, x, name=name)
File "/home/burcin/sage/sage-4.5.2.rc0/local/lib/python/site-
packages/sage/interfaces/expect.py", line 1457, in __init__
raise TypeError, x
TypeError: Computation failed since Maxima requested additional
constraints (try the command 'assume(abs(q)-1>0)' before integral or limit
evaluation, for example):
Is abs(q)-1 positive, negative, or zero?
}}}
This patch restricts the special treatment to user defined functions.
This passes all the symbolics related doctests, I think it's ready for
review.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9961#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.