View source: R/phasePortrait.R
phasePortrait | R Documentation |
For a one-dimensional autonomous ODE, it plots the phase portrait, i.e., the derivative against the dependent variable. In addition, along the dependent variable axis it plots arrows pointing in the direction of dependent variable change with increasing value of the independent variable. From this stability of equilibrium points (i.e., locations where the horizontal axis is crossed) can be determined.
phasePortrait( deriv, ylim, ystep = 0.01, parameters = NULL, points = 10, frac = 0.75, arrow.head = 0.075, col = "black", add.grid = TRUE, state.names = "y", xlab = state.names, ylab = paste0("d", state.names), ... )
deriv |
A function computing the derivative at a point for the ODE
system to be analysed. Discussion of the required structure of these
functions can be found in the package vignette, or in the help file for the
function |
ylim |
Sets the limits of the dependent variable for which the
derivative should be computed and plotted. Should be a
|
ystep |
Sets the step length of the dependent variable vector for which
derivatives are computed and plotted. Decreasing |
parameters |
Parameters of the ODE system, to be passed to |
points |
Sets the density at which arrows are plotted along the
horizontal axis; |
frac |
Sets the fraction of the theoretical maximum length line
segments can take without overlapping, that they actually attain. Fine
tuning here assists the creation of aesthetically pleasing plots. Defaults
to |
arrow.head |
Sets the length of the arrow heads. Passed to
|
col |
Sets the colour of the line in the plot, as well as the arrows.
Should be a |
add.grid |
Logical. If |
state.names |
The state names for |
xlab |
Label for the x-axis of the resulting plot. |
ylab |
Label for the y-axis of the resulting plot. |
... |
Additional arguments to be passed to either plot or arrows. |
Returns a list with the following components:
add.grid |
As per input. |
arrow.head |
As per input. |
col |
As per input, but with possible editing if a
|
deriv |
As per input. |
dy |
A |
frac |
As per input. |
parameters |
As per input. |
points |
As per input. |
xlab |
As per input. |
y |
A |
ylab |
As per input. |
ylim |
As per input. |
ystep |
As per input. |
Michael J Grayling
arrows
, plot
# A one-dimensional autonomous ODE system, example2. example2_phasePortrait <- phasePortrait(example2, ylim = c(-0.5, 2.5), points = 10, frac = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.