\documentclass{article}

\newenvironment{problem}[1]{\begin{framed}\noindent{\bf\LARGE #1}\\*[1em]}{\end{framed}}
\newenvironment{subproblem}[1]{\begin{framed}\noindent{\bf(#1)} }{\end{framed}}
\newenvironment{solution}{}{}
\newcommand{\firstsub}[1][a]{${}$\\\noindent{\bf(#1)} }

\usepackage{fullpage}
\usepackage{framed}
\usepackage{amsmath}
\usepackage{color}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-coil}
\usepackage{multido}
\usepackage{epsfig}
\newcommand{\gp}[1]{{\left({#1}\right)}}
\newcommand{\px}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\dx}{\Delta x}

\begin{document}

\title{Math 142-2, Project 1}
\author{Your name here}
\date{}
\maketitle

\begin{problem}{Introduction}
  This project looks at the equation for the undamped nonlinear pendulum
  \begin{align*}
    m \theta'' + k \sin \theta &= 0 \qquad \theta(0) = \theta_0 \qquad \theta'(0) = 0
  \end{align*}
  using a mixture of analytic and numerical techniques.
\end{problem}

\begin{problem}{Problem 1}
  Show that this problem can be reduced to the simpler ODE
  \begin{align*}
    \theta'' + \sin \theta &= 0 \qquad \theta(0) = \theta_0 \qquad \theta'(0) = 0
  \end{align*}
  in the sense that the solution to the original problem can be readily deduced
  from the solution to this simpler problem.
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\begin{problem}{Programming}
  To complete the remainder of this project, you will need to use a computer to
  numerically approximate the solution to the simplified ODE $\theta'' + \sin
  \theta = 0$, $\theta(0) = \theta_0$, $\theta'(0)=0$.  You may implement your
  own routines to do this, or you may use an existing solver (such as the ODE
  solvers in MATLAB).  If you choose to implement your own, I would recommend
  using fourth order Runge-Kutta.  You may also find it useful to compute an
  estimate the period of your solution, since this will be needed frequently and
  will be tedious to estimate by hand.  Your code will not be collected or
  graded.
\end{problem}

\begin{problem}{Problem 2}
  For each $\theta_0 \in \{0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.1, 3.14\}$,
  produce one plot showing (a) the solution $x_{sol}$ to the nonlinear ODE, (b)
  the solution $x_{simp} = \theta_0 \cos t$ to the simplified linear ODE, and
  (c) an \textit{adjusted} solution $x_{adj} = \theta_0 \cos \beta t$, where
  $\beta$ is chosen so that the period matches the solution to the original ODE.
  (Note that the period is $2 \pi/\beta$.)  Observe that the period begins to
  deviate well before the shape does.
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\begin{problem}{Problem 3}
  Produce a plot showing the error $E_p$ in the period of the nonlinear pendulum
  and the error $E_a$ in the adjusted approximation, where
  \begin{align*}
    E_p &= \frac{1}{\beta} - 1 \\
    E_a &= \frac{1}{\theta_0} \max_t |x_{sol}(t) - x_{adj}(t)|
  \end{align*}
\end{problem}


\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}


\begin{problem}{Problem 4}
  At (approximately) what initial angle $\theta_0$ does the period error $E_p$
  reach $1\%$? $10\%$?
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\begin{problem}{Problem 5}
  At (approximately) what initial angle $\theta_0$ does the adjusted error $E_a$
  reach $1\%$? $10\%$?
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\begin{problem}{Problem 6}
  Why does the period get longer when the initial displacement is increased?
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\begin{problem}{Problem 7}
  Provide an explanation for why a pendulum spends far more time with $|\theta|$
  near its maximum than near zero, when the initial displacement is close to
  $\pi$.
\end{problem}

\begin{solution}
  \textbf{\textcolor{red}{Your solution goes here}}
\end{solution}

\end{document}
