underactuated.plot_utils

underactuated.plot_utils.plot_2d_phase_portrait(f, x1lim=(-1, 1), x2lim=(-1, 1), n=100j, **kwargs)

Plots the phase portrait for a 2D dynamical system.

Parameters:
  • f (System | Callable[[float], float]) – Callable vectorized function which implements the rhs of the state-space dynamics xdot = f(x), with x 2D array.

  • x1lim (Tuple[float]) – Minimum and maximum values (floats) for the horizontal axis of the plot.

  • x2lim (Tuple[float]) – Minimum and maximum values (floats) for the vertical axis of the plot.

  • n (complex) – Purely imaginary number with imaginary part equal to the number of knot points on each axis of the plot.

  • kwargs – Additional arguments to pass to matplotlib.pyplot.streamplot.