How to check if two terms are equal but not identical

32 views
Skip to first unread message

Peter

unread,
Feb 10, 2015, 3:20:35 AM2/10/15
to sy...@googlegroups.com

Hi everybody,

for my recent project I have to check using sympy if two terms are equal or identical.

Example:

  • x+2=5 and x+5=8 - these two terms are equal (equivalent) but they are not identical
  • x+2=5 and x+2=5 - these are equal and identical

Question:

Is it possible to differentiate between "equal" and "identical"? If so - how do I achieve this?


Thanks a lot!

Peter

Christophe Bal

unread,
Feb 10, 2015, 3:30:22 AM2/10/15
to sympy-list
Hello.

Have you tried to simplify exp_1 - exp_2 to see if it is equal to zero ?


Christophe BAL
Enseignant de mathématiques en Lycée et développeur Python amateur
---
French math teacher in a "Lycée" and Python amateur developer

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/5d39e92a-32d4-4876-a04d-1ac5c8ed2ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter

unread,
Feb 10, 2015, 4:03:30 AM2/10/15
to sy...@googlegroups.com
Yes I did so...
Meanwhile, I think my main problem is that I've to call sympy from a PHP site. 
When I try it via the shell , it will work for me now ...

If I'm right, the problem will arise with the following part of the code:


transformations=(standard_transformations + (implicit_multiplication_application,) + (function_exponentiation,)+(convert_xor,))
print(latex(parse_expr(sys.argv[1], transformations=transformations)))



Reply all
Reply to author
Forward
0 new messages