Re: [sympy] Transformations on sets/intervals/unions

2013-08-09 Thread Matthew Rocklin
The API has changed in a recent PR https://github.com/sympy/sympy/pull/2341 imageset(x, 2*x, Interval(0, 1) [0, 2] On Thu, Aug 1, 2013 at 7:43 AM, Matthew Rocklin mrock...@gmail.com wrote: I'm renaming TransformationSet to ImageSet (I think this is a more precise name).

Re: [sympy] Transformations on sets/intervals/unions

2013-08-01 Thread Matthew Rocklin
I'm renaming TransformationSet to ImageSet (I think this is a more precise name). https://github.com/sympy/sympy/pull/2341 2340 is in by the way but the interface will change shortly to Interval(0, 1).image(x, 2*x) [0, 2] On Tue, Jul 30, 2013 at 8:33 AM, Matthew Rocklin mrock...@gmail.com

Re: [sympy] Transformations on sets/intervals/unions

2013-07-30 Thread Ben Lucato
Awesome! You are a gentleman and a scholar, Matthew Rocklin. Thanks for letting me know there is no way to do this in the current sympy. On 30 July 2013 13:18, Matthew Rocklin mrock...@gmail.com wrote: At some point we might do a simplify sort of treatment for sets. In the meantime

[sympy] Transformations on sets/intervals/unions

2013-07-29 Thread Ben Lucato
Howdy, say I do: domain = Interval(-pi, 0, True, True) + Interval(0, pi/2, True, True) I could hope to do a transformation to dilate this domain by a factor 2 from the origin, like so: new_domain = domain.replace(lambda expr: expr.is_Real, lambda expr: 2*expr) OR: new_domain =

Re: [sympy] Transformations on sets/intervals/unions

2013-07-29 Thread Matthew Rocklin
This is what I get. Can you verify that things don't work for you? This was done in sympy/master. In [1]: domain = Interval(-pi, 0, True, True) + Interval(0, pi/2, True, True) In [2]: new_domain = TransformationSet(Lambda(x, 2*x), domain) In [3]: domain Out[3]: ⎛ π⎞ ⎜0, ─⎟ ∪ (-π, 0) ⎝ 2⎠

Re: [sympy] Transformations on sets/intervals/unions

2013-07-29 Thread Ben Lucato
Thanks - I updated to the git master and now the TransformationSet works. Is there some way to take this new TransformationSet object and rewrite it as a Union/Interval? i.e. get this: Interval(-2*pi, 0, True, True) + Interval(0, pi, True, True) On Tuesday, 30 July 2013 10:34:48 UTC+10,

Re: [sympy] Transformations on sets/intervals/unions

2013-07-29 Thread Matthew Rocklin
At some point we might do a simplify sort of treatment for sets. In the meantime something like the following could work in the case of monotonic functions. In general we know how to transform Intervals and FiniteSets. We know that unions and intersections will compose well with these