MathGroup Archive 2006

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

Search the Archive

Re: sorting list of roots af a transcendental function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65263] Re: sorting list of roots af a transcendental function
  • From: Roger Bagula <rlbagulatftn at yahoo.com>
  • Date: Thu, 23 Mar 2006 06:58:21 -0500 (EST)
  • References: <dvrcdq$a6i$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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}}


  • Prev by Date: Re: sorting list of roots af a transcendental function
  • Next by Date: Re: How to sample a 2-dim. r.v. with known density function?
  • Previous by thread: Re: sorting list of roots af a transcendental function
  • Next by thread: Re: Re: sorting list of roots af a transcendental function