ABSTRACT

This chapter provides examples using R to analyze differential equations. It exhibits Newton’s law of cooling which has only one parameter; the logistic model which has two parameters; and the predator-prey model, which is a system of equations. Each case has a numerical solution that uses the deSolve package and a phase plane that uses the phaseR package. The differential equation that represents the logistic model is a classic two- parameter differential equation. In the predator-prey model, the prey that grows exponentially and dies at a rate proportional to the interaction between prey and predator. The solution for the predator-prey model is computed using the ode function.