0
Gibt es einen Weg (innerhalb von Sympy) zu prüfen, ob sich zwei Ausdrücke durch eine Konstante unterscheiden? Mit anderen Worten, gibt es so etwas wie eine is_constant()
Funktion?Prüfen, ob sich ein Sympy-Ausdruck zu einer Konstanten vereinfacht
Mein Mindestarbeitsbeispiel:
from sympy import symbols, simplify
x,y = symbols('x y')
expr1 = x+y+1
expr2 = x+y+3
if is_constant(simplify(expr1 - expr2)):
print('expr2 is just expr1 added to a constant!')