# Phase plane analysis in R

The forthcoming R Journal has an interesting article about *phaseR: An R Package for Phase Plane Analysis of Autonomous ODE Systems* by Michael J. Grayling. The package has some nice functions to analysis one and two dimensional dynamical systems. As an example I use here the FitzHugh-Nagumo system introduced earlier:
$$
\begin{align}
\dot{v}=&2 (w + v - \frac{1}{3}v^3) + I_0 \\

\dot{w}=&\frac{1}{2}(1 - v - w)\\

\end{align}
$$
The FitzHugh-Nagumo system is a simplification of the Hodgkin-Huxley model of spike generation in squid giant axon. Here $I_0$ is a bifurcation parameter. As I decrease $I_0$ from 0 the system dynamics change (Hopf-bifurcation): a stable equilibrium solution transform into a limit cycle. Following Michael’s paper, I can use `phaseR`

to plot the velocity field, add nullclines and plot trajectories from different starting points. Here I plot the FitzHugh-Nagumo system for four different parameters of $I_0$ and three different initial starting values. The blue line show the nullcline of $w$ i.e. $\dot{w}=0$, while the red line shows the nullcline of $v$. For $I_0=-2$ I can observe the limit cycle.
Yet, I was a little surprised that the paper didn’t make any references to the XPPAUT software by Bard Ermentrout, which has been around for many years as tool to analyse dynamical systems.

### Session Info

`R version 3.1.2 (2014-10-31)nPlatform: x86_64-apple-darwin13.4.0 (64-bit) locale:n[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages:n[1] stats graphics grDevices utils datasets methods n[7] base other attached packages:n[1] phaseR_1.3 deSolve_1.10-9 loaded via a namespace (and not attached):n[1] tools_3.1.2`