phasePortrait: Phase Portrait

Description Usage Arguments Details Value Examples

Description

Plot a phase portrait of a dynamical system that includes the vector field, nullclines, example trajectories, and the identification and classification of equilibria.

Usage

1
2
3
4
phasePortrait(qE, pars, func = fs2D, x.lim = c(0, 2000), y.lim = c(0,
  100), add = FALSE, nFlow = 20, nNull = 300, t.end = 50,
  inits = matrix(c(1, 90, 200, 20, 800, 20, 500, 50, 1000, 80), byrow = TRUE,
  ncol = 2), addLeg = FALSE, legPos = "topright")

Arguments

qE

numeric scalar for harvest

pars

optional named numeric vector for additional parameters to be passed to func

func,

function that returns local derivatives, defaults to fs2D, which is just a formatting wrapper for fishStep2D; currently only works for default due to use of getRoot2D_df in stabClass

x.lim, y.lim

minimum and maximum values for each of the two states variables to be used when plotting and searching for equilibria

add

local, if FALSE (default) makes a new plot

nFlow

square root of the number of arrows to draw in the vector field

nNull

numeric scalar, number of points used in drawing the nullclines

t.end

number of time steps (in model time units) to use when simulating the trajectories

inits

matrix of initial values to use for trajectories

addLeg

if TRUE, adds a legend

legPos

character position of legend; see graphics::legend

Details

This function is largely a wrapper for phaseR::flowField, phaseR::trajectory, phaseR::nullclines, and phaseR::stability. This function does not call phaseR::stability directly, and instead uses stabClass.

Value

a data.frame with stability information; see stabClass

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# shortInits <- eval(formals(phasePortrait)$inits)[1:3,]
# pars <- c(q=8,s=0.7,h=0.15, b=0.001)
qEvals <- c(0.2, 0.5, 1, 1.25)
par(mfrow=c(2,2), mar=c(2,2,1,0.5), mgp=c(1,0.25,0), tcl=-0.15, cex=1, ps=9, cex.axis=0.85)
for(j in 1:4){
	(phasePortrait(
		qE=qEvals[j], pars=NULL,
		nFlow=5, nNull=5,t.end=5,
		addLeg=TRUE
	))
}

cboettig/bs-tipping documentation built on May 5, 2019, 7:08 a.m.