Manual merge with mainline.
authorPuneeth Chaganti <punchagan@fossee.in>
Thu, 15 Oct 2009 11:34:35 +0530
changeset 124 d43a698712e0
parent 123 d2f4053a2e85 (current diff)
parent 122 73374e1ae4f3 (diff)
child 126 a4bbc14342f9
child 127 44c2f614e321
Manual merge with mainline.
day1/session4.tex
--- a/day1/session4.tex	Thu Oct 15 11:30:08 2009 +0530
+++ b/day1/session4.tex	Thu Oct 15 11:34:35 2009 +0530
@@ -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.