2
$\begingroup$

I just found out about the EquationTrekker package and its feature of being able to plot Poincaré sections. Now, I wonder how you can choose which Poincaré section to plot.

Consider the example in the documentation:

<< EquationTrekker`

EquationTrekker[{x''[t] + γ x'[t] - x[t] + x[t]^3 == ε Cos[ω t]}, x, {t, 1000, 10000},
                PlotRange -> {{-2, 2}, {-2, 2}},
                TrekParameters -> {γ -> .15, ε -> .3, ω -> 1.},
                TrekGenerator -> {PoincareSection, "SectionCondition" -> Mod[ω t, 2 π], 
                                  "SectionVariables" -> {x, x'}, MaxSteps -> ∞}]

I tried to change the "SectionCondition" to

Mod[ω t + angle, 2 π]

to get another cross-section for some angle between $0$ and $2\pi$, but no matter what angle I choose, the result is always the same.

$\endgroup$
0

1 Answer 1

2
$\begingroup$

Since EquationTrekker is deprecated, here is a simple Manipulate[] object for visualizing Poincaré sections of your DE for various initial conditions to start you off:

Manipulate[ListPlot[Function[{x0, xp}, 
                             Reap[NDSolve[{x''[t] + γ x'[t] - x[t] + x[t]^3 == ε Cos[ω t],
                                           WhenEvent[Mod[ω t + h, 2 π] == 0,
                                                     Sow[{x[t], x'[t]}]],
                                           x[0] == x0, x'[0] == xp}, {}, {t, 0, 50000},
                                          DependentVariables -> {x},
                                          MaxSteps -> ∞]][[-1, 1]]] @@@ pt, 
                    AspectRatio -> Automatic, Axes -> None, Frame -> True,
                    PlotRange -> {{-3, 3}, {-3, 3}}],
           {{pt, {{1, 1/2}}}, Locator, LocatorAutoCreate -> True},
           {{γ, 0.15}, 0., 0.3}, {{ε, 0.3}, 0, 0.6}, {{ω, 1.}, 0., 2.},
           {{h, 0.}, 0, 2π}, ContinuousAction -> None]

Poincaré GUI

Since the generation of a Poincaré sections can be rather slow, the idea is to adjust the sliders and the point representing the initial condition first before clicking on the tiny "u" button on the upper right to render the section. The use of LocatorAutoCreate will allow you to append additional initial points (through Alt+Click) for rendering another Poincaré section if needed.

This can be modified so that each initial condition can also have its independent set of parameters, but I'll leave that extension to somebody else.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.