solve() has issues with equations like these currently because it
wants to treat them as polynomials. But the degree of the polynomial
is related to the numerator and denominator of the exponent:
In [14]: Rational(0.45)
Out[14]:
8106479329266893
─────────────────
18014398509481984
If you use rational numbers, and solve for a manually in the second
equation, you get a degree 20 polynomial (after multiplying by b**20):
In [24]: expr = a * b**Rational(45, 100) - a + 1 - 4.5 * b
In [25]: expr.subs(solve([0.45 * a * b**(Rational(45, 100) - 1) - 4.5], [a]))
Out[25]:
11
──
20
- 10.0⋅b + 5.5⋅b + 1
I was able to get solutions with solve(expr.subs(solve([0.45 * a *
b**(Rational(45, 100) - 1) - 4.5], [a]))*b**20, rational=True), but
none are expressible exactly.
I recommend trying nsolve, which can give you numeric solutions to
this system, and quite fast:
In [30]: nsolve([a * b**0.45 - a + 1 - 4.5 * b, 0.45 * a * b**(0.45 -
1) - 4.5], [a, b], [1, 1])
Out[30]:
⎡ 1.09929682680944 ⎤
⎢ ⎥
⎣0.0180539685108078⎦
Aaron Meurer
> --
> 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
https://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/857b5528-22eb-496c-b0a1-5e449c0c2075%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.