Re: sorting list of roots af a transcendental function
- To: mathgroup at smc.vnet.net
- Subject: [mg65272] Re: [mg65260] sorting list of roots af a transcendental function
- From: Pratik Desai <pdesai1 at umbc.edu>
- Date: Thu, 23 Mar 2006 06:58:31 -0500 (EST)
- References: <200603221113.GAA10232@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? > > Perhaps if you break up your code, the data set may be easier to handle/understand Clear[expr,rootsinit,x,a] expr[x_,a_]=Cot[x] == x/a - a/(4*x) rootsinit[i_,a_]:=x/.FindRoot[expr[x,a],{x,i}] TableForm[Table[rootsinit[1,a],{a,1,20}],TableHeadings->Automatic] Here one may fix the initial point in the root search and find different roots for different values of a >2. How can i construct a list, where the values for x, which appear >multiple are dropped? > > Union can get rid of the "repeating roots" for different initial points with a fixed Table[rootsinit[i,3],{i,1,20}]//Union >Thanks! > > > Hope this helps Pratik Desai Wolfram Research
- References:
- sorting list of roots af a transcendental function
- From: Dule <dule23@gmx.de>
- sorting list of roots af a transcendental function