\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\setlength{\topmargin}{-0.35in}
\setlength{\textheight}{9.in}
\setlength{\evensidemargin}{-.2in}
\setlength{\oddsidemargin}{-.2in}
\setlength{\textwidth}{6.5in}
\pagestyle{plain}
\pagenumbering{arabic}
\def\beq{\begin{equation}}
\def\eeq{\end{equation}}
\def\bea{\begin{eqnarray}}
\def\ena{\end{eqnarray}}
\def\eps{\epsilon}
\def\psize{3.5in}
\def\figsize{2.5in}
\def\a{\alpha}
\def\ps{s^{-1}}
\def\m{\mu}
\long\def\drop#1{}
\bibliographystyle{plain}
% for biophys J
%\bibliographystyle{chicago}


\begin{document}
 \begin{center}
 Exercises for Module 1
 \end{center}
 
 \begin{enumerate}
 \item
 A monomer (represented by $A_1$) polymerizes to form polymer of length $n$, (denoted $A_n$) via the reaction scheme
 \beq
 A_n + A_1 \stackrel{\rightarrow}{\leftarrow} A_{n+1}
 \eeq
 
 \begin{enumerate}
 \item
 Use the law of mass action to write a system of differential equations for the dynamics of $A_n$.  What is the equation governing the dynamics of $A_1$?  Check to be sure that $\sum_nn{dA_n\over dt} = 0$.
 
 \item
 Assuming that $\sum_nnA_n = A_0$, find the steady state distribution of polymer lengths.
 \end{enumerate}
 
 \item
 Use the law of mass action to find differential equations governing $S_{jk}$ for the reaction scheme
 \begin{center}
\includegraphics[width=4cm]{figs/ryr_four_state}\end{center}
Use that $S_{00} + S_{01} + S_{10} + S_{11} = 1$.

\begin{enumerate}
\item
Suppose the ``top" and ``bottom" reactions are independent from the ``left" and ``right" reactions.  Assume that $S_{10} = m h$, $S_{00} = (1-m)h$, $S_{11} = m(1-h)$, $S_{01}=(1-m)(1-h)$.  Find the differential equations governing the dynamics of $m$ and $h$.

\item
Assume that the top and bottom reactions are fast compared to the left and right reactions.  Use the quasi-steady state assumption to find $S_{01}$ in terms of $h = S_{00}+S_{01}$ and find the equation governing the dynamics of $h$.  (This problem is the most difficult in this set.  For help, look at Keener and Sneyd, Mathematical Physiology.)

\end{enumerate}

\item
Sketch the phase portrait for the system of differential equations
\beq
{d\phi\over dt} = A\phi(1-\phi)(\phi-a) - h +I_0, \qquad {dh\over dt} = \epsilon(\phi-\gamma h)
\eeq
where all parameters are positive, $0 <a<{1\over 2}$ and $\epsilon <<1$.  What qualitatively different kinds of phase portraits are possible  (there are 3)?

Write a simple Matlab code to simulate the solution of this equation (Use $A=10$, $a=0.1$, $\epsilon = 0.1$ for starters).  Find parameter values for each of the qualitatively different behaviors.

\end{enumerate}

\newpage

\section{Solutions}

\begin{enumerate}
\item
\begin{enumerate}
\item
The differential equations are
\beq
{dA_n\over dt} = k_+A_{n-1}A_1 - k_+A_nA_1 + k_-A_{n+1} - k_-A_n\label{eq:1}
\eeq
for $n\ge 2$ and
\beq
{dA_1\over dt} = -2k_+A_1^2 +2k_-A_2 +\sum_{n=3}^\infty k_-A_n-\sum_{n=2}^\infty k_+A_nA_1
\eeq

To check this, note that 
\bea
\sum_{n=2}^\infty n{dA_n\over dt} &=& \sum_{n=2}^\infty n(k_+A_{n-1}A_1 - k_+A_nA_1 + k_-A_{n+1} - k_-A_n)\nonumber\\ &=&
 \sum_{n=2}^\infty nk_+A_{n-1}A_1 - \sum_{n=2}^\infty n k_+A_nA_1 +  \sum_{n=2}^\infty n k_-A_{n+1} -  \sum_{n=2}^\infty nk_-A_n\nonumber\\
 &=&
  \sum_{n=1}^\infty (n+1)k_+A_{n}A_1 - \sum_{n=2}^\infty n k_+A_nA_1 +  \sum_{n=3}^\infty (n-1) k_-A_{n} -  \sum_{n=2}^\infty nk_-A_n\nonumber \\
   &=&
 2k_+A_1^2 +  \sum_{n=2}^\infty k_+A_{n}A_1 - \sum_{n=3}^\infty  k_-A_{n}  -   2k_-A_{2}
  \ena
  so that $\sum_{n=1}^\infty n{dA_n\over dt} = 0$.
  \item
  To find the steady state solution, notice that the equation (\ref{eq:1}) in steady state (${dA_n\over dt} = 0$) is a linear difference equation (with $A_1$ fixed).  Therefore, for $n\ge 2$, $A_n = \alpha \mu^n$, where 
  \beq
  k_+A_1 - k_-\mu-\mu( k_+ A_1 - k_-\mu)  = 0
  \eeq
  so that $\mu = { k_+A_1 \over  k_-}$.  Notice that for consistency, $A_1 = \alpha \mu$ so that $\alpha = {k_-\over k_+}$.
  
  Now to find $A_1$ we only need to solve the equation $\sum_{n=2}^\infty A_n + A_1 = A_0$.  However, 
  \bea
  \sum_{n=2}^\infty nA_n &=& \alpha \sum_{n=2}^\infty n\mu^n \\
  &=& \alpha \sum_{n=2}^\infty n\mu^n  = \alpha\left({1\over (1-\mu)^2} - \mu\right)
  \ena
  This leaves us with a single equation for $\mu$
  \beq
  {k_-\mu\over k_+} {1\over (1-\mu)^2} = A_0.
   \eeq
   

\end{enumerate}
\end{enumerate}

\end{document}


