Thanks a lot for your answer. I belived "Eq" was a reduction for "Equation"
and not for "Equality".
I started to do something similar to what you mention, but your way to do
it is smarter and I did and I will use your way.
Thanks a lot,
Mike.
Question : As you answerd nicely my question I require to close this
request. How may I do it ?
Le dimanche 26 juillet 2020 20:13:11 UTC+2, Davide Sandona' a écrit :
>
> Hello Mike,
> sadly, what you are trying to do is not easily possible! You are thinking
> of Eq as an equation, instead in Sympy it is an alias for the class
> Equality. They are conceptually different and the behaviour you are trying
> to represent is not possible: you can not apply the same mathematical
> operation to both sides simultaneously. If you happen to have objects of
> type Equality, it is better to convert them to an expression and perform a
> manipulation, for example:
>
> eq.rewrite(sp.Add).collect(a) / a
>
> Alternatively:
>
> sp.Eq(*[arg / a for arg in eq.args])
>
> If you absolutely need an object to represent an equation, take a look at
> the source code of this pull-request [1]. It's not perfect, but it is a
> starting point; with that class Equation, you can apply the same
> mathematical operation to both sides simultaneously.
>
> [1] https://github.com/sympy/sympy/pull/19479
>
> Davide.
>
>
> Il giorno dom 26 lug 2020 alle ore 19:39 Mikhael Myara <
> [email protected] <javascript:>> ha scritto:
>
>> a simple code :
>>
>> import sympy as sp
>> sp.var('a b c',nonzero=True)
>> eq = Eq(a*b,a*c)
>> display(eq)
>> display(eq.simplify())
>>
>> Both display exhibit : ab = ac
>>
>> I would have liked sympy to simply remove 'a', which is possible because
>> I mentioned 'a' is nonzero.
>>
>> What's wrong ?
>>
>> Best regards, Mike
>>
>> --
>> 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] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/23535fa8-2842-4259-96aa-4862292c8ae1o%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/sympy/23535fa8-2842-4259-96aa-4862292c8ae1o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/1bde6006-121a-4d7f-b628-1cc57eeb3dado%40googlegroups.com.