How to solve absolute value equations using sympy?
Asked Answered
H

1

8

Given the equation |x - 5| + |y| = 5, how can one solve it using SymPy?

If I'm using a combination of solve() and Abs() it gives me this error

solving Abs(x - 5) when the argument is not real or imaginary

But, at the beginning of my session I wrote down that

x, y, z = symbols('x, y, z', RealNumber = True)

What am I doing wrong?

Thanks!

Hass answered 17/10, 2015 at 16:2 Comment(0)
H
7

Okay, I've found out, what was the problem. The declaration was wrong, so I had to change it to the form

x, y, z = symbols('x y z', real=True)
Hass answered 18/10, 2015 at 13:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.