Created
August 1, 2015 20:38
-
-
Save dhfromkorea/eebe13c22fe0a4a4f19d to your computer and use it in GitHub Desktop.
plotting a phase portrait of non-linear autonomous ODE's using phaseR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!require(phaseR)){ | |
install.packages('phaseR') | |
require(phaseR) | |
} | |
# a system of two non-linear autonomous ODE's | |
ode = function (t, y, parameters) { | |
x <- y[1] | |
y <- y[2] | |
dy <- numeric(2) | |
dy[1] <- x-x*y | |
dy[2] <- y+2*x*y | |
list(dy) | |
} | |
ode.flowField <- flowField(ode, x.lim = c(-5, 5), y.lim = c(-5, 5), points = 21, add = FALSE) | |
ode.nullclines <- nullclines(ode, x.lim = c(-5, 5), y.lim = c(-5, 5), points = 200) | |
# p14.trajectory <- trajectory(p14, t.end = 10, n=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment