I think the best way to state my problem is to illustrate it with an example. Assume I have the following toy-list of rules:
toylist = {a -> 10^12 b + 2 c, d -> 10^-11 e - 0.5 b, f -> 2 g}
What I am trying to find is a way of "reversing" the rules according to the coefficients present in the righthand side. Namely, if the coefficient of a certain variable in the righthand side is above a certain value, say 10^10, I would like to rewrite the rule so that the variable in question is on the lefthand side. The desired output would be:
toylist = {b -> 10^-12 a - 2*10^-12 c, d -> 10^-11 e - 0.5 b, f -> 2 g}
Note that I do not want anything to happen to the other rules in toylist
, they're good as they are because all the coefficient are below the cutoff.
I am sure there's a clever way of doing this, I have tried in a lot of ways but failed miserably. Maybe using associations? I'm not so sure.
a->10^12 b + 2 c + 3*10^15 d
. Then you solve for the biggest one of the two above cutoff, in this cased
. $\endgroup$