Skip to content

Commit

Permalink
Allow arg in periodic_argument
Browse files Browse the repository at this point in the history
periodic_argument does currently leave unevaluated all expressions that
contain periodic_argument, atan2, arg or atan after simplifications.
It follows that the following expression will often appear in the
convergence conditions of integrals computed by meijerint.

>>> unbranched_argument(1/polar_lift(x))
periodic_argument(1/polar_lift(x), oo)

>>> meijerint.meijerint_definite(exp(I*t*x)/(x + a), x, 0, oo)
(exp(-I*a*t)*expint(1, a*t*exp_polar(-I*pi/2)),
((Abs(periodic_argument(1/polar_lift(a), oo)) < pi) &
Eq(Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(t), oo)), pi/2)) |
((Abs(periodic_argument(1/polar_lift(a), oo)) < pi) &
(Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(t), oo)) < pi/2)) |
((Abs(periodic_argument(exp_polar(-I*pi/2)*polar_lift(t), oo)) < pi/2) &
((Abs(periodic_argument(1/polar_lift(a), oo)) < pi) |
((Abs(periodic_argument(1/polar_lift(a), oo)) < pi) &
Ne(Abs(periodic_argument(1/polar_lift(a), oo)), pi)))))

These expressions will be more readable if periodic_argument
is allowed to return values containing arg.

>>> unbranched_argument(1/polar_lift(x))
-arg(x)

>>> meijerint.meijerint_definite(exp(I*t*x)/(x + a), x, 0, oo)
(exp(-I*a*t)*expint(1, a*t*exp_polar(-I*pi/2)),
((Abs(arg(a)) < pi) & Eq(Abs(arg(t) - pi/2), pi/2)) |
((Abs(arg(a)) < pi) & (Abs(arg(t) - pi/2) < pi/2)) |
((Abs(arg(t) - pi/2) < pi/2) & ((Abs(arg(a)) < pi) |
((Abs(arg(a)) < pi) & Ne(Abs(arg(a)), pi)))))
  • Loading branch information
jksuom committed Jan 30, 2018
1 parent f52535c commit f18ce44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sympy/functions/elementary/complexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def eval(cls, ar, period):
unbranched = cls._getunbranched(ar)
if unbranched is None:
return None
if unbranched.has(periodic_argument, atan2, arg, atan):
if unbranched.has(periodic_argument, atan2, atan):
return None
if period == oo:
return unbranched
Expand Down

0 comments on commit f18ce44

Please sign in to comment.