Description Usage Arguments Value Author(s) See Also Examples

Performs numerical integration of the chosen ODE system, for a user specified set of initial conditions. Plots the resulting solution(s) in the phase plane.

1 2 3 |

`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 guide. |

`y0` |
The initial condition(s). In the case of a one dimensional system, this can either be a single number indicating the location of the dependent variable initially, or a vector indicating multiple initial locations of the independent variable. In the case of a two dimensional system, this can either be a vector of length two reflecting the location of the two dependent variables initially. Or it can be matrix where each row reflects a different initial condition. Alternatively this can be left blank and the user can use locator to specify initial condition(s) on a plot. In this case, for one dimensional systems, all initial conditions are taken at tlim[1], even if not selected so on the graph. Defaults to NULL. |

`n` |
If y0 is left NULL so initial conditions can be specified using locator, n sets the number of initial conditions to be chosen. Defaults to NULL. |

`tlim` |
Sets the limits of the independent variable for which the solution should be plotted. Should be a vector of length two. If tlim[2] > tlim[1], then tstep should be negative to indicate a backwards trajectory. |

`tstep` |
The step length of the independent variable, used in numerical integration. Decreasing the absolute magnitude of tstep theoretically makes the numerical integration more accurate, but increases computation time. Defaults to 0.01. |

`parameters` |
Parameters of the ODE system, to be passed to deriv. Supplied as a vector; the order of the parameters can be found from the deriv file. Defaults to NULL. |

`system` |
Set to either "one.dim" or "two.dim" to indicate the type of system being analysed. Defaults to "two.dim". |

`col` |
The colour(s) to plot the trajectories in. Will be reset accordingly if it is a vector not of the length of the number of initial conditions. Defaults to "black". |

`add` |
Logical. If TRUE, the trajectories added to an existing plot. If FALSE, a new plot is created. Defaults to TRUE. |

`state.names` |
State names for ode functions that do not use positional states |

`...` |
Additional arguments to be passed to plot. |

Returns a list with the following components (the exact make up is dependent upon the type of system being analysed):

`add` |
As per input. |

`col` |
As per input, but with possible editing if a colour vector of the wrong length was supplied. |

`deriv` |
As per input. |

`n` |
As per input. |

`parameters` |
As per input. |

`system` |
As per input. |

`tlim` |
As per input. |

`tstep` |
As per input. |

`t` |
A vector containing the values of the independent variable at each integration step. |

`x` |
In the two dimensional system case, a matrix whose columns are the numerically computed values of the first dependent variable for each initial condition. |

`y` |
In the two dimensional system case, a matrix whose columns are the numerically computed values of the second dependent variable for each initial condition. In the one dimensional system case, a matrix whose columns are the numerically computed values of the dependent variable for each initial condition. |

`y0` |
As per input, but converted to a matrix if supplied as a vector initially. |

Michael J. Grayling

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
# Plot the flow field, nullclines and several trajectories for the one
# dimensional autonomous ODE system logistic.
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 velocity field, nullclines and several trajectories for the two dimensional
# autonomous ODE system simplePendulum.
simplePendulum.flowField <- flowField(simplePendulum, xlim = c(-7, 7),
ylim = c(-7, 7), parameters = 5, points = 19,
add = FALSE)
y0 <- matrix(c(0, 1, 0, 4, -6, 1, 5, 0.5, 0, -3), ncol = 2,
nrow = 5, byrow = TRUE)
simplePendulum.nullclines <- nullclines(simplePendulum, xlim = c(-7, 7),
ylim = c(-7, 7), parameters = 5, points = 500)
simplePendulum.trajectory <- trajectory(simplePendulum, y0 = y0, tlim = c(0,10),
parameters = 5)
``` |

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.