I used Python in the past, but slowly moved to R. I'm currently trying to create a quiver / direction field graph and an equilibrium graph. I was able to do this in Python, the links to examples below, but hardly reflected it in R. In Python, I was able to use packages like numpy, matplotlib.pyplot, mpl_toolkits.mplot3d and scipy.integrate. I'm currently trying to use deSolve, pracma and matlab. Are there other packages that I should use, or functions in these packages, and I canβt get them to work? Below is an example of the code from the paper that I came across. Any help would be greatly appreciated.
Example <- function(t, state, parameters) {
with(as.list(c(state, parameters)), {
dK <- a * K - b * H - c * F - d * H * F
dH <- b * H - a * K + c * F + e * F
dF <- f + c * F - a * K + b * H + h * K
list(c(dK, dH, dF))
})
}
parameters <- c(a = 0.02,
b = 0.01,
c = 0.04,
d = 0.06,
e = 0.08,
f = 0.2,
h = 0.04)
state <- c(K = 0.7,
H = 0.6,
F = 0.3)
times <- seq(0, 100, by = 0.01)
out <- ode(y = state, times = times, func = Example, parms = parameters)
plot(out)
Here are the links to the graphs that I'm trying to reflect as much as possible:
Equilibrium graph

Quiver / Direction Field Graph
