223 |
223 |
224 \begin{frame}[fragile] |
224 \begin{frame}[fragile] |
225 \frametitle{Eigen Values and Eigen Matrix} |
225 \frametitle{Eigen Values and Eigen Matrix} |
226 \begin{small} |
226 \begin{small} |
227 \begin{lstlisting} |
227 \begin{lstlisting} |
228 In []: linalg.eig(A) |
228 In []: E = matrix([[3,2,4],[2,0,2],[4,2,3]]) |
229 Out[]: |
229 |
230 (array([ 11.41026155, 3.71581643, -0.81723144, -2.30884654]), |
230 In []: linalg.eig(E) |
231 matrix([[ 0.12300187, -0.53899627, 0.63269982, 0.56024583], |
231 Out[]: |
232 [ 0.8225266 , -0.67562403, -0.63919634, -0.20747251], |
232 (array([-1., 8., -1.]), |
233 [-0.04763219, -0.47575453, -0.3709497 , -0.80066041], |
233 matrix([[-0.74535599, 0.66666667, -0.1931126 ], |
234 [-0.55321941, -0.16331814, -0.23133374, 0.04497415]])) |
234 [ 0.2981424 , 0.33333333, -0.78664085], |
|
235 [ 0.59628479, 0.66666667, 0.58643303]])) |
|
236 |
|
237 In []: linalg.eigvals(E) |
|
238 Out[]: array([-1., 8., -1.]) |
235 \end{lstlisting} |
239 \end{lstlisting} |
236 \end{small} |
240 \end{small} |
237 \end{frame} |
241 \end{frame} |
238 |
242 |
239 \begin{frame}[fragile] |
243 \begin{frame}[fragile] |
240 \frametitle{Computing Norms} |
244 \frametitle{Computing Norms} |
241 \begin{lstlisting} |
245 \begin{lstlisting} |
242 In []: linalg.norm(A) |
246 In []: linalg.norm(E) |
243 Out[]: 14.0 |
247 Out[]: 8.1240384046359608 |
244 \end{lstlisting} |
248 \end{lstlisting} |
245 \end{frame} |
249 \end{frame} |
246 |
250 |
247 \begin{frame}[fragile] |
251 \begin{frame}[fragile] |
248 \frametitle{Single Value Decomposition} |
252 \frametitle{Single Value Decomposition} |
249 \begin{small} |
253 \begin{small} |
250 \begin{lstlisting} |
254 \begin{lstlisting} |
251 In []: linalg.svd(A) |
255 In [76]: linalg.svd(E) |
252 Out[]: |
256 Out[76]: |
253 (matrix([[-0.08588113, 0.29164297, -0.74892678, 0.58879325], |
257 (matrix( |
254 [-0.79093255, 0.39530483, -0.11188116, -0.45347812], |
258 [[ -6.66666667e-01, -1.23702565e-16, 7.45355992e-01], |
255 [ 0.1523891 , 0.78799358, 0.51966138, 0.29290907], |
259 [ -3.33333333e-01, -8.94427191e-01, -2.98142397e-01], |
256 [ 0.58636823, 0.37113957, -0.39565558, -0.60156827]]), |
260 [ -6.66666667e-01, 4.47213595e-01, -5.96284794e-01]]), |
257 array([ 13.17656506, 3.76954116, 2.79959047, 0.57531379]), |
261 array([ 8., 1., 1.]), |
258 matrix([[-0.05893795, -0.42858358, 0.12442679, 0.89295039], |
262 matrix([[-0.66666667, -0.33333333, -0.66666667], |
259 [ 0.80364672, 0.51537891, 0.03774111, 0.29514767], |
263 [-0. , 0.89442719, -0.4472136 ], |
260 [-0.11752501, 0.14226922, -0.96333552, 0.19476145], |
264 [-0.74535599, 0.2981424 , 0.59628479]])) |
261 [-0.58040171, 0.72832696, 0.23468759, 0.27855956]])) |
265 \end{lstlisting} |
262 \end{lstlisting} |
|
263 \end{small} |
266 \end{small} |
|
267 \inctime{15} |
264 \end{frame} |
268 \end{frame} |
265 |
269 |
266 \section{Solving linear equations} |
270 \section{Solving linear equations} |
267 |
271 |
268 \begin{frame}[fragile] |
272 \begin{frame}[fragile] |
320 \end{block} |
324 \end{block} |
321 \begin{lstlisting} |
325 \begin{lstlisting} |
322 In []: allclose(Ax, b) |
326 In []: allclose(Ax, b) |
323 Out[]: True |
327 Out[]: True |
324 \end{lstlisting} |
328 \end{lstlisting} |
|
329 \inctime{15} |
325 \end{frame} |
330 \end{frame} |
326 |
331 |
327 \subsection{Exercises} |
332 \subsection{Exercises} |
328 |
333 |
329 \begin{frame}[fragile] |
334 \begin{frame}[fragile] |
330 \frametitle{Problem} |
335 \frametitle{Problem Set 4: Problem 4.1} |
331 |
|
332 \end{frame} |
|
333 |
|
334 \begin{frame}[fragile] |
|
335 \frametitle{Problem} |
|
336 Solve the set of equations: |
336 Solve the set of equations: |
337 \begin{align*} |
337 \begin{align*} |
338 x + y + 2z -w & = 3\\ |
338 x + y + 2z -w & = 3\\ |
339 2x + 5y - z - 9w & = -3\\ |
339 2x + 5y - z - 9w & = -3\\ |
340 2x + y -z + 3w & = -11 \\ |
340 2x + y -z + 3w & = -11 \\ |
341 x - 3y + 2z + 7w & = -5\\ |
341 x - 3y + 2z + 7w & = -5\\ |
342 \end{align*} |
342 \end{align*} |
|
343 \inctime{10} |
|
344 \end{frame} |
|
345 |
|
346 \begin{frame}[fragile] |
|
347 \frametitle{Solution} |
|
348 Solution: |
|
349 \begin{lstlisting} |
|
350 \begin{align*} |
|
351 x & = -5\\ |
|
352 y & = 2\\ |
|
353 z & = 3\\ |
|
354 w & = 0\\ |
|
355 \end{align*} |
|
356 \end{lstlisting} |
|
357 \end{frame} |
|
358 |
|
359 \begin{frame}[fragile] |
|
360 \frametitle{Problem 4.2} |
|
361 |
343 \end{frame} |
362 \end{frame} |
344 |
363 |
345 \section{Summary} |
364 \section{Summary} |
346 \begin{frame} |
365 \begin{frame} |
347 \frametitle{Summary} |
366 \frametitle{Summary} |