\documentclass[12pt,twoside]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amscd}
\usepackage{bbm}
\usepackage[hmarginratio=1:1]{geometry}
\usepackage{titlesec}
\usepackage{mathrsfs}
\usepackage{enumerate}
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modified Title
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\makehwtitle}[4]{
\begin{center}
\Large
\textbf{#1 \,-- \:#2}
\\
#3 \\
#4
\normalsize
\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Problem Headings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{ProblemNumber}
\newcounter{SubProblemNumber}[ProblemNumber]
\renewcommand{\theProblemNumber}{\arabic{ProblemNumber}}
\renewcommand{\theSubProblemNumber}{\alph{SubProblemNumber}}
\newcommand{\problem}[1]{
\stepcounter{ProblemNumber}
\subsection*{#1}
\hrulefill
\vspace{12pt}
}
\newcommand{\nproblem}{
\problem{Problem \theProblemNumber}
}
\newcommand{\soln}[1]{\subsection*{#1}}
\newcommand{\solution}{\soln{Solution}}
\renewcommand{\part}{
\stepcounter{SubProblemNumber}
\soln{Part (\theSubProblemNumber)}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% New Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\newcommand{\deriv}[3][]{\ensuremath{\frac{\textrm{d}^{#1}#2}{\textrm{d}{#3}^{#1}}}}
\newcommand{\pderiv}[3][]{\ensuremath{\frac{\partial^{#1}#2}{\partial{#3}^{#1}}}}
\renewcommand{\d}{\ensuremath{\,\textrm{d}}}
\newcommand{\qed}{\ensuremath{\Box}}
\newcommand{\absval}[1]{\ensuremath{\left|#1\right|}}
\begin{document}
\begin{center}
\huge\textbf{Homework 2} \normalsize \\ Due Friday, July 7 2017
\end{center}
\problem{Problem 1 (10 points)}
We studied the logistic equation in class as a model of population growth. It is given by
\begin{equation} \label{eq:logistic}
\deriv{N}{t} = rN\left(1 - \frac{N}{K}\right),
\end{equation}
with $N(0) = N_0$.
\begin{enumerate}[(a)]
\item Make the substitutions $x = N/K$ and $\tau = rt$. Show that \eqref{eq:logistic} becomes
\begin{equation} \label{eq:nondim-log}
\deriv{x}{\tau} = x(1 - x),
\end{equation}
with $x(0) = N_0/K \equiv x_0$. Notice that neither $x$ nor $\tau$ has units. This equation is a nondimensionalized version of \eqref{eq:logistic}.
\item Solve equation \eqref{eq:nondim-log}. (The technique of partial fractions may come in handy.)
\item Substitute $x = N/K$ and $\tau = rt$ in your solution to find an equation for $N(t)$.
\end{enumerate}
\part
If we let $x = N/K$ and $\tau = rt$, then by the chain rule we have
\begin{equation}
\deriv{N}{t} = \deriv{N}{x}\deriv{x}{\tau}\deriv{\tau}{t} = rK\deriv{x}{\tau}.
\end{equation}
Substituting this into \eqref{eq:logistic}, we obtain
\begin{align*}
rK\deriv{x}{\tau} = rKx\left(1 - x\right), &\textrm{ so } \\
\deriv{x}{\tau} = x(1 - x), &
\end{align*}
as desired.
In addition, since $\tau = 0$ when $t = 0$, we have $x(0) = N(0)/K = N_0/K$.
\part
This equation is separable, so we have
\begin{align*}
\frac{1}{x(1-x)}\deriv{x}{\tau} = 1, &\textrm{ so } \\
\int\frac{1}{x(1 - x)}\deriv{x}{\tau}\d\tau = \int 1\d\tau, &\textrm{ and therefore } \\
\int\frac{1}{x(1 - x)}\d x = \int\d\tau. &
\end{align*}
We can rewrite the left integrand using partial fractions, and we obtain
\begin{align*}
\int\left[\frac{1}{x} + \frac{1}{1 - x}\right]\d x = \int\d\tau, &\textrm{ so } \\
\ln x - \ln(1 - x) = \tau + C, &\textrm{ and } \\
\ln\frac{x}{1 - x} = \tau + C, &\textrm{ so } \\
\frac{x}{1 - x} = Ae^{\tau}.
\end{align*}
Rearranging this expression, we get
\begin{align*}
x = Ae^{\tau} - Ae^{\tau}x, &\textrm{ so } \\
(1 + Ae^{\tau})x = Ae^{\tau}, &\textrm{ and } \\
x(\tau) = \frac{Ae^{\tau}}{1 + Ae^{\tau}}.
\end{align*}
Since $x(0) = x_0$, we have $A = x_0/(1 - x_0)$. This means that (after some simplification) our solution is
\begin{equation} \label{eq:log-sol}
x(\tau) = \frac{x_0e^{\tau}}{1 - x_0 + x_0e^{\tau}}.
\end{equation}
\part
If we substitute $x = N/K$ and $\tau = rt$, as well as the initial condition $x_0 = N_0/K$ into \eqref{eq:log-sol}, we get
\begin{equation*}
\frac{N(t)}{K} = \frac{N_0e^{rt}/K}{1 - (N_0/K) + N_0e^{rt}/K},
\end{equation*}
so
\begin{equation}
N(t) = \frac{KN_0e^{rt}}{K - N_0 + N_0e^{rt}}.
\end{equation}
\problem{Problem 2 (10 points)}
The Gompertz equation, given by
\begin{equation} \label{eq:gompertz}
\deriv{N}{t} = re^{-\alpha t}N(t)
\end{equation}
with $N(0) = N_0$, has been used to model the growth of cancerous tumors. Here, $N$ is the number of cancer cells in a tumor, $r$ is the initial growth rate of the tumor and $\alpha$ is a damping term that determines how the growth rate slows over time. (See https://www.nature.com/bjc/journal/v18/n3/pdf/bjc196455a.pdf for more details.)
\begin{enumerate}[(a)]
\item Solve the Gompertz equation for $N(t)$. (This is a nonautonomous equation, meaning $t$ appears explicitly in the right hand side, but it is separable.)
\item You should find that $N(t)$ approaches an asymptote as $t\to\infty$. That is, $\lim_{t\to\infty}N(t) = K$. Find $K$ explicitly. (It may depend on the parameters $r$, $\alpha$ and $N_0$.)
\item Show that equation \eqref{eq:gompertz} can be rewritten as
\begin{equation}
\frac{1}{N}\deriv{N}{t} = \alpha\ln\left(\frac{K}{N}\right).
\end{equation}
\end{enumerate}
\part
This equation is separable, so we have
\begin{align*}
\frac{1}{N}\deriv{N}{t} = re^{-\alpha t}, &\textrm{ so } \\
\int \frac{1}{N}\deriv{N}{t}\d t = \int re^{-\alpha t}\d t, &\textrm{ and } \\
\int \frac{1}{N}\d N = \int re^{-\alpha t}\d t, &\textrm{ so } \\
\ln N = -\frac{r}{\alpha}e^{-\alpha t} + C,
\end{align*}
which means
\begin{equation*}
N(t) = A\exp\left(-\frac{r}{\alpha}e^{-\alpha t}\right).
\end{equation*}
Since $N(0) = N_0$, we have $A = N_0e^{r/\alpha}$, so
\begin{equation} \label{eq:gomp-sol}
N(t) = N_0\exp\left(\frac{r}{\alpha} - \frac{r}{\alpha}e^{-\alpha t}\right).
\end{equation}
\part
Using \eqref{eq:gomp-sol}, we obtain
\begin{equation*}
K = \lim_{t\to\infty}N(t) = \lim_{t\to\infty}N_0\exp\left(\frac{r}{\alpha} - \frac{r}{\alpha}e^{-\alpha t}\right) = N_0e^{r/\alpha}.
\end{equation*}
\part
We know from the definition that
\begin{equation*}
\frac{1}{N}\deriv{N}{t} = re^{-\alpha t},
\end{equation*}
so we just need to check that $\alpha\ln(K/N) = re^{-\alpha t}$. Using the results of the previous two parts, we have
\begin{align*}
\alpha\ln\left(\frac{K}{N}\right) &= \alpha\ln\left(\frac{N_0e^{r/\alpha}}{N_0e^{r/\alpha}\exp\left(-re^{-\alpha t}/\alpha\right)}\right) \\
&= \alpha\ln\left(\exp\left(\frac{r}{\alpha}e^{-\alpha t}\right)\right) \\
&= \alpha\frac{r}{\alpha}e^{-\alpha t} \\
&= re^{-\alpha t}.
\end{align*}
Therefore,
\begin{equation}
\frac{1}{N}\deriv{N}{t} = \alpha\ln\left(\frac{K}{N}\right),
\end{equation}
as desired.
\problem{Problem 3 (10 points)}
Suppose that we have the differential equation
\begin{equation} \label{eq:ode}
\dot{x} = f(x).
\end{equation}
Remember that an equilibrium $x^*$ of this equation is a point such that $f(x^*) = 0$. We said that $x^*$ was stable if solutions of \eqref{eq:ode} with initial conditions sufficiently close to $x^*$ continued to approach $x^*$. That is, if $x'(t) = f(x)$ and $x^* - x(0) \ll 1$, then $\lim_{t\to\infty}x(t) = x^*$. Similarly, an equilibrium is unstable if solutions starting near $x^*$ move away from $x^*$. (Technically, we should call this \emph{asymptotic stability}.)
\begin{enumerate}[(a)]
\item Show that the differential equation $\dot{x} = x^3$ has an equilibrium at $x = 0$, and that $f'(x) = 0$. Draw a phase line (i.e., a plot of $x$ vs $\dot{x}$) and use it to determine the stability of $x^* = 0$. Solve the differential equation with initial condition $x(0) = x_0 \neq 0$ and use the solution to confirm your stability conclusion.
\item Repeat part (a) with the differential equation $\dot{x} = -x^3$.
\item Repeat part (a) with the differential equation $\dot{x} = 0$.
\end{enumerate}
\part
The phase diagram for $\dot{x} = x^3$ is
\begin{center}
\includegraphics[width=0.8\textwidth]{phase_x3}
\end{center}
It is clear from the diagram that $x^* = 0$ is an unstable equilibrium.
The equation $\dot{x} = x^3$ is separable, so we have
\begin{align*}
x^{-3}\deriv{x}{t} = 1, &\textrm{ so } \\
\int x^{-3}\deriv{x}{t}\d t = \int 1\d t, &\textrm{ and } \\
\int x^{-3}\d x = \int \d t, &\textrm{ so } \\
-\frac{1}{2x^2} = t + C,
\end{align*}
and therefore
\begin{equation*}
x(t) = \frac{1}{\sqrt{A - 2t}}.
\end{equation*}
If we choose $x(0) = x_0 \neq 0$, then we have $A = 1/x_0^2$, so
\begin{equation}
x(t) = \frac{1}{\sqrt{1/x_0^2 - 2t}}.
\end{equation}
In particular, notice that if $x_0 > 0$, then $x(t)$ increases as $t$ does, and if $x_0 < 0$, then $x(t)$ decreases as $t$ increases. This means that solutions move away from $x^* = 0$, so $0$ is an unstable equilibrium according to our definition. (Note that it doesn't make sense to ask what happens as $t\to\infty$ in this case -- the solution isn't even defined for any time beyond $t_{max} = 1/\sqrt{2x_0^2}$.)
\part
The phase diagram for $\dot{x} = -x^3$ is
\begin{center}
\includegraphics[width=0.8\textwidth]{phase_negx3}
\end{center}
This diagram indicates that $x^* = 0$ is a stable equilibrium.
The equation $\dot{x} = -x^3$ can be solved in exactly the same manner as the previous problem. We find that
\begin{equation}
x(t) = \frac{1}{1/x_0^2 + 2t},
\end{equation}
for any $x_0 > 0$. In this case, the solution is defined for all positive time, so it makes sense to write
\begin{equation*}
\lim_{t\to\infty}x(t) = 0,
\end{equation*}
so $x^* = 0$ is a stable equilibrium.
\part
The phase diagram for $\dot{x} = 0$ is simply a line along the $x$-axis. This means that \emph{every} point is an equilibrium. We can also see this by solving the equation explicitly, which gives $x(t) = x_0$. This means that solutions starting near zero neither move towards $0$ or away from $0$. By our definition, this means that $x^* = 0$ is neither stable nor unstable. We briefly mentioned in class that this equilibrium does meet another definition of stability -- Lyapunov stability. (In brief, this means that if you start close to $0$, you never move too far away from $0$.) For our purposes, it's ok if you said that $x^* = 0$ was stable or ``not stable'', but it does not make sense (under any definition) to say that $x^* = 0$ is unstable.
\problem{Problem 4 (10 points)}
The spruce budworm is an insect that periodically devastates populations of balsam fir trees in eastern Canada. In this problem, we will follow a model proposed by Ludwig, Jones and Holling in 1978 (http://www.math.ku.dk/~moller/e04/bio/ludwig78.pdf) to describe the populations of this pest. Our goal will be to reproduce figure 2 of that paper.
Ludwig et al. proposed that budworms would grow logistically in the absence of predators, and that predation (mostly by birds) was very small when budworm population was low, but rapidly reached a maximum level $b$ once the population passed some threshold $a$. In particular, if we let $N(t)$ represent the number of budworms at time $t$ and let $R$ be a parameter representing the growth rate, let $K$ be a parameter representing the carrying capacity of the environment, let $b$ be a parameter representing the maximum predation rate and let $a$ be a parameter representing a threshold population level where predation would increase, then we obtain the differential equation
\begin{equation} \label{eq:budworm1}
\deriv{N}{t} = RN\left(1 - \frac{N}{K}\right) - \frac{bN^2}{a^2 + N^2}.
\end{equation}
(You can assume that all four parameters are positive.)
\begin{enumerate}[(a)]
\item Show that if we make the substitutions $x = N/a$, $\tau = bt/a$, $r = Ra/b$ and $k = K/a$, then \eqref{eq:budworm1} becomes
\begin{equation} \label{eq:budworm2}
\deriv{x}{\tau} = rx\left(1 - \frac{x}{k}\right) - \frac{x^2}{1 + x^2}.
\end{equation}
\item Show that $x^* = 0$ is an equilibrium of \eqref{eq:budworm2} and that it is always unstable.
\item We can find the other fixed points of \eqref{eq:budworm2} by setting
\begin{equation}
r\left(1 - \frac{x}{k}\right) = \frac{x}{1 + x^2}.
\end{equation}
After some simplification, this equation becomes a cubic, so we could solve it exactly and find 1, 2 or 3 more fixed points. However, solving a general cubic equation is unpleasant, so we will find these fixed points graphically. To do so, plot both $y_1 = r(1 - x/k)$ and $y_2 = x/(1 + x^2)$ for various values of $r$ and $k$. Choose values of $r$ and $k$ so that $y_1$ and $y_2$ intersect in 1, 2 and 3 places. Figure 1 of the paper shows the case where $y_1$ and $y_2$ intersect in 3 places; you need to plot the other two possibilities. Use a graphical argument to determine the stability of each fixed point.
\item We will now calculate the values of $r$ and $k$ such that \eqref{eq:budworm2} has exactly two equilbria. This can only happen if the line $r(1 - x/k)$ intersects the curve $x/(1 + x^2)$ tangentially. That is, we need both
\begin{equation}
r\left(1 - \frac{x}{k}\right) = \frac{x}{1 + x^2},
\end{equation}
and
\begin{equation}
\deriv{}{x}\left[r\left(1 - \frac{x}{k}\right)\right] = \deriv{}{x}\left[\frac{x}{1 + x^2}\right].
\end{equation}
Use these two equations to show that
\begin{equation}
r = \frac{2x^3}{(1 + x^2)^2} \:\textrm{ and }\: k = \frac{2x^3}{x^2 - 1}.
\end{equation}
Use these two equations to reproduce figure 2 of the paper.
\end{enumerate}
\part
Let $x = N/a$, $\tau = bt/a$, $r = Ra/b$ and $k = K/a$. From the chain rule, we have that
\begin{equation*}
\deriv{N}{t} = \deriv{N}{x}\deriv{x}{\tau}\deriv{\tau}{t} = a\deriv{x}{\tau}\cdot\frac{b}{a} = b\deriv{x}{\tau}.
\end{equation*}
Substituting these values into \eqref{eq:budworm1}, we obtain
\begin{align*}
b\deriv{x}{\tau} = \frac{br}{a}\cdot ax\left(1 - \frac{ax}{ak}\right) - \frac{ba^2x^2}{a^2 + a^2x^2}, &\textrm{ so } \\
\deriv{x}{\tau} = rx\left(1 - \frac{x}{k}\right) - \frac{x^2}{1 + x^2}, &
\end{align*}
as desired.
\part
We have
\begin{equation*}
\deriv{x}{\tau} = rx\left(1 - \frac{x}{k}\right) - \frac{x^2}{1 + x^2} \equiv f(x).
\end{equation*}
Since $f(0) = 0$ regardless of the values of $r$ and $k$, we know that $x^* = 0$ is always an equilibrium. Moreover, we have
\begin{equation*}
f'(x) = r - \frac{2x}{k} - \frac{2x}{(1 + x^2)^2},
\end{equation*}
so $f'(0) = r$. Since $r > 0$, we have $f'(0) > 0$, so $x^* = 0$ is unstable regardless of $r$ or $k$.
\part
We can find all equilibria by setting
\begin{equation*}
f(x) = rx\left(1 - \frac{x}{k}\right) - \frac{x^2}{1 + x^2} = x\left[r\left(1 - \frac{x}{k}\right) - \frac{x}{1 + x^2}\right] = 0.
\end{equation*}
This means that either $x = 0$, which we already knew about, or
\begin{equation}
r\left(1 - \frac{x}{k}\right) = \frac{x}{1 + x^2}.
\end{equation}
We can find these equilibria graphically for various values of $r$ and $k$ by plotting both the left and right sides of this equation on the same axes and seeing where they intersect.
We can choose $r$ and $k$ so that there are three intersections, as in:
\begin{center}
\includegraphics[width=0.5\textwidth]{three_int}
\end{center}
The solution must increase whenever the growth term (in green) is higher than the predation term (in blue). Likewise, the solution must decrease when the predation term (in blue) is higher than the growth term (in green). We can therefore see from the graph that the leftmost equilibrium is stable, the middle equilibrium is unstable and the rightmost equilibrium is stable.
We can also choose $r$ and $k$ so that there is one intersection, as in:
\begin{center}
\includegraphics[width=0.5\textwidth]{one_int}
\end{center}
The equilibrium is stable in both of these diagrams. (You only need to show one of the two possibilities.)
Finally, we can choose $r$ and $k$ so that there are two intersections, as in:
\begin{center}
\includegraphics[width=0.5\textwidth]{two_int}
\end{center}
In both cases, there is one place where the curves cross transversally and another where the curves cross tangentially. The transverse intersection occurs at a stable intersection, while the tangential intersection occurs at an equilibrium where solutions approach on one side and depart on another. This equilibrium is technically unstable, but it is often referred to as ``semi-stable'' or as a saddle. (Again, you only need to show one of the two graphs.)
\part
As we can see from the graphs, we only get exactly two intersections when one of them is tangential. That means that we need
\begin{equation} \label{eq:intersect}
r\left(1 - \frac{x}{k}\right) = \frac{x}{1 + x^2}
\end{equation}
so that the two lines will intersect, and
\begin{equation} \label{eq:tangent}
\deriv{}{x}\left[r\left(1 - \frac{x}{k}\right)\right] = \deriv{}{x}\left[\frac{x}{1 + x^2}\right]
\end{equation}
so that the two lines will be tangent. Equation \eqref{eq:tangent} simplifies to
\begin{equation*}
-\frac{r}{k} = \frac{1 - x^2}{(1 + x^2)^2},
\end{equation*}
so we have
\begin{equation} \label{eq:k}
k = \frac{r(1 + x^2)^2}{x^2 - 1}.
\end{equation}
Substituting this into \eqref{eq:intersect}, we find that
\begin{equation*}
r\left(1 - \frac{x(x^2 - 1)}{r(1 + x^2)^2}\right) = \frac{x}{1 + x^2},
\end{equation*}
so
\begin{align*}
r &= \frac{x^3 - x}{(1 + x^2)^2} + \frac{x}{1 + x^2} \\
&= \frac{x^3 - x}{(1 + x^2)^2} + \frac{x + x^3}{(1 + x^2)^2} \\
&= \frac{2x^3}{(1 + x^2)^2}.
\end{align*}
Substituting this into \eqref{eq:k}, we obtain
\begin{equation*}
k = \frac{2x^3}{x^2 - 1},
\end{equation*}
as desired.
If we plot $k$ vs $r$, we obtain the figure
\begin{center}
\includegraphics[width=0.5\textwidth]{stab}
\end{center}
The curve indicates parameter values where there are exactly two nonzero equilibria. The middle portion of the graph indicates parameter values where there are three nonzero equilibria, and the exterior portion indicates parameter values where there is exactly one nonzero equilibrium.
\end{document}