Hi,

On 10 September 2012 21:04, billpap <[email protected]> wrote:

> I have posted my problem already in StackOverflow,
>
>
> http://stackoverflow.com/questions/12353608/sympy-solve-and-solve-poly-system#comment16590856_12353608
>
> A second problem that I have, is, that although when I use
> solve_poly_system in gnome terminal
> everything it's ok, when I use solve_poly_system in Hadoop streaming, I
> have the same issue that
> I have with solve() when I use it in gnome terminal.
>

Can you try the most recent version (master branch) from
github.com/sympy/sympy? I tried your example and it doesn't work in 0.7.x
but works in master. Here is a sample session:

IPython console for SymPy 0.7.1-git (Python 2.7.2-64-bit) (ground types:
gmpy)

In [1]: var('r,d,l,k,u,a')
Out[1]: (r, d, l, k, u, a)

In [2]: system = [Eq(r*d, l*k), Eq(u*a, l*k), Eq(k, a*d)]

In [3]: system
Out[3]: [d⋅r = k⋅l, a⋅u = k⋅l, k = a⋅d]

In [4]: solve(system, a, d, l)
Out[4]:
⎡⎛       _____         _____            ⎞  ⎛      _____        _____
    ⎞⎤
⎢⎜      ╱ r⋅u         ╱ r⋅u             ⎟  ⎜     ╱ r⋅u        ╱ r⋅u
   ⎟⎥
⎢⎜-k⋅  ╱  ───   -k⋅  ╱  ───        _____⎟  ⎜k⋅  ╱  ───   k⋅  ╱  ───
_____⎟⎥
⎢⎜   ╲╱    k       ╲╱    k        ╱ r⋅u ⎟  ⎜  ╲╱    k      ╲╱    k       ╱
r⋅u ⎟⎥
⎢⎜────────────, ────────────, -  ╱  ─── ⎟, ⎜───────────, ───────────,   ╱
 ─── ⎟⎥
⎣⎝     u             r         ╲╱    k  ⎠  ⎝     u            r       ╲╱
 k  ⎠⎦

In [5]: solve(system, [a, d, l])
Out[5]:
⎡⎛       _____         _____            ⎞  ⎛      _____        _____
    ⎞⎤
⎢⎜      ╱ r⋅u         ╱ r⋅u             ⎟  ⎜     ╱ r⋅u        ╱ r⋅u
   ⎟⎥
⎢⎜-k⋅  ╱  ───   -k⋅  ╱  ───        _____⎟  ⎜k⋅  ╱  ───   k⋅  ╱  ───
_____⎟⎥
⎢⎜   ╲╱    k       ╲╱    k        ╱ r⋅u ⎟  ⎜  ╲╱    k      ╲╱    k       ╱
r⋅u ⎟⎥
⎢⎜────────────, ────────────, -  ╱  ─── ⎟, ⎜───────────, ───────────,   ╱
 ─── ⎟⎥
⎣⎝     u             r         ╲╱    k  ⎠  ⎝     u            r       ╲╱
 k  ⎠⎦

In [6]: [ eq.subs(zip((a, d, l), _5[0])).simplify() for eq in system ]
Out[6]:
⎡       _____          _____         _____          _____       ⎤
⎢      ╱ r⋅u          ╱ r⋅u         ╱ r⋅u          ╱ r⋅u        ⎥
⎢-k⋅  ╱  ───  = -k⋅  ╱  ─── , -k⋅  ╱  ───  = -k⋅  ╱  ─── , k = k⎥
⎣   ╲╱    k        ╲╱    k       ╲╱    k        ╲╱    k         ⎦

In [7]: [ bool(eq.subs(zip((a, d, l), _5[0])).simplify()) for eq in system ]
Out[7]: [True, True, True]

In [8]: [ bool(eq.subs(zip((a, d, l), _5[1])).simplify()) for eq in system ]
Out[8]: [True, True, True]

When reporting a problem please include project version number and exact
code. Otherwise it's only guessing what's wrong.


> Do you have any ideas?
>
> Thanks in advance.
>
> --
> 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/-/Qq8W3Qu1ot4J.
> 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.
>

Mateusz

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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.

Reply via email to