mappy_ds.PoincareMap#

class mappy_ds.PoincareMap(modes, transitions, initial_mode, end_modes=None, *, max_transitions=1000)#

Poincaré map of a hybrid system described by modes and transitions.

Starting in initial_mode, the state is evolved mode by mode following transitions until one of the end_modes is reached; that is one iteration of the map. The Jacobian and Hessian are composed with the chain rule along the way.

Parameters:
modessequence of Mode

All modes of the system, with distinct names.

transitionsmapping

Successor of each mode. The value is

  • a mode name (str) for a discrete mode, a borderless continuous mode (which ends at max_interval) or, as a shorthand, a continuous mode with a single border;

  • a list of mode names, one per border in the order of borders;

  • a mapping {border_name: mode_name} covering every border of the mode (see the name argument of border()).

Only modes reachable from initial_mode need a rule.

initial_modestr

Mode the map starts in (the Poincaré section).

end_modesstr or sequence of str, optional

Modes that terminate one iteration, by default initial_mode.

max_transitionsint, optional

Safety bound on the number of mode transitions per iteration, by default 1000.

Raises:
UnknownModeError

If a mode name in transitions, initial_mode or end_modes is not among modes.

TransitionError

If a rule does not match its mode (wrong number of entries, unknown or missing border name), if a mode reachable from initial_mode has no rule, if the codomain of a mode and the domain of its successor have different dimensions, or if no end mode can be reached from initial_mode.

Examples

See mappy_ds for a complete example.

Properties

dim

Dimension of the domain (and codomain) of the map.

param_keys

Names of all parameters the map depends on.

Methods

image(y0[, params, n, mode])

Compute the n-th image of y0.

image_detail(y0[, params, n, jacobian, ...])

Compute the n-th image of y0 with derivatives.

trajectory(y0[, params, n, mode])

Compute the trajectory from y0 over n iterations.