control.phaseplot.streamlines

control.phaseplot.streamlines(sys, pointdata, timedata=1, gridspec=None, gridtype=None, dir=None, ax=None, _check_kwargs=True, suppress_warnings=False, **kwargs)[source]

Plot stream lines in the phase plane.

This function plots stream lines for a two-dimensional state space system.

Parameters
sysNonlinearIOSystem 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.

pointdatalist 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.

timedataint 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.

gridtypestr, 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.

gridspeclist, 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.

dirstr, optional

Direction to draw streamlines: ‘forward’ to flow forward in time from the reference points, ‘reverse’ to flow backward in time, or ‘both’ to flow both forward and backward. The amount of time to simulate in each direction is given by the timedata argument.

paramsdict or list, 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).

colorstr

Plot the streamlines in the given color.

axmatplotlib.axes.Axes, optional

Use the given axes for the plot, otherwise use the current axes.

Returns
outlist of Line2D objects
Other Parameters
arrowsint

Set the number of arrows to plot along the streamlines. The default value can be set in config.defaults['phaseplot.arrows'].

arrow_sizefloat

Set the size of arrows to plot along the streamlines. The default value can be set in config.defaults['phaseplot.arrow_size'].

arrow_stylematplotlib patch

Set the style of arrows to plot along the streamlines. The default value can be set in config.defaults['phaseplot.arrow_style'].

rcParamsdict

Override the default parameters used for generating plots. Default is set by config.defaults['ctrlplot.rcParams'].

suppress_warningsbool, optional

If set to True, suppress warning messages in generating trajectories.