Message Boards Message Boards


Ploting LegendreP gets abruptly noisy for larger numbers?

Posted 3 months ago
5 Replies
1 Total Likes

Hi there,

I'm trying to plot the graph for LegendreP[70+3/2,3/2,x] for x between -1 to 1.

But it looks very bad. if ones try it for 60+3/2 it looks good. Why does it happen, and is there something to do about it?


5 Replies

Version? Mathematica or WolframAlpha? Code to plot?

Plot[LegendreP[70 + 3/2, 3/2, x], {x, -1, 1}, PlotPoints -> 100]

enter image description here

seems fine for Mathematica V12.2 MacOS.

Posted 3 months ago

it is Mathematica 12.0.

The code I use to plot is: Plot[LegendreP[70 + 3/2, -3/2, x], {x, -1, 1}, ]

Look at my attachment. for n=65+3/2 it already show some noise. But for n=70+3/2 it is complete garbage. I tried using PlotPoints with a big number (4000) but it will not help.

Note: I had a typo in the legendre order: it is minus 3/2.

What do you think? Is there a way to plot larger and larger degrees of the LegendreP?





Machine-precision might not be enough. But can easily be solved by using more precision, e.g.:

Plot[LegendreP[70 + 3/2, 3/2, x], {x, -1, -0.9}, WorkingPrecision -> 30, PlotPoints -> 100]
Posted 3 months ago

Yes! it definitely gets the job done. Thank you!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract