diff options
author | Puneeth Chaganti | 2009-10-15 11:34:35 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2009-10-15 11:34:35 +0530 |
commit | 8bc30cdaa15e3d30fe43c541d647b2a46f50eed0 (patch) | |
tree | d6c94155d1fc06fb609ce3c6e37394866f31e31f /day1/session4.tex | |
parent | 2a6c38752a38fab5fb8da4773164d9a088a0882a (diff) | |
parent | cf39133fd33d273b145e2478357b1ba25bf3839e (diff) | |
download | workshops-more-scipy-8bc30cdaa15e3d30fe43c541d647b2a46f50eed0.tar.gz workshops-more-scipy-8bc30cdaa15e3d30fe43c541d647b2a46f50eed0.tar.bz2 workshops-more-scipy-8bc30cdaa15e3d30fe43c541d647b2a46f50eed0.zip |
Manual merge with mainline.
Diffstat (limited to 'day1/session4.tex')
-rw-r--r-- | day1/session4.tex | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/day1/session4.tex b/day1/session4.tex index 737e829..b2175ad 100644 --- a/day1/session4.tex +++ b/day1/session4.tex @@ -184,6 +184,28 @@ \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. |