Preface
This tutorial was made solely for the purpose of education and it was designed for students taking Applied Math 0330. It is primarily for students who have very little experience or have never used Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.
Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in normal font. This means that you can copy and paste all commands into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0330
Return to Mathematica tutorial for the first course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part II of the course APMA0330
Qualitative Analysis
If we view the differential equation span
Example. Consider autonomous differential equation: \( y'= y^2 \) subject \( y(0) = 2. \) Separating the variables,
The nullclines of the differential equation y' = f(x,y) are curves of zero inclination that are defined as solutions of the equation f(x,y) = 0. Nullclines are usually not solutions of the differential equation unless they are constants. The solution curves may cross nullclines when their slope is zero.
Point equilibria (or critical point) of an autonomous differential equation \( {\text d}y / {\text d} t = f(y) \) are defined as the solutions of f(y) = 0. Solutions of this algebraic equation are the constant solutions of the given differential equation. If y* is a point equilibrium of the differential equation \( \dot{y} = f(y) , \) then we call it locally stable if the solution returns to y* after a small perturbation. Otherwise we call y* unstable. There is a graphical and an analytical way to determine stability.
For the graphical analysis, we graph f(y) as a function of y. The point equilibria are the points of intersection of the graph f(y) with the horizontal axis. To determine stability, we check how solutios behave in a neighborhood of each point equilibrium. Plotting a direction field or phase portrait would be helpful.
The analytical analysis is based on linearization of the slope funcion about the equilibrium. The linearization of f(x) about the equilibrium y* is
Andrewartha and Birch (1954) pointed out the ecological importance of spatial structure to the maintenance of populations based on studies of insect populations. They observed that although local patches become frequently extinct, migrants from other patches subsequently recolonize extinct patches, thus allowing the population to persist globally.

In 1969, Richard Levins introduced the concept of metapopulations. This was a very influential paper that is highly cited even today. Richard Levins was of Ukrainian Jewish heritage and was born in Brooklyn, New York. Richard "Dick" Levins (1930--2016) was an extropical farmer turned ecologist, a population geneticist, biomathematician, mathematical ecologist, and philosopher of science who had researched diversity in human populations. Until his death, Levins was a university professor at the Harvard T.H. Chan School of Public Health and a long-time political activist. He was best known for his work on evolution and complexity in changing environments and on metapopulations. A metapopulation is a collection of subpopulations. Each subpopulation occupies a patch, and different patches are linked via migration of individuals between patches. Subpopulations may go extinct, thus leaving a patch vacant. Vacant patches may be recolonized by migrants from other subpopulations. This was a major theoretical advance: The metapopulation concept provided a theoretical framework for studying spatially structured populations, such as those studied by Andrewartha and Birch.
Levins' writing and speaking is extremely condensed. He was known throughout his lengthy career for his ability to make connections between seemingly disparate topics such as biology and political theory. This, combined with his Marxism, has made his analyses less well-known than those of some other ecologists and evolutionists who were adept at popularization. His research had the goal of making the obscure obvious by finding ways to visualize complex phenomena. Recent work examined the variability of health outcomes as an indicator of vulnerability to multiple non-specific stressors in human communities. One story of his Chicago years is that, in order to understand his lectures, his graduate students each needed to attend Levins' courses three times: the first time to acclimate themselves to the speed of his delivery and the difficulty of his mathematics; the second to get the basic ideas down; and the third to pick up his subtleties and profundities.
In Levins model, we keep track of the fraction of patches that is occupied by subpopulations. Subpopulations go extinct at a constant rate and we can set the time scale so that the rate is equal to 1. Vacant patches can be colonized at a rate that is proportional to the fraction of occupied patches; the constant of proportionality is denoted by k. If we call p(t) the proportion of occupied patches at time t, then writing \( p= p(t) , \) we find
To find equilibria, we set \( f(p) = k\,p \left( 1-p \right) -p \) and solve the equation f(p) = 0 for p:
We see that when 0 < k < 1, there is only one biologically relevant equilibrium, namely the trivial equilibrium p* = 0, which is locally stable. When k > 1, the trivial equilibrium becomes unstable, and a second equilibrium appears, \( p^{\ast} = 1- 1/k , \) which is locally stable.
a = Plot[g[x], {x, 0, 2}, PlotStyle -> {Thick, Black}]
b = Plot[0, {x, 1, 2}, PlotStyle -> {Dashed, Thick, Blue}]
Show[a, b]

If we graph the equilibria as a function of the parameter k, we see that there is a qualitative change in behavior at k = 1. We call this a critical value k* =1 because for k < 1, the behavior is qualitatively different from the behavior when k > 1: the stability of the trivial equilibrium changes at k* =1 and a new and nontrivial equilibrium emerges. We will discuss this phenomenon in bifurcation section.
Validity Intervals
First Order ODEs
Plotting Solutions to ODEs
Direction Fields
Separable Equations
Equations Reducible to the Separable Equations
Equations with Linear Fractions
Exact Equations
Integrating Factors
Linear Equations
RC circuits
Bernoulli Equations
Riccati Equations
Existence and Uniqueness
Qualitative Analysis
Bifurcations
Orthogonal Trajectories
Population Models
Applications
Return to Mathematica page
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)