Exemplo n.º 1
0
def test_issue_7173():
    assert laplace_transform(sinh(a*x)*cosh(a*x), x, s) == \
        (a/(s**2 - 4*a**2), 0,
        And(Or(Abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <
        pi/2, Abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <=
        pi/2), Or(Abs(periodic_argument(a, oo)) < pi/2,
        Abs(periodic_argument(a, oo)) <= pi/2)))
Exemplo n.º 2
0
def test_sympyissue_7173():
    assert laplace_transform(sinh(a*x)*cosh(a*x), x, s) == \
        (a/(s**2 - 4*a**2), 0,
         And(Or(Abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <
                pi/2, Abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <=
                pi/2), Or(Abs(periodic_argument(a, oo)) < pi/2,
                          Abs(periodic_argument(a, oo)) <= pi/2)))
Exemplo n.º 3
0
def test_laplace_transform_2():
    LT = laplace_transform
    # issue sympy/sympy#7173
    assert LT(sinh(a*x)*cosh(a*x), x, s) == \
        (a/(s**2 - 4*a**2), 0,
         And(Or(abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <
                pi/2, abs(periodic_argument(exp_polar(I*pi)*polar_lift(a), oo)) <=
                pi/2), Or(abs(periodic_argument(a, oo)) < pi/2,
                          abs(periodic_argument(a, oo)) <= pi/2)))

    # issues sympy/sympy#8368 and sympy/sympy#7173
    assert LT(sinh(x) * cosh(x), x, s) == (1 / (s**2 - 4), 2, Ne(s / 2, 1))
Exemplo n.º 4
0
def test_periodic_argument():
    p = Symbol('p', positive=True)

    assert unbranched_argument(2 + I) == periodic_argument(2 + I, oo)
    assert unbranched_argument(1 + x) == periodic_argument(1 + x, oo)
    assert N_equals(unbranched_argument((1 + I)**2), pi/2)
    assert N_equals(unbranched_argument((1 - I)**2), -pi/2)
    assert N_equals(periodic_argument((1 + I)**2, 3*pi), pi/2)
    assert N_equals(periodic_argument((1 - I)**2, 3*pi), -pi/2)

    assert unbranched_argument(principal_branch(x, pi)) == \
        periodic_argument(x, pi)

    assert unbranched_argument(polar_lift(2 + I)) == unbranched_argument(2 + I)
    assert periodic_argument(polar_lift(2 + I), 2*pi) == \
        periodic_argument(2 + I, 2*pi)
    assert periodic_argument(polar_lift(2 + I), 3*pi) == \
        periodic_argument(2 + I, 3*pi)
    assert periodic_argument(polar_lift(2 + I), pi) == \
        periodic_argument(polar_lift(2 + I), pi)

    assert unbranched_argument(polar_lift(1 + I)) == pi/4
    assert periodic_argument(2*p, p) == periodic_argument(p, p)
    assert periodic_argument(pi*p, p) == periodic_argument(p, p)

    assert Abs(polar_lift(1 + I)) == Abs(1 + I)

    assert periodic_argument(x, pi).is_real is True
    assert periodic_argument(x, oo, evaluate=False).is_real is None
Exemplo n.º 5
0
def test_periodic_argument():
    p = Symbol('p', positive=True)

    assert unbranched_argument(2 + I) == periodic_argument(2 + I, oo)
    assert unbranched_argument(1 + x) == periodic_argument(1 + x, oo)
    assert N_equals(unbranched_argument((1 + I)**2), pi/2)
    assert N_equals(unbranched_argument((1 - I)**2), -pi/2)
    assert N_equals(periodic_argument((1 + I)**2, 3*pi), pi/2)
    assert N_equals(periodic_argument((1 - I)**2, 3*pi), -pi/2)

    assert unbranched_argument(principal_branch(x, pi)) == \
        periodic_argument(x, pi)

    assert unbranched_argument(polar_lift(2 + I)) == unbranched_argument(2 + I)
    assert periodic_argument(polar_lift(2 + I), 2*pi) == \
        periodic_argument(2 + I, 2*pi)
    assert periodic_argument(polar_lift(2 + I), 3*pi) == \
        periodic_argument(2 + I, 3*pi)
    assert periodic_argument(polar_lift(2 + I), pi) == \
        periodic_argument(polar_lift(2 + I), pi)

    assert unbranched_argument(polar_lift(1 + I)) == pi/4
    assert periodic_argument(2*p, p) == periodic_argument(p, p)
    assert periodic_argument(pi*p, p) == periodic_argument(p, p)

    assert Abs(polar_lift(1 + I)) == Abs(1 + I)

    assert periodic_argument(x, pi).is_real is True
    assert periodic_argument(x, oo, evaluate=False).is_real is None