# HG changeset patch # User Madhusudan.C.S # Date 1255599248 -19800 # Node ID a4bbc14342f9a6733e1429171a55240405476057 # Parent 99ca3cb18fd2f8cbb73e7d2f4ed1a511a854e8fb# Parent d43a698712e0cd591f3bea160d46fc14f0e2630c Merge Mainline and Madhu branches. diff -r 99ca3cb18fd2 -r a4bbc14342f9 day1/session4.tex --- a/day1/session4.tex Thu Oct 15 15:03:27 2009 +0530 +++ b/day1/session4.tex Thu Oct 15 15:04:08 2009 +0530 @@ -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}