control.phase_plane_plot
- control.phase_plane_plot(sys, pointdata=None, timedata=None, gridtype=None, gridspec=None, plot_streamlines=True, plot_vectorfield=False, plot_equilpoints=True, plot_separatrices=True, ax=None, **kwargs)[source]
Plot phase plane diagram.
This function plots phase plane data, including vector fields, stream lines, equilibrium points, and contour curves.
- Parameters
sys (NonlinearIOSystem or callable(t, x, ...)) – I/O system or function used to generate phase plane data. If a function is given, the remaining arguments are drawn from the params keyword.
pointdata (list or 2D array) – List of the form [xmin, xmax, ymin, ymax] describing the boundaries of the phase plot or an array of shape (N, 2) giving points of at which to plot the vector field.
timedata (int or list of int) – Time to simulate each streamline. If a list is given, a different time can be used for each initial condition in pointdata.
gridtype (str, optional) – The type of grid to use for generating initial conditions: ‘meshgrid’ (default) generates a mesh of initial conditions within the specified boundaries, ‘boxgrid’ generates initial conditions along the edges of the boundary, ‘circlegrid’ generates a circle of initial conditions around each point in point data.
gridspec (list, optional) – If the gridtype is ‘meshgrid’ and ‘boxgrid’, gridspec gives the size of the grid in the x and y axes on which to generate points. If gridtype is ‘circlegrid’, then gridspec is a 2-tuple specifying the radius and number of points around each point in the pointdata array.
params (dict, optional) – Parameters to pass to system. For an I/O system, params should be a dict of parameters and values. For a callable, params should be dict with key ‘args’ and value given by a tuple (passed to callable).
plot_streamlines (bool or dict) – If True (default) then plot streamlines based on the pointdata and gridtype. If set to a dict, pass on the key-value pairs in the dict as keywords to
streamlines()
.plot_vectorfield (bool or dict) – If True (default) then plot the vector field based on the pointdata and gridtype. If set to a dict, pass on the key-value pairs in the dict as keywords to
vectorfield()
.plot_equilpoints (bool or dict) – If True (default) then plot equilibrium points based in the phase plot boundary. If set to a dict, pass on the key-value pairs in the dict as keywords to
equilpoints()
.plot_separatrices (bool or dict) – If True (default) then plot separatrices starting from each equilibrium point. If set to a dict, pass on the key-value pairs in the dict as keywords to
separatrices()
.color (str) – Plot all elements in the given color (use plot_<fcn>={‘color’: c} to set the color in one element of the phase plot.
ax (Axes) – Use the given axes for the plot instead of creating a new figure.
- Returns
out – out[0] = list of Line2D objects (streamlines and separatrices) out[1] = Quiver object (vector field arrows) out[2] = list of Line2D objects (equilibrium points)
- Return type
list of list of Artists