logistic: The Logistic Growth Model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/logistic.R

Description

The derivative function of the logistic growth model, an example of a two-dimensional autonomous ODE system.

Usage

1
logistic(t, y, parameters)

Arguments

t

The value of t, the independent variable, to evaluate the derivative at. Should be a single number.

y

The value of y, the dependent variable, to evaluate the derivative at. Should be a single number.

parameters

The values of the parameters of the system. Should be a vector with parameters specified in the following order: β, K.

Details

logistic evaluates the derivative of the following ODE at the point (t, y):

dy/dt = βy(1 - y/K).

Its format is designed to be compatible with ode from the deSolve package.

Value

Returns a list containing the value of the derivative at (t, y).

Author(s)

Michael J. Grayling

See Also

ode

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Plot the velocity field, nullclines and several trajectories
logistic.flowField     <- flowField(logistic,
                                    xlim = c(0, 5),
                                    ylim = c(-1, 3),
                                    parameters = c(1, 2),
                                    points = 21,
                                    system = "one.dim",
                                    add = FALSE)
logistic.nullclines    <- nullclines(logistic,
                                     xlim = c(0, 5),
                                     ylim = c(-1, 3),
                                     parameters = c(1, 2),
                                     system = "one.dim")
logistic.trajectory    <- trajectory(logistic,
                                     y0 = c(-0.5, 0.5, 1.5, 2.5),
                                     tlim = c(0, 5),
                                     parameters = c(1, 2),
                                     system = "one.dim")
# Plot the phase portrait
logistic.phasePortrait <- phasePortrait(logistic,
                                        ylim = c(-0.5, 2.5),
                                        parameters = c(1, 2),
                                        points = 10,
                                        frac = 0.5)
# Determine the stability of the equilibrium points
logistic.stability.1   <- stability(logistic,
                                    ystar = 0,
                                    parameters = c(1, 2),
                                    system = "one.dim")
logistic.stability.2   <- stability(logistic,
                                    ystar = 2,
                                    parameters = c(1, 2),
                                    system = "one.dim")

phaseR documentation built on Aug. 20, 2018, 5:03 p.m.