Sympy - symbolically solves floating power equations

Using sympy, I define characters,

a, b, c = sympy.symbols(['a', 'b', 'c'])

Then, when I try to solve the following system of equations,

sympy.solve([sympy.Eq(b - a**2.552 - c), sympy.Eq(a, 2)])

I get a solution

[{b: c + 5.86446702875684, a: 2.00000000000000}]

But when I try to decide

sympy.solve([sympy.Eq(b - a**2.552 - c), sympy.Eq(b, 2)])

It seems to work (for ~ 4 hours), without a solution. Any help would be appreciated!

+4
source share
1 answer

I do not know why, but it rational=Falsehelps

sympy.solve([sympy.Eq(b - a**2.552 - c), sympy.Eq(b, 2)], rational=False)

see sympy freezes when trying to solve a simple algebraic equation

+5
source

Source: https://habr.com/ru/post/1656760/


All Articles