|
[Date Index]
[Thread Index]
[Author Index]
Re: solve output "problem"
- To: mathgroup at smc.vnet.net
- Subject: [mg59017] Re: solve output "problem"
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Wed, 27 Jul 2005 01:24:39 -0400 (EDT)
- Organization: The Open University, Milton Keynes, U.K.
- References: <dc4qtj$gc$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Selina wrote:
> Dear all,
>
> I have a (possibly simple) problem interpreting the output of Solve. I am solving two nonlinear equations, and I get a list of several solutions, each of which are huge equations, which should be functions of my parameters. Anyway, I am not sure how to describe the problem but the output of Solve involves the following: #1, #1^2, .....,#1^6, along with everything else, and at the end there is an & symbol--something like "&, 2]" at the end of the second solution, "&, 6]" at the end of the 6th solution etc. What might be the reason why the output looks like this, and is there a way to convert this to a "normal" equation (without the #1's etc.)?
>
> Any help would be appreciated, thanks a lot in advance.
>
Hi Selina,
Nothing wrong here! What you describe are *Root* objects indeed. To
simplify, say that *Root* object are return by Mathematica when a
representation by radicals is not possible or suitable. Check the
following link to get more information on *Root*:
http://documents.wolfram.com/mathematica/functions/Root
If you want to get the numerical values of the roots you can use the *N*
function as in the following example:
In[1]:=
sol = Solve[12*x^6 + x^5 + x^4 + x^3 + x^2 + x + 1 == 0, x]
Out[1]=
{{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 1]},
{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 2]},
{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 3]},
{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 4]},
{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 5]},
{x -> Root[1 + #1 + #1^2 + #1^3 + #1^4 + #1^5 + 12*#1^6 & , 6]}}
In[2]:=
N[sol]
Out[2]=
{{x -> -0.5453555634611259 - 0.2914497675343159*I}, {x ->
-0.5453555634611259 + 0.2914497675343159*I},
{x -> -0.062108548412449206 - 0.6408375854434267*I},
{x -> -0.062108548412449206 + 0.6408375854434267*I}, {x ->
0.5657974452069084 - 0.4534779427766154*I},
{x -> 0.5657974452069084 + 0.4534779427766154*I}}
You can also try *ToRadicals* if you prefer the roots to be expressed in
radical form (but that does not always work).
Best regards,
/J.M.
Prev by Date:
Re: Problem with loading SuperWidgetPackage
Next by Date:
Re: VersionHistory[ commandName] would be nice (was Mathematica 5.2: The 64-bit and...)
Previous by thread:
Re: solve output "problem"
Next by thread:
Re: solve output "problem"
|