I have a bit of trouble with Mathematica and it's plotting stuff. I tried to plot Jacobi amplitude function:
JacobiAmplitude[Sqrt[0.1]*x, 10], {x, 0, 50}]
but the result leaves gaps where the roots of the function should be (particularly for this function around x = 3, 6, 10, ...). I've done a bit of googling and found that either Exclusions set to None or raising PlotPoints should help. Well, it didn't. I even tried to set MaxRecursion to 8, PlotPoints to one million, waited several hours for the plot and it didn't change. Funny thing is, that when I added Mesh -> None, I've found out, that mathematica added plot points even at the gaps, but it didn't join them with lines! This is something like bug, or how should I deal with that? Any help'd be appreciated.
P.S.: I'm using Mathematica 9.0
Answer
There's a small but nontrivial complex part to the value being plotted that arises from using MachinePrecision numbers for plotting. Use arbitrary precision numbers by setting the WorkingPrecision to a suitable value.
Plot[JacobiAmplitude[Sqrt[0.1]*x, 10], {x, 0, 50}, WorkingPrecision -> 10]

Or, Szbolcs' points out, one can apply Chop orRe to your function, which will be faster, if you are certain your function is real-valued.
Comments
Post a Comment