This module contains query handlers responsible for calculus queries: infinitesimal, bounded, etc.
Handler for key ‘bounded’.
Test that an expression is bounded respect to all its variables.
Examples of usage:
>>> from sympy import Symbol, Q
>>> from sympy.assumptions.handlers.calculus import AskBoundedHandler
>>> from sympy.abc import x
>>> a = AskBoundedHandler()
>>> a.Symbol(x, Q.positive(x)) == None
True
>>> a.Symbol(x, Q.bounded(x))
True
Return True if expr is bounded, False if not and None if unknown.
Truth Table:
B U ? ‘+’ ‘-‘ ‘x’ ‘+’ ‘-‘ ‘x’ B B U ? U ‘+’ U ? ? U ? ? ‘-‘ ? U ? ? U ? ‘x’ ? ? ? ?
- ‘B’ = Bounded
- ‘U’ = Unbounded
- ‘?’ = unknown boundedness
- ‘+’ = positive sign
- ‘-‘ = negative sign
- ‘x’ = sign unknown
- All Bounded -> True
- 1 Unbounded and the rest Bounded -> False
- >1 Unbounded, all with same known sign -> False
- Any Unknown and unknown sign -> None
- Else -> None
When the signs are not the same you can have an undefined result as in oo - oo, hence ‘bounded’ is also undefined.
Return True if expr is bounded, False if not and None if unknown.
Truth Table:
B | U | ? | ||
s | /s | |||
B | B | U | ? | |
U | U | U | ? | |
? | ? |
- B = Bounded
- U = Unbounded
- ? = unknown boundedness
- s = signed (hence nonzero)
- /s = not signed
Unbounded ** NonZero -> Unbounded Bounded ** Bounded -> Bounded Abs()<=1 ** Positive -> Bounded Abs()>=1 ** Negative -> Bounded Otherwise unknown
Handles Symbol.
Examples:
>>> from sympy import Symbol, Q
>>> from sympy.assumptions.handlers.calculus import AskBoundedHandler
>>> from sympy.abc import x
>>> a = AskBoundedHandler()
>>> a.Symbol(x, Q.positive(x)) == None
True
>>> a.Symbol(x, Q.bounded(x))
True
Handler for key ‘infinitesimal’ Test that a given expression is equivalent to an infinitesimal number
Infinitesimal*Bounded -> Infinitesimal
Infinitesimal*Bounded -> Infinitesimal