It would be nice if we could have variables take an interval as an input
argument, to replace or augment the current system of "is_something" flags.
Say,
>>> x = Symbol('x', domain=Interval(0, oo))
>>> x.is_positive
True
>>> x.is_real
True
>>> x.is_bounded
False
The variable x would carry around its interval, and we could use interval
arithmetic <http://en.wikipedia.org/wiki/Interval_arithmetic> on functions
of variables to find the interval of an expression:
>>> x = Symbol('x', domain=Interval(-1, 1))
>>> y = Symbol('y', domain=Interval(0, 2))
>>> (x+y).domain
Interval(-1, 3)
Currently (I think), there's no way to specify a range that a symbol can
take to this extent. Hopefully, notation like this would simplify things
like solving equations within a bounded domain, perhaps.
If we want to be really ambitious, since an Interval is simply a type of
set, we can extend this notation to support arbitrary sets, though
specifying a symbol to be in the set of Reals would not add any extra
functionality...
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sympy/-/peRtdNF7OioJ.
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/sympy?hl=en.