I have created a pull request  for an equation class that can be used as an 
input to `solve()` and `subs()` as well as facilitate step-by-step 
algebraic manipulations. It does not have the problem of collapsing to a 
Boolean that the `Eq` class currently part of Sympy has. This is the 
equation class I have been maintaining through 
[Algebra_with_Sympy](https://gutow.github.io/Algebra_with_Sympy/algebra_with_sympy.html)
 
and a fork of 
[sympy](https://github.com/gutow/sympy-for-algebra/tree/for_algebra_1.13_2). 
The pull request is at: 
[https://github.com/sympy/sympy/pull/28258](https://github.com/sympy/sympy/pull/28258).
 
I would appreciate comments and reviews.

The tools the pull request is derived from have been used extensively in 
the Chemistry community for teaching purposes (I use them to generate 
step-by-step answer keys and to introduce students to using CAS tools). I 
think we should include the Equation class in Sympy to facilitate adoption 
as a general use CAS tool. Sympy has now reached the stage that it is 
adequate for many users who do not need the full power of 
[SageMath](https://www.sagemath.org/) or commercial tools such as Maple and 
Mathematica. However, the lack of something like the proposed `Equation` 
class is a show-stopper for many of them, because they want to be able to 
manipulate equations (e.g. solve a relation algebraically in  a 
step-by-step manner). 

Thanks for your comments and reviews. Please put them in the [pull 
request](https://github.com/sympy/sympy/pull/28258). If you do not have a 
github account, creating one is easy and it does not mean you have to write 
code. The community needs input from users as well as the people who write 
the code.

Thanks,

Jonathan
On Friday, March 29, 2024 at 9:21:47 AM UTC-5 gu...@uwosh.edu wrote:

> On Thursday, March 28, 2024 at 5:47:11 PM UTC-5 asme...@gmail.com wrote:
>
> I think we should try to include something like this in SymPy. 
>
> I'm a little confused by your screenshot. eq =@ c = d is not valid 
> Python syntax. Are you extending the parser somehow to make it valid? 
>
> Aaron Meurer 
>
>
> Aaron,
>
> Sorry about non-Pythonic syntax. You can define equations using `eq1 = 
> Equation(a/b,c-d)`. For this list, I probably should not have used the 
> compact notation.
>
> Algebra_with_Sympy implements a pre-parser that includes the compact `=@` 
> syntax as a substitute for `= Equation(...)`. The pre-parser also 
> implements some other convenience features such as allowing  on-the-fly 
> toggling  (on/off) casting of Python `int` -> Sympy `Integer`.
>
> Most of the interactive user features depend on the existence of an 
> `Equation` class in Sympy, although some of the interactive usability 
> features apply to any Sympy expression. Thus, I would be strongly in favor 
> of including the `Equation` class in Sympy. I am not in favor of modifying 
> the behavior of the `Eq` class because currently other parts of Sympy 
> depend upon its current behavior. Because of the current behavior of `Eq` I 
> do not think it can be reliably used as an input to `.subs()`, `evalf()` or 
> `solve()`. Thus the need for `Equation`.
>
> I also think it might be better to keep the interactive convenience 
> behaviors, such as the request that started this thread, in a separate 
> package such as Algebra_with_Sympy. I have been able to figure out how to 
> have them live there happily, as long as the `Equation` class is embedded 
> in Sympy.
>
> Jonathan
>
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sympy/e75206ba-e0ab-49a0-ac33-7257d5d60403n%40googlegroups.com.

Reply via email to