MathGroup Archive 2008

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

Search the Archive

Re: Re: Extracting the value from Solve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85801] Re: [mg85790] Re: Extracting the value from Solve
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Fri, 22 Feb 2008 07:26:41 -0500 (EST)
  • References: <fphcce$8c8$1@smc.vnet.net> <200802221005.FAA02808@smc.vnet.net>

This method, although popular with beginners, should not be encouraged  
by experienced Mathematica users, as it will result in confusing error  
messages in cases of equations with no solutions and equations where  
every complex is a solution:

In[44]:= Solve[x == x, x][[1,1,2]]
During evaluation of In[44]:= Part::partw:Part 1 of {} does not exist.  
 >>
Out[44]= {{}}[[1,1,2]]


In[45]:= Solve[x + 1 == x][[1,1,2]]
During evaluation of In[45]:= Part::partw:Part 1 of {} does not exist.  
 >>
Out[45]= {}[[1,1,2]]

Andrzej Kozlowski


On 22 Feb 2008, at 11:05, David Park wrote:

> There a lots of ways that you will hear about. Here is one:
>
> Solve[Tan[45*Degree]*
>    x + (Sin[108.25718805973634]*(-Sqrt[(-0.425185)^2 + 0.843815^2]))/
>    Sin[135*Degree] == 0, x]
> Part[%, 1, 1, 2]
> 1.32538
>
> -- 
> David Park
> djmpark at comcast.net
> http://home.comcast.net/~djmpark/
>
>
> "Lea Rebanks" <lrebanks at netvigator.com> wrote in message
> news:fphcce$8c8$1 at smc.vnet.net...
>> Hi All,
>>
>> After evaluating the following .
>>
>> Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]*
>>           (-Sqrt[(-0.425185)^2 + 0.843815^2]))/
>>        Sin[135*Degree] == 0, x]
>> {{x -> 1.3253773537632034}}
>>
>> I wish to extract the value only .  1.3253773537632034
>>
>> Any advice or help gratefully received.
>>
>> Many thanks.
>> Best Regards - Lea Rebanks...
>>
>>
>
>



  • Prev by Date: Re: Getting the View I want from ListPlot3D and Show
  • Next by Date: Re: Constraint visualization
  • Previous by thread: Re: Extracting the value from Solve
  • Next by thread: Vector file out of Mathematica?