MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problems with Mathematica 8.0 Solve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114272] Re: Problems with Mathematica 8.0 Solve
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Mon, 29 Nov 2010 06:09:28 -0500 (EST)

----- Original Message -----
> From: "Chris Chiasson" <chris.chiasson at gmail.com>
> [...]
> Thanks for posting about the Method->"Legacy" option. I called
> technical support a few days ago and asked how to use the old Solve
> method, but they never got back to me. Here is an example of an
> equation with a few branches where the new default method falls over.
> 
> Solve[Max[coefficient Cv, low\[UnderBracket]limit,Min[static\
> [UnderBracket]limit, z/(SWL x + y)]] == EBSTNLL/(Mf SWL + WDead), SWL]
> 
> Obviously, the Legacy method doesn't provide the conditions under
> which the solutions are valid, but at least it does go through, take
> each branch, and quickly solve it for the SWL rather than requiring me
> to do that manually. Something needs to be done to make the new
> default Solver more robust in the face of simple equations like the
> one above.
> 
> --
> http://chris.chiasson.name

One can help Solve considerably by providing ranges for all parameters. In this case I'm guessing they all should be positive. If that is an appropriate assumption then the code below suffices, and it is fairly fast to run.

In[39]:= Solve[{Max[coefficient Cv, lowlimit, 
    Min[staticlimit, z/(SWL x + y)]] == EBSTNLL/(Mf SWL + WDead), 
  EBSTNLL > 0, Mf > 0, WDead > 0, x > 0, y > 0, z > 0, Cv > 0, 
  coefficient > 0, lowlimit > 0, staticlimit > 0}, SWL]

Out[39]= {{SWL -> 
   ConditionalExpression[(EBSTNLL - coefficient Cv WDead)/(
    coefficient Cv Mf), (z > 0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 &&
        coefficient > lowlimit/Cv && EBSTNLL > (Mf z)/x && 
       staticlimit > 0 && lowlimit > 0 && 
       0 < WDead < (Mf y)/x) || (z > 0 && x > 0 && Mf > 0 && y > 0 && 
       Cv > 0 && coefficient > lowlimit/Cv && 
       staticlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 0 < WDead < (Mf y)/x) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       coefficient > lowlimit/Cv && WDead > (Mf y)/x && 
       EBSTNLL > (Mf z)/x && lowlimit > 0 && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 
        0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       coefficient > lowlimit/Cv && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       EBSTNLL > (Mf z)/x) || (z > 0 && x > 0 && Mf > 0 && y > 0 && 
       Cv > 0 && coefficient > lowlimit/Cv && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       0 < EBSTNLL < (Mf z)/x) || (z > 0 && x > 0 && Mf > 0 && y > 0 &&
        Cv > 0 && coefficient > staticlimit/Cv && WDead > (Mf y)/x && 
       EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && coefficient > staticlimit/Cv && 
       WDead > (Mf y)/x && 
       EBSTNLL > (Mf z)/x && (EBSTNLL x - Mf z)/(WDead x - Mf y) < 
        staticlimit < (EBSTNLL x)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < lowlimit < 
        staticlimit) || (z > 0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 &&
        coefficient > staticlimit/Cv && WDead > (Mf y)/x && 
       0 < EBSTNLL < (Mf z)/x && 0 < lowlimit < staticlimit && 
       0 < staticlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       coefficient > staticlimit/Cv && 0 < EBSTNLL < (Mf z)/x && 
       0 < WDead < (Mf y)/x && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < lowlimit < staticlimit) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && lowlimit > staticlimit && 
       coefficient > lowlimit/Cv && WDead > (Mf y)/x && 
       EBSTNLL > (Mf z)/x && (EBSTNLL x - Mf z)/(WDead x - Mf y) < 
        staticlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && lowlimit > staticlimit &&
        coefficient > lowlimit/Cv && WDead > (Mf y)/x && 
       0 < EBSTNLL < (Mf z)/x && 
       0 < staticlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && lowlimit > staticlimit &&
        coefficient > lowlimit/Cv && 0 < EBSTNLL < (Mf z)/x && 
       0 < WDead < (Mf y)/x && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 
        0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       staticlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       coefficient > (EBSTNLL x - Mf z)/(Cv WDead x - Cv Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 0 < WDead < (Mf y)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 0 &&
        x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit/Cv < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y)) || (z > 0 && x > 0 && Mf > 0 && y > 0 &&
        Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       coefficient > (EBSTNLL x)/(Cv WDead x - Cv Mf y) && 
       EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 0 &&
        x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       coefficient > (EBSTNLL x)/(Cv WDead x - Cv Mf y) && 
       EBSTNLL > (Mf z)/x && (EBSTNLL x - Mf z)/(WDead x - Mf y) < 
        lowlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && x > 0 &&
        Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       coefficient > (EBSTNLL x)/(Cv WDead x - Cv Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       lowlimit/Cv < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y))]}, {SWL -> 
   ConditionalExpression[(EBSTNLL - lowlimit WDead)/(
    lowlimit Mf), (z > 0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       EBSTNLL > (Mf z)/x && staticlimit > 0 && lowlimit > 0 && 
       0 < WDead < (Mf y)/x && 
       0 < coefficient < lowlimit/Cv) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && lowlimit > staticlimit && WDead > (Mf y)/x &&
        EBSTNLL > (Mf z)/x && 
       0 < coefficient < lowlimit/Cv && (EBSTNLL x - Mf z)/(
        WDead x - Mf y) < staticlimit < (EBSTNLL x)/(
        WDead x - Mf y)) || (z > 0 && x > 0 && Mf > 0 && y > 0 && 
       Cv > 0 && lowlimit > staticlimit && WDead > (Mf y)/x && 
       0 < EBSTNLL < (Mf z)/x && 0 < coefficient < lowlimit/Cv && 
       0 < staticlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && lowlimit > staticlimit &&
        0 < EBSTNLL < (Mf z)/x && 0 < WDead < (Mf y)/x && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < coefficient < lowlimit/Cv) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && 
       staticlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 0 < WDead < (Mf y)/x && 
       0 < coefficient < lowlimit/Cv) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       lowlimit > 0 && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < coefficient < lowlimit/Cv) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < coefficient < lowlimit/Cv && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       EBSTNLL > (Mf z)/x && 0 < coefficient < lowlimit/Cv && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 0 &&
        x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x)/(WDead x - Mf y) && EBSTNLL > (Mf z)/x &&
        0 < coefficient < lowlimit/Cv) || (z > 0 && x > 0 && Mf > 0 &&
        y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 
       0 < coefficient < lowlimit/Cv)]}, {SWL -> 
   ConditionalExpression[(EBSTNLL - staticlimit WDead)/(
    Mf staticlimit), (z > 0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < coefficient < lowlimit/Cv && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < coefficient < staticlimit/Cv && (EBSTNLL x - Mf z)/(
        WDead x - Mf y) < staticlimit < (EBSTNLL x)/(
        WDead x - Mf y) && (EBSTNLL x - Mf z)/(WDead x - Mf y) < 
        lowlimit < staticlimit) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit/Cv < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y)) || (z > 0 && x > 0 && Mf > 0 && y > 0 &&
        Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y) && (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y) < coefficient < staticlimit/Cv) || (z > 
        0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x &&
        0 < EBSTNLL < (Mf z)/x && 0 < lowlimit < staticlimit && 
       0 < coefficient < staticlimit/Cv && 
       0 < staticlimit < (EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && 
       x > 0 && Mf > 0 && y > 0 && Cv > 0 && 0 < EBSTNLL < (Mf z)/x &&
        0 < WDead < (Mf y)/x && 
       0 < staticlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < lowlimit < staticlimit && 
       0 < coefficient < staticlimit/Cv)]}, {SWL -> 
   ConditionalExpression[(-EBSTNLL y + WDead z)/(
    EBSTNLL x - 
     Mf z), (z > 0 && x > 0 && Mf > 0 && y > 0 && Cv > 0 && 
       staticlimit > (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < EBSTNLL < (Mf z)/x && 0 < WDead < (Mf y)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       0 < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y)) || (z > 0 && x > 0 && Mf > 0 && y > 0 &&
        Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < coefficient < lowlimit/Cv && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y)) || (z > 0 && x > 0 && Mf > 0 && 
       y > 0 && Cv > 0 && WDead > (Mf y)/x && EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && (
        EBSTNLL x - Mf z)/(WDead x - Mf y) < staticlimit < (
        EBSTNLL x)/(WDead x - Mf y) && 
       lowlimit/Cv < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y)) || (z > 0 && x > 0 && Mf > 0 && y > 0 &&
        Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       EBSTNLL > (Mf z)/x && 0 < coefficient < lowlimit/Cv && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y)) || (z > 0 &&
        x > 0 && Mf > 0 && y > 0 && Cv > 0 && WDead > (Mf y)/x && 
       staticlimit > (EBSTNLL x)/(WDead x - Mf y) && 
       EBSTNLL > (Mf z)/x && 
       0 < lowlimit < (EBSTNLL x - Mf z)/(WDead x - Mf y) && 
       lowlimit/Cv < coefficient < (EBSTNLL x - Mf z)/(
        Cv WDead x - Cv Mf y))]}}

Daniel Lichtblau
Wolfram Research



  • Prev by Date: Re: Why are my 3D plots blue?
  • Next by Date: Re: Compile can't handle indexed variables inside loops
  • Previous by thread: Re: Problems with Mathematica 8.0 Solve
  • Next by thread: Re: Problems with Mathematica 8.0 Solve