Mathematica Asked on February 17, 2021
I have a list of rational equations and I would like to convert it to a list of polynomial equations. I know that none of the variables and none of the denominators could ever be 0.
So far I have tried:
removeDenom[ a_ == b_ ] := Numerator[a]Denominator[b] == Numerator[b]Denominator[a];
ratToPol[eqn_] := removeDenom @* Together @ eqn;
Which seems to do the trick for rational equations with small exponents of the variables but for larger ones, e.g.
x[1]^24566482 x[2]^25894864 x[3]^36056313 x[5]^2 x[6]^2==(x[1]^10050244 x[2]^10878704 x[3]^15147675 x[6]^8)/x[5]^4+x[1]^39374641 x[2]^41453905 x[3]^57720898 x[5]^4 x[6]^2 x[7]^2
I get the error General::lrgexp Exponent is out of bounds for function 1
.
Any ideas on how to proceed? It would be nice if there was a way without using Simplify or other higher-level functions for which it is unknown how they operate exactly.
This function works for the example expression
removeDenom[a_ == b_] := Block[{
u = Times @@ Denominator /@ a,
v = Times @@ Denominator /@ b},
Expand[u a v] == Expand[u b v]
]
It multiplies the LHS by all the denominators it finds on the RHS and vice versa.
The polynomialGCD
error occurs in Together
, so don't use ratToPol
. Just use removeDenom[p]
Also, removeDenom
does NOT play nice with subscripted variables u
and v
, but it seems to work with x
.
Answered by LouisB on February 17, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP