Re: Solution of this equation
- To: mathgroup at smc.vnet.net
- Subject: [mg20728] Re: Solution of this equation
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Wed, 10 Nov 1999 00:17:43 -0500
- Organization: Wolfram Research, Inc.
- References: <7vrc3p$2nd@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Dave Richardson wrote: > > Can anyone offer insight here? > > This Mathematica expression gives 3 solutions to the equation. > > Solve[Pr == (8*Tr)/(3*vr - 1) - 3/vr^2, vr] > > The problem is that there are 3 Real solutions, and Mathematica is giving > solutions with (granted a small) imaginary component. > > And hitting it with a full simplify is just not a good idea... > > Any help? > > Thanks, > > Dave! > > -- > Dave Richardson > University of Maryland > Department of Mechanical Engineering > Center for Environmental Energy Engineering > (301) 405-8726 > dhr at glue.umd.edu It may be useful to express the result in terms of Root[...] objects rather than radicals, as the latter of necessity must be expressed in terms of Sqrt[-1] for generic cases. To get Root solutions one uses SetOptions. In[21]:= SetOptions[Roots, Cubics->False]; In[22]:= soln = Solve[Pr == (8*Tr)/(3*vr - 1) - 3/vr^2, vr] 2 2 3 Out[22]= {{vr -> Root[-3 + 9 #1 - Pr #1 - 8 Tr #1 + 3 Pr #1 & , 1]}, 2 2 3 > {vr -> Root[-3 + 9 #1 - Pr #1 - 8 Tr #1 + 3 Pr #1 & , 2]}, 2 2 3 > {vr -> Root[-3 + 9 #1 - Pr #1 - 8 Tr #1 + 3 Pr #1 & , 3]}} An advantage is that now you get solutions that are known to be explicitly real when appropriate values for Pr and Tr are used. In[28]:= vals = vr /. (soln /. {Tr->-8/3, Pr->5/4}) Out[28]= {Root[-36 + 108 #1 + 241 #1 + 45 #1 & , 1], 2 3 > Root[-36 + 108 #1 + 241 #1 + 45 #1 & , 2], 2 3 > Root[-36 + 108 #1 + 241 #1 + 45 #1 & , 3]} In[31]:= Map[Im, vals] Out[31]= {0, 0, 0} In[32]:= N[vals] Out[32]= {-4.82362, -0.752372, 0.220437} It is also typically faster and more accurate to compute numerical values for solutions expressed as algebraic numbers rather than in terms of radicals. Daniel Lichtblau Wolfram Research