diff options
Diffstat (limited to 'day1')
-rw-r--r-- | day1/session4.tex | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/day1/session4.tex b/day1/session4.tex index 978ef66..b2175ad 100644 --- a/day1/session4.tex +++ b/day1/session4.tex @@ -23,6 +23,7 @@ \usepackage[latin1]{inputenc} %\usepackage{times} \usepackage[T1]{fontenc} +\usepackage{amsmath} % Taken from Fernando's slides. \usepackage{ae,aecompl} @@ -120,7 +121,7 @@ \begin{frame} \frametitle{Outline} \tableofcontents - \pausesections +% \pausesections \end{frame} \section{Matrices} @@ -183,4 +184,52 @@ \end{lstlisting} \end{frame} +\section{Solving linear equations} +\begin{frame}[fragile] +\frametitle{Solution of equations} +Example problem: Consider the set of equations + \begin{align*} + 3x + 2y - z & = 1 \\ + 2x - 2y + 4z & = -2 \\ + -x + \frac{1}{2}y -z & = 0 + \end{align*} + + To Solve this, + \begin{lstlisting} + In []: A = array([[3,2,-1],[2,-2,4],[-1, 0.5, -1]]) + In []: b = array([1, -2, 0]) + In []: x = linalg.solve(A, b) + In []: Ax = dot(A, x) + In []: allclose(Ax, b) + Out[]: True + \end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{ODE Integration} +We shall use the simple ODE of a simple pendulum. +\begin{equation*} +\ddot{\theta} = -\frac{g}{L}sin(\theta) +\end{equation*} +\begin{itemize} +\item This equation can be written as a system of two first order ODEs +\item $\dot{\theta} = \omega$ +\item $\dot{\omega} = -\frac{g}{L}sin(\theta)$ +\item At $t = 0$ \\ +$\theta = \theta_0$ \& +$\omega = 0$ +\end{itemize} +\begin{lstlisting} +\end{lstlisting} +\end{frame} + + + \end{document} + +\begin{frame}[fragile] +\frametitle{} +\begin{lstlisting} +\end{lstlisting} +\end{frame} |