I have the following system of equations that involve some rather complicated exponents:

$$ \left\{\frac{\mathit{a} \sigma ^{41/34}}{\mathit{m}^{8/119} \mathcal{M}^{28/17}}=1,\frac{\mathit{b}\mathit{q}\mathit{m}^{2/3} \mathcal{M}^3}{\sqrt{\sigma }}=1,\frac{\mathit{f} \mathit{c} \mathit{m}^{436/357}}{\sigma ^{48/17} \mathcal{M}^{38/51}}=1\right\} $$

I'd like Mathematica to find the positive, real solutions to this equation for $\mathcal{M}$, $\sigma$, and $q$, ($a$, $b$, $c$, $m$, and $f$ remain undefined) and Solve is able to do this, but it literally takes ~30 minutes to solve the expression:

FullSimplify[Abs[Cases[({sigma, M, q} /. 
  Solve[expression, {sigma, M, q}]), _?(FreeQ[N[#, 16], Complex] && 
    FreeQ[N[#, 16], Positive] &)][[1]]], 
      Assumptions -> Join[assume, # > 0 & /@ coeffs]]

I noticed if I make one simple change to the expression, multiplying the RHS by the denominators, i.e.

$$ \left\{\mathit{a} \sigma ^{41/34}=\mathit{m}^{8/119} \mathcal{M}^{28/17},\mathit{b}\mathit{q}\mathit{m}^{2/3} \mathcal{M}^3 = \sqrt{\sigma },\mathit{f} \mathit{c} \mathit{m}^{436/357} = \sigma ^{48/17} \mathcal{M}^{38/51}\right\} $$

...then the expression solves in about 30 seconds. Unfortunately, it is the first form that is spat out by my previous lines of code, and that form is not the same for each evaluation.

I'm wondering why the first solve is so much more expensive than the second, and if there are strategies I can use when simplifying expressions to guarantee that Solve won't choke on them.

  • 1
    $\begingroup$ For starters, when you divide you need to check for all possible zeroes ... $\endgroup$ – Dr. belisarius Jan 21 '16 at 16:32
  • $\begingroup$ see if Denominator[ ] helps you out ... $\endgroup$ – Dr. belisarius Jan 21 '16 at 16:34
  • $\begingroup$ @Dr.belisarius I didn't have assume definition up in the question, but all quantities are real and greater than zero. $\endgroup$ – Guillochon Jan 21 '16 at 16:36
  • 2
    $\begingroup$ I routinely do exprs=Apply[Subtract,eqns,{1}]; neweqns=Thread[Numerator[Together[exprs]]==0]; $\endgroup$ – Daniel Lichtblau Jan 21 '16 at 16:46
  • $\begingroup$ @DanielLichtblau That works great! I guess the main overhead here is the "checking for zeroes" part. $\endgroup$ – Guillochon Jan 21 '16 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.