I've seen the Wolfram Poincaré example.
I'd like to modify this sample in order to have a list of Poincaré maps. In the example the event is captured only when Mod[t, 2 Pi] == 0
. I want to create a map of angles (0, Pi/2, Pi, 3 Pi/2, 2Pi for example) and create the Poincaré for every angle, in order to create an animation showing the map for every angle.
Obviously I can create data for every angle, putting the the example inside a Table
command and varying the angle, but it seems a waste of time, because I must perform NDSolve
every time.
Instead it can be helpful to find a way to use NDSolve
only once and save directly the list of data for all angles that I want.
I've tried to change Mod[t, 2 Pi] == 0
to Mod[t, 2 Pi] == 0 || Mod[t, Pi] == 0
, because I wanted to create a unique list, check it's length and then rearraing data in some way in order to obtain the map list, but I obtain the following error
Part::partw: "Part 1 of {} does not exist.
And data is
{{{}}, {}}[[-1, 1]]
Why I obtain this error and how can I have different sections using NDSolve
only once?