Learn R Programming

phaseR (version 2.0)

vanDerPol: The Van Der Pol Oscillator

Description

The derivative function of the Van Der Pol Oscillator, an example of a two-dimensional autonomous ODE system.

Usage

vanDerPol(t, y, parameters)

Arguments

t

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

y

The values of and , the dependent variables, to evaluate the derivative at. Should be a vector of length two.

parameters

The values of the parameters of the system. Should be a single number prescribing the value of .

Value

Returns a list containing the values of the two derivatives at .

Details

vanDerPol evaluates the derivative of the following ODE at the point :

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

See Also

ode

Examples

Run this code
# NOT RUN {
# Plot the velocity field, nullclines and several trajectories.
vanDerPol.flowField         <- flowField(vanDerPol,
                                         xlim = c(-5, 5),
                                         ylim = c(-5, 5),
                                         parameters = 3,
                                         points = 15,
                                         add = FALSE)
y0                          <- matrix(c(2, 0, 0, 2, 0.5, 0.5), 3, 2,
                                      byrow = TRUE)
vanDerPol.nullclines        <- nullclines(vanDerPol,
                                          xlim = c(-5, 5),
                                          ylim = c(-5, 5),
                                          parameters = 3,
                                          points = 500)
vanDerPol.trajectory        <- trajectory(vanDerPol,
                                          y0 = y0,
                                          tlim = c(0, 10),
                                          parameters = 3)
# Plot x and y against t
vanDerPol.numericalSolution <- numericalSolution(vanDerPol,
                                                 y0 = c(4, 2),
                                                 tlim = c(0, 100),
                                                 parameters = 3)
# Determine the stability of the equilibrium point
vanDerPol.stability         <- stability(vanDerPol,
                                         ystar = c(0, 0),
                                         parameters = 3)
# }

Run the code above in your browser using DataLab