What I'm doing in this case is writing simple functions, say y = log(2*x)/2
- 3 and then computing their inverse through a function I made myself. The
usefulness in having domains is that when you compute an inverse of a
function, the domain of the inverse is the range of the original. Likewise,
the range of the inverse is the domain of the original.

Since it's for my own purposes I really could represent it with nested
lists/tuples, using booleans to include a value or not:

[[(-sympy.oo, False), (-1, True)], [(0, False), (sympy.oo, True)]]

which represents (-inf, -1] U (0, inf)

which would work fine for my purposes. However I'm pretty sure with what I
plan to do I'm going to be using domains a fair bit more in the future so
if I have something that is going to work with what SymPy has planned then
it may help.


On 24 July 2013 21:34, Stefan Krastanov <[email protected]> wrote:

> It depends what exactly you want to do.
>
> If you need it just for typography purposes (e.g. writing something in
> IPython notebook and wanting to print the expression) you are using sympy
> incorrectly. SymPy is not a typography library. (if you insists there are
> hacks to do it)
>
> On the other hand quite frequently you need this for meaningful
> mathematics.
>
> - if you want to work on polynomials and do certain operations (finding
> roots, etc) over a given field, you do this by specifying the field during
> the creation of the polynomial.
>
> - there is some work in progress to be able to do the same for matrices,
> but it is not ready.
>
> - in general, there is the assumption module. It is a bit of a mess,
> because we have an old and a new assumption module and we try to move to
> the new one. If all that you want is for abs(x) to automatically return x
> (or something similar) it suffices to define x as `x=Symbol('x',
> positive=True)`. There are a few other handles like `real` and `integer`.
>
> - if you need something more general or more fancy, we may have it in some
> (possibly unfinished, mostly unused) form, but it goes deeper in SymPy so a
> more precise question will help us give you a more precise answer.
>
>
> On 24 July 2013 13:10, Ben Lucato <[email protected]> wrote:
>
>> We can represent domains on paper quite easily - for instance we can
>> write x < 0, or alternatively x (epsilon symbol) R-, or even x (epsilon
>> symbol) (-infinity, 0)
>>
>> I looked around but couldn't really find that - is there a canonical way
>> to be writing domains in SymPy?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sympy" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sympy/vMa2TEbdb-k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 


Ben Lucato
----------------------------------------------------------------------------------
Phone: +61 400 159 632 | Email: [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to