Re: Re: Substitute values in functions!!!
- To: mathgroup at smc.vnet.net
- Subject: [mg52280] Re: [mg52255] Re: Substitute values in functions!!!
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 20 Nov 2004 03:42:04 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
j0[n_]:=FindRoot[BesselJ[0,x]==0,{x,n*2.5}]; Although not an issue in this specic application, finding Bessel zeros this way can result in duplicates j0/@Range[9]//InputForm {{x -> 2.404825557695773}, {x -> 5.52007811028631}, {x -> 8.653727912911013}, {x -> 8.653727912911013}, {x -> 11.791534439014281}, {x -> 14.930917708487787}, {x -> 18.071063967910924}, {x -> 18.071063967910924}, {x -> 18.071063967910924}} Using the add-on for Bessel zeros avoids the problem: Needs["NumericalMath`BesselZeros`"]; Thread[x->BesselJZeros[0, 9]]//InputForm {x -> 2.404825557695773, x -> 5.5200781102863115, x -> 8.653727912911013, x -> 11.791534439014281, x -> 14.930917708487787, x -> 18.071063967910924, x -> 21.21163662987926, x -> 24.352471530749305, x -> 27.493479132040253} Bob Hanlon > > From: Paul Abbott <paul at physics.uwa.edu.au> To: mathgroup at smc.vnet.net > Date: 2004/11/18 Thu AM 01:44:55 EST > To: mathgroup at smc.vnet.net > Subject: [mg52280] [mg52255] Re: Substitute values in functions!!! > > In article <cneu7f$q8j$1 at smc.vnet.net>, > davidx at x-mail.net (david Lebonvieux) wrote: > > > How can substitute some values(the zeros of BesselJ function) in this > > Integrals? > > j0[n_] := x /. FindRoot[BesselJ[0, x] == 0, {x, n 2.5}] > > Change this to > > j0[n_] := FindRoot[BesselJ[0, x] == 0, {x, n*2.5}] > > so that the result is a replacement rule instead of a value. > > > \!\(s\_l = Array[j0, \ 10]\) > > > > Integrate[BesselJ[0,s0*r/R] BesselJ[0,s2*r/R] BesselJ[0,s3*r/R],{r,0,R}] > > By a change of variables r -> R r, this integral becomes > > R Integrate[BesselJ[0,s0 r] BesselJ[0,s2 r] BesselJ[0,s3 r],{r,0,1}] > > > where s0, s1,s2,the Zero-Poles of BesselJ. > > Substitute the first three zeros into the integrand: > > Times @@ (BesselJ[0, x r] /. Array[j0, 3]) > > Compute the integral numerically: > > R NIntegrate[%, {r, 0, 1}] > > Cheers, > Paul > > -- > Paul Abbott Phone: +61 8 6488 2734 > School of Physics, M013 Fax: +61 8 6488 1014 > The University of Western Australia (CRICOS Provider No 00126G) > 35 Stirling Highway > Crawley WA 6009 mailto:paul at physics.uwa.edu.au > AUSTRALIA http://physics.uwa.edu.au/~paul > >