MathGroup Archive 2006

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

Search the Archive

Re: Problem plotting high-order Laguerre polynomials

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63864] Re: Problem plotting high-order Laguerre polynomials
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 20 Jan 2006 04:32:18 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <dqn7br$l3v$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

a) Plot[] need an evaluate around the full 
argument, i. e.

Plot[Evaluate[func] /. n -> 40, {q, 0, 30}, 
PlotRange -> All]

  is use less, because Plot[] need the Evaluate[] 
and not
  ReplaceAll[]

b) try a higher precision with
func[n_Integer, qin_?NumericQ] :=
  With[{q = SetPrecision[qin, 200]}, 1/Pi Exp[- 
q^2] LaguerreL[n, 2 q^2]
  ]

Plot[func[40, q], {q, 0, 30}, PlotRange -> All]

Regards

  Jens

"Elinor K. Irish" <eirish at pas.rochester.edu> 
schrieb im Newsbeitrag 
news:dqn7br$l3v$1 at smc.vnet.net...
| Hi folks,
| I'm doing some work which involves plotting 
fairly high-order Laguerre
| polynomials, up to 200 or so.  I've been getting 
some very strange and
| obviously incorrect results which seem to have 
to do with the order of
| evaluation.  (I'm using Mathematica 5.0, but 
I've checked it in 5.2 and I
| get the same problems.)  Here are some examples 
with a simple form of the
| type of function I'm working with:
|
| func = 1/Pi Exp[- q^2] LaguerreL[n, 2 q^2]
|
| These commands work, displaying the expected 
oscillatory result:
|
| Plot[func /. n -> 40, {q, 0, 30}, PlotRange -> 
All]
| Plot[Evaluate[func] /. n -> 40, {q, 0, 30}, 
PlotRange -> All]
|
| This form, however, results in a big mess which 
isn't even bounded correctly:
|
| Plot[Evaluate[func /. n -> 40], {q, 0, 30}, 
PlotRange -> All]
|
| I don't know whether this is a bug or if there's 
a subtlety of
| Plot/Evaluate/etc. which I don't understand.  I 
would very much like to be
| able to use Evaluate on my functions before 
plotting them, because my
| actual calculations involve complicated sums 
over expressions like that
| above and take a LONG time to plot.  (With 
Evaluate, a single plot takes
| about 20 minutes; without it the same plot takes 
nearly 4 hours.)
|
| Could anyone shed some light on this problem?  I 
have more examples,
| including some involving sums, which I can give 
if needed.  I've been
| fighting with this issue for a long time...
|
| Thanks,
| Elinor
|
|
|
| ______________________________
| Elinor K. Irish
| Dept. of Physics and Astronomy
| University of Rochester
| Rochester, NY  14627 USA
| eirish at pas.rochester.edu
| 



  • Prev by Date: Re: NIntegrate and Plot
  • Next by Date: Re: Question regarding replacement
  • Previous by thread: Re: Problem plotting high-order Laguerre polynomials
  • Next by thread: Re: Problem plotting high-order Laguerre polynomials