Re: Reduce bug report

*To*: mathgroup at smc.vnet.net*Subject*: [mg56302] Re: [mg56273] Reduce bug report*From*: Chris Chiasson <chris.chiasson at gmail.com>*Date*: Thu, 21 Apr 2005 05:36:21 -0400 (EDT)*References*: <200504200932.FAA18065@smc.vnet.net> <0407f4ea86cea55acfc0157e506a1953@mimuw.edu.pl>*Reply-to*: Chris Chiasson <chris.chiasson at gmail.com>*Sender*: owner-wri-mathgroup at wolfram.com

Andrzej Kozlowski: Your point about Reduce requiring more time to work through the more complicated equations is taken. It is unfortunate that Mathematica does not recognize that the extra equation is almost trivial to solve. I was using reduce to be rigorous with the solution; I suppose that is a step I am no longer patient enough to take. Thank you for your response and suggested use of the parameter elimination feature in Solve. Regards, On 4/20/05, Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote: > *This message was transferred with a trial version of CommuniGate(tm) Pro* > > On 20 Apr 2005, at 18:32, Chris Chiasson wrote: > > > *This message was transferred with a trial version of CommuniGate(tm) > > Pro* > > I am sending this to MathGroup first in the hope that I am wrong. > > > > In the code below, I give two sets of equations. On Mathematica 5.0 > > for Windows, the Reduce command does not finish evaluation if Most@ is > > removed from the second equation set. > > > > I have done my best to make sure the problem is well posed by making > > sure there are exactly as many equations as unknowns (less unit > > variables) and by telling Mathematica that all units are nonzero. > > > > Reduce can easily handle it if the last equation of the "defining > > equations" (prob2[defineqns]) is separate system from the rest of the > > equations, but this should be unnecessary. > > > > I realize that it is possible I have made a mistake in posing the > > problem to Mathematica; if so, please enlighten me. > > > > prob2[given]={\[ScriptCapitalN][3600]\[Equal](3600*Circle)/Minute, > > BT[max,3600]\[Equal](236*Meter*Newton)/Radian,\[ScriptCapitalN][ > > > > 5500]\[Equal](5500*Circle)/Minute,BP[max,5500]\[Equal]100*Kilo*Watt, > > > > z\[Equal](2*Circle)/Cycle,Vd\[Equal]3*Liter,\[Eta][mech]\[Equal]9/10, > > sfc\[Equal](9*Kilogram)/(100*Joule*Mega), > > LHV\[Equal](44*Joule*Mega)/Kilogram,CR\[Equal]89/10,k\[Equal]7/5} > > > > prob2[defineqns]= > > Most@{BP[max,3600]\[Equal]BT[max,3600]*\[ScriptCapitalN][3600], > > BP[max,5500]\[Equal]BT[max,5500]*\[ScriptCapitalN][5500], > > BMEP[max,3600]\[Equal](2*Pi*Radian*z*BT[max,3600])/(Circle*Vd), > > BMEP[max,3600]/IMEP[max,3600]\[Equal]\[Eta][mech], > > BMEP[max,5500]\[Equal](2*Pi*Radian*z*BT[max,5500])/(Circle*Vd), > > BMEP[max,5500]/IMEP[max,5500]\[Equal]\[Eta][mech],\[Eta][ > > > > ind]\[Equal]1/(LHV*sfc),\[Eta][otto]\[Equal]1-(CR^(-1))^(-1+k)} > > > > prob2[units]={Circle,Cycle,Joule,Kilo,Kilogram,Liter,Mega,Meter,Minute, > > Newton, > > Radian,Watt} > > > > prob2[redvars]={CR,k,LHV,sfc,Vd,z,BMEP[max,3600],BMEP[max,5500],BP[max, > > 3600], > > BP[max,5500],BT[max,3600],BT[max,5500],IMEP[max,3600], > > > > IMEP[max,5500],\[ScriptCapitalN][3600],\[ScriptCapitalN][5500],\[Eta][ > > ind],\[Eta][mech],\[Eta][otto]} > > > > prob2[numsoln]= > > Refine[Reduce[Flatten@{prob2[given],prob2[defineqns]},prob2[redvars], > > Backsubstitution->True],#!=0&/@prob2[units]] > > > > Regards, > > -- > > Chris Chiasson > > Kettering University > > Mechanical Engineering > > Graduate Student > > 1 810 265 3161 > > In my opinion it is a bad idea to use Reduce in such cases. Reduce > attempts to give you a "complete solution", which will means it will > try to obtain all conditions on your parameters and variables and while > doing so it may try to use algorithms such as Cylindrical Algebraic > Decomposition (for some strange reason renamed in Mathematica 5.1 as > CylindircalDecomposition) or Quantifier Elimination which have very > high complexity in the naumber of variables. The result is that Reduce > may take a very long time to deal with expressions involving many > unknowns, even if they are actually very simple ones. Actually, on my 1 > Gigaherz Powerbook G4 I can't get an answer to your system in > reasonable time even if Most is present. > > However, I think the way to deal with your system is by using Solve and > not Reduce. The problem is that you can't use Solve directly, because > it will notice "not algebraic equations" in your system and without > checking that actually the variables in which the equations are > non-algebraic can be easily eliminated, Solve will refuse to proceed > further. The way to avoid this is to tell Solve to eliminate these > variables as follows: > > prob2[numsoln] = Solve[Flatten[{prob2[given], prob2[defineqns]}], > prob2[redvars], First /@ prob2[given]] > > {{BP[max, 3600] -> (849600*Circle*Meter*Newton)/(Minute*Radian), > ç[otto] -> 1 - (10/89)^(2/5), > BP[max, 5500] -> 100*Kilo*Watt, ç[ind] -> 25/99, > \[ScriptCapitalN][3600] -> (3600*Circle)/Minute, > \[ScriptCapitalN][5500] -> (5500*Circle)/Minute, BMEP[max, 3600] -> > (944*Meter*Newton*Pi)/(3*Cycle*Liter), > BMEP[max, 5500] -> > (4*Kilo*Minute*Pi*Radian*Watt)/(165*Circle*Cycle*Liter), > IMEP[max, 3600] -> (9440*Meter*Newton*Pi)/(27*Cycle*Liter), > IMEP[max, 5500] -> > (8*Kilo*Minute*Pi*Radian*Watt)/(297*Circle*Cycle*Liter), > BT[max, 5500] -> (Kilo*Minute*Watt)/(55*Circle), LHV -> > (44*Joule*Mega)/Kilogram, > BT[max, 3600] -> (236*Meter*Newton)/Radian, sfc -> > (9*Kilogram)/(100*Joule*Mega), Vd -> 3*Liter, > z -> (2*Circle)/Cycle}} > > There may be some other reason why you wanted to use Reduce, but the > above seems to me to give as complete an answer as you could hope to > get. > > > Andrzej Kozlowski > Chiba, Japan > http://www.akikoz.net/andrzej/index.html > http://www.mimuw.edu.pl/~akoz/ > > -- Chris Chiasson Kettering University Mechanical Engineering Graduate Student 1 810 265 3161

**References**:**Reduce bug report***From:*Chris Chiasson <chris.chiasson@gmail.com>