\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts}

\newcommand{\x}{\boldsymbol{x}}
\newcommand{\y}{\boldsymbol{y}}
\renewcommand{\v}{\boldsymbol{v}}
\newcommand{\w}{\boldsymbol{w}}
\renewcommand{\a}{\boldsymbol{a}}
\renewcommand{\b}{\boldsymbol{b}}
\renewcommand{\c}{\boldsymbol{c}}
\newcommand{\e}{\mathrm{e}}
\renewcommand{\d}{\mathrm{d}}
\renewcommand{\i}{\mathrm{i}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\Range}{\operatorname{Range}}
\newcommand{\Ker}{\operatorname{Ker}}
\newcommand{\Span}{\operatorname{Span}}
\renewcommand{\dim}{\operatorname{dim}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}


\begin{document}

\title{Numerical Methods I}
\author{Lab Session 8}
\date{November 20, 2003}
\maketitle

\noindent
The differential equation for the harmonic oscillator can be written
in the form
\begin{gather*}
  \dot \y = A\y \,,\\
  \y(0) = \y_0 \,,
\end{gather*}
where $y\colon [0,T] \to \R^2$ and
\[
  A = 
  \begin{pmatrix}
  0 & 1 \\ -1 & 0
  \end{pmatrix} \,.
\]
Solve the harmonic oscillator with initial data
\[
  \y_0 = 
  \begin{pmatrix}
  1 \\ 0
  \end{pmatrix}
\]
on the interval $t \in [0,100]$ with each of the following methods.
Plot each of the solutions in the $y_1$-$y_2$ phase plane.

\begin{enumerate}

\item The \emph{explicit Euler} method (i.e.\ the explicit Taylor method
of order $1$),
\[
  \y_{n+1} = \y_n + h \, f(\y_n) \,,
\]
where, for the harmonic oscillator, $f(\y)=A\y$.

\item The \emph{implicit Euler} method
\[
  \y_{n+1} = \y_n + h \, f(\y_{n+1}) \,.
\]

\item The \emph{implicit midpoint} method
\[
  \y_{n+1} = \y_n + h \, f \Bigl(\frac{\y_n+\y_{n+1}}2 \Bigr) \,.
\]

\item The \emph{symplectic Euler} method, which uses explicit
Euler for the $y_1$ equation, and implicit Euler for the $y_2$
equation. 

\end{enumerate}
\end{document}
