Skip to content

Commit

Permalink
feat(polys): Add DomainMatrix based on poly elements
Browse files Browse the repository at this point in the history
Remove simplification in Wester test_Z3 as the results are determinstic
now.
  • Loading branch information
oscarbenjamin committed Mar 17, 2020
1 parent b5fb4db commit f51ebdc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions sympy/utilities/tests/test_wester.py
Expand Up @@ -20,7 +20,7 @@
FiniteSet, elliptic_e, elliptic_f, powsimp, hessian, wronskian, fibonacci,
sign, Lambda, Piecewise, Subs, residue, Derivative, logcombine, Symbol,
Intersection, Union, EmptySet, Interval, idiff, ImageSet, acos, Max,
MatMul, conjugate, cancel)
MatMul, conjugate)

import mpmath
from sympy.functions.combinatorial.numbers import stirling
Expand Down Expand Up @@ -2996,15 +2996,10 @@ def test_Z3():
r = Function('r')
# recurrence solution is correct, Wester expects it to be simplified to
# fibonacci(n+1), but that is quite hard
expected = 2**(-n)*(- sqrt(5)*(1 - sqrt(5))**n
+ 5*(1 - sqrt(5))**n
+ sqrt(5)*(1 + sqrt(5))**n
+ 5*(1 + sqrt(5))**n)/10
expected = ((S(1)/2 - sqrt(5)/2)**n*(S(1)/2 - sqrt(5)/10)
+ (S(1)/2 + sqrt(5)/2)**n*(sqrt(5)/10 + S(1)/2))
sol = rsolve(r(n) - (r(n - 1) + r(n - 2)), r(n), {r(1): 1, r(2): 2})
# XXX: We use cancel and radsimp because the output from rsolve is
# non-deterministic.
assert cancel(radsimp(sol)) == expected

assert sol == expected


@XFAIL
Expand Down

0 comments on commit f51ebdc

Please sign in to comment.