[Date Index]
[Thread Index]
[Author Index]
Re: Re: sorting list of roots af a transcendental function
*To*: mathgroup at smc.vnet.net
*Subject*: [mg65287] Re: [mg65263] Re: sorting list of roots af a transcendental function
*From*: János <janos.lobb at yale.edu>
*Date*: Fri, 24 Mar 2006 00:59:44 -0500 (EST)
*References*: <dvrcdq$a6i$1@smc.vnet.net> <200603231158.GAA07742@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
On Mar 23, 2006, at 6:58 AM, Roger Bagula wrote:
> Dule wrote:
>> Dear group,
>>
>> for calculating a model i need values for x which are given by the
>> transcendental function Cot[x] == x/a - a/(4*x). a is a parameter
>> 0<a<200.
>> i obtained the roots with Table and FindRoot:
>> Table[FindRoot[Cot[x] == x/a - a/(4*x), {x, i}], {i, 1, 50}]]
>>
>> I have two questions:
>> 1. Is there a better way to do this?
>> 2. How can i construct a list, where the values for x, which appear
>> multiple are dropped?
>>
>> Thanks!
>>
>
> I have a similar question of my own:
> I want to get the weights where this equation has largest roots
> equal to
> integers:g^3-g-w[n]=0
> for prime weights:
> w[n]=Prime[n]
>
> b = Table[Table[x /. NSolve[x^3 - x - Prime[n] - 1 == 0.x][[m]],
> {m, 1,
> 3}], {n, 1, 10}]
> MatrixForm[b]
> c = Table[{n, Max[Table[Abs[x] /. Solve[x^3 - x -
> Prime[n] - 1 == 0.x][[m]], {m, 1, 3}]]}, {n, 1, 20}]
> ListPlot[c]
>
> This doersn't work: it doesn't see them as Integers:
> d = Flatten[Table[{n, If [IntegerQ[
> Max[Table[Abs[x] /.
> Solve[x^3 -
> x - Prime[n] - 1 == 0.x][[m]], {m, 1, 3}]]], Max[
> Table[Abs[x] /. Solve[x^3 - x - Prime[n] - 1 ==
> 0.x][[
> m]], {m, 1, 3}]], {}]}, {n, 1, 20}], 1]
>
> That is in:
> {{1, 1.6717}, {2, 1.79632}, {3, 2.}, {4, 2.16631}, {5,
> 2.43484}, {6, 2.5483}, {7, 2.74784}, {8, 2.83714}, {9,
> 3.}, {10, 3.21447}, {11, 3.27976}, {12, 3.4611}, {13,
> 3.5719}, {14, 3.62475}, {15, 3.72594}, {16, 3.86794}, {
> 17, 4.}, {18, 4.0421}, {19, 4.16331}, {20, 4.24028}}
>
> I want output ( integer weights separated out):
> { {3, 2}, {9, 3}, {17, 4}}
Here is a newbie approach:
In[1]:=
lst = {{1, 1.6717},
{2, 1.79632}, {3, 2.},
{4, 2.16631},
{5, 2.43484},
{6, 2.5483},
{7, 2.74784},
{8, 2.83714}, {9, 3.},
{10, 3.21447},
{11, 3.27976},
{12, 3.4611},
{13, 3.5719},
{14, 3.62475},
{15, 3.72594},
{16, 3.86794}, {17, 4.},
{18, 4.0421},
{19, 4.16331},
{20, 4.24028}};
In[2]:=
Select[lst,
FractionalPart[#1[[2]]] ==
0 & ]
Out[2]=
{{3, 2.}, {9, 3.}, {17, 4.}}
---------------------------------------------
It is a "hard slug" to kill terrorists.
Here is an easier method to kill them.
1. First kill all the non-terrorists, - children, women, the
elderly -, because that is a piece of cake. That will be just
"collateral demage".
2. Kill the rest of it. Now that is easy because you do not have to
worry about the innocent any more.
Prev by Date:
**Re: Re: A question concerning Show and PlotLegend**
Next by Date:
**Re: A question concerning Show and PlotLegend**
Previous by thread:
**Re: sorting list of roots af a transcendental function**
Next by thread:
**Re: sorting list of roots af a transcendental function**
| |