Unexpected behavior of `Exclusions` in `ParametricPlot`
Why not plot the phase space with the true topology?
ParametricPlot3D[{50 Cos[ϕsol1[t]], 50 Sin[ϕsol1[t]], ϕsol1'[t]}, {t, tmax/10, tmax},
PlotPoints -> 1000, PlotStyle -> Thin]
You don't need Exclusion
at all. Plot of Mod shows it.
Plot[ Mod[t, 2 π, -Pi], {t, 20, 30}]
ParametricPlot[{Mod[ϕsol1[t], 2 π, -π], ϕsol1'[
t]}, {t, 20, 30}, AspectRatio -> 1/GoldenRatio,
AxesLabel -> {ϕ,
\!\(\*OverscriptBox[\(ϕ\), \(.\)]\)}, ImageSize -> 300,
PlotPoints -> 100, PlotStyle -> Thin]
But i think, there is also a problem with accuracy. Compare standart and high precision NDSolve (Since i'm working with Version 8.0, used NDSolve instead of NDSolveValue).
You can not trust result for t > about 10.
ϕsol1 = ϕ /.
First@NDSolve[{DDPeq /.
paramvals, ϕ[0] == -π/2, ϕ'[0] == 0}, ϕ, {t,
tmax/10, tmax}, MaxSteps -> 10^5]
ϕsol1a = ϕ /.
First@NDSolve[{DDPeq /.
paramvals, ϕ[0] == -π/2, ϕ'[0] == 0}, ϕ, {t,
0, 20}, MaxSteps -> 10^6, WorkingPrecision -> 55,
AccuracyGoal -> 25, PrecisionGoal -> 25, MaxStepSize -> 10^-3]
Plot[{ϕsol1[t], ϕsol1'[t]}, {t, 0, 20},
AspectRatio -> 1/GoldenRatio, AxesLabel -> {ϕ,
\!\(\*OverscriptBox[\(ϕ\), \(.\)]\)}, ImageSize -> 300,
PlotPoints -> 100, PlotStyle -> {Blue, Red}]
Plot[{ϕsol1a[t], ϕsol1a'[t]}, {t, 0, 20},
AspectRatio -> 1/GoldenRatio, AxesLabel -> {ϕ,
\!\(\*OverscriptBox[\(ϕ\), \(.\)]\)}, ImageSize -> 300,
PlotPoints -> 100, PlotStyle -> {Blue, Red}]
As @Akku14 notes, Mod
automatically triggers an Exclusion
, so no need to add it manually.
Maybe cranking up PlotPoints
or MaxRecursion
is just your best bet. I find this acceptable and it takes 12 seconds:
ParametricPlot[{Mod[ϕsol1[t], 2 π, -π], ϕsol1'[t]}, {t, tmax/10, tmax},
AspectRatio -> 1/GoldenRatio, PlotStyle -> Thin, MaxRecursion -> 12]
At least that's the only thing I can come up with!
I guess the wedges appear because ϕ
is changing more rapidly when ϕ'
is large, so a fixed time buffer around the exclusions translates into a larger gap.