diff --git a/lecture_09/mass_springs.png b/lecture_09/mass_springs.png new file mode 100644 index 0000000..d0dc65c Binary files /dev/null and b/lecture_09/mass_springs.png differ diff --git a/lecture_11/lecture_11.aux b/lecture_11/lecture_11.aux index cf3c530..a9c4771 100644 --- a/lecture_11/lecture_11.aux +++ b/lecture_11/lecture_11.aux @@ -17,12 +17,22 @@ \providecommand\HyField@AuxAddToFields[1]{} \providecommand\HyField@AuxAddToCoFields[2]{} \providecommand \oddpage@label [2]{} -\@writefile{toc}{\contentsline {section}{\numberline {1}LU Decomposition}{1}{section.1}} -\newlabel{lu-decomposition}{{1}{1}{LU Decomposition}{section.1}{}} -\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.0.1}efficient storage of matrices for solutions}{1}{subsubsection.1.0.1}} -\newlabel{efficient-storage-of-matrices-for-solutions}{{1.0.1}{1}{efficient storage of matrices for solutions}{subsubsection.1.0.1}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Pivoting for LU factorization}{2}{subsection.1.1}} -\newlabel{pivoting-for-lu-factorization}{{1.1}{2}{Pivoting for LU factorization}{subsection.1.1}{}} -\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Springs-masses\relax }}{5}{figure.caption.1}} -\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Cholesky Factorization}{6}{subsection.1.2}} -\newlabel{cholesky-factorization}{{1.2}{6}{Cholesky Factorization}{subsection.1.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {0.1}My question from last class}{1}{subsection.0.1}} +\newlabel{my-question-from-last-class}{{0.1}{1}{My question from last class}{subsection.0.1}{}} +\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces responses to determinant of A\relax }}{1}{figure.caption.1}} +\@writefile{toc}{\contentsline {subsection}{\numberline {0.2}Your questions from last class}{1}{subsection.0.2}} +\newlabel{your-questions-from-last-class}{{0.2}{1}{Your questions from last class}{subsection.0.2}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {0.3}Midterm preference}{2}{subsection.0.3}} +\newlabel{midterm-preference}{{0.3}{2}{Midterm preference}{subsection.0.3}{}} +\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces responses to midterm date\relax }}{2}{figure.caption.2}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {0.3.1}Midterm Questions}{2}{subsubsection.0.3.1}} +\newlabel{midterm-questions}{{0.3.1}{2}{Midterm Questions}{subsubsection.0.3.1}{}} +\@writefile{toc}{\contentsline {section}{\numberline {1}LU Decomposition}{2}{section.1}} +\newlabel{lu-decomposition}{{1}{2}{LU Decomposition}{section.1}{}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.0.1}efficient storage of matrices for solutions}{2}{subsubsection.1.0.1}} +\newlabel{efficient-storage-of-matrices-for-solutions}{{1.0.1}{2}{efficient storage of matrices for solutions}{subsubsection.1.0.1}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}Pivoting for LU factorization}{4}{subsection.1.1}} +\newlabel{pivoting-for-lu-factorization}{{1.1}{4}{Pivoting for LU factorization}{subsection.1.1}{}} +\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Springs-masses\relax }}{7}{figure.caption.3}} +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Cholesky Factorization}{8}{subsection.1.2}} +\newlabel{cholesky-factorization}{{1.2}{8}{Cholesky Factorization}{subsection.1.2}{}} diff --git a/lecture_11/lecture_11.log b/lecture_11/lecture_11.log index 10423a7..981cd40 100644 --- a/lecture_11/lecture_11.log +++ b/lecture_11/lecture_11.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2017.1.11) 22 FEB 2017 22:01 +This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex 2017.1.11) 27 FEB 2017 11:55 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -734,76 +734,89 @@ LaTeX Font Info: Try loading font information for T1+cmtt on input line 279. (/usr/share/texlive/texmf-dist/tex/latex/base/t1cmtt.fd File: t1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions ) -LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <14.4> not available -(Font) Font shape `T1/ppl/b/n' tried instead on input line 287. -LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <10.95> not available -(Font) Font shape `T1/ppl/b/n' tried instead on input line 290. - - -Package hyperref Warning: Difference (2) between bookmark levels is greater -(hyperref) than one, level fixed on input line 290. - +LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <12> not available +(Font) Font shape `T1/ppl/b/n' tried instead on input line 288. LaTeX Font Info: Font shape `U/msa/m/n' will be -(Font) scaled to size 11.40997pt on input line 294. +(Font) scaled to size 11.40997pt on input line 290. LaTeX Font Info: Font shape `U/msa/m/n' will be -(Font) scaled to size 8.33606pt on input line 294. +(Font) scaled to size 8.33606pt on input line 290. LaTeX Font Info: Font shape `U/msa/m/n' will be -(Font) scaled to size 6.25204pt on input line 294. +(Font) scaled to size 6.25204pt on input line 290. LaTeX Font Info: Font shape `U/msb/m/n' will be -(Font) scaled to size 11.40997pt on input line 294. +(Font) scaled to size 11.40997pt on input line 290. LaTeX Font Info: Font shape `U/msb/m/n' will be -(Font) scaled to size 8.33606pt on input line 294. +(Font) scaled to size 8.33606pt on input line 290. LaTeX Font Info: Font shape `U/msb/m/n' will be -(Font) scaled to size 6.25204pt on input line 294. -[1 +(Font) scaled to size 6.25204pt on input line 290. + + +File: det_A.png Graphic file (type png) + +Package pdftex.def Info: det_A.png used on input line 294. +(pdftex.def) Requested size: 375.80544pt x 202.3582pt. + [1 + +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./det_A.png>] + +File: midterm_date.png Graphic file (type png) + +Package pdftex.def Info: midterm_date.png used on input line 324. +(pdftex.def) Requested size: 375.80544pt x 171.71808pt. +LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <10.95> not available +(Font) Font shape `T1/ppl/b/n' tried instead on input line 328. +LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <14.4> not available +(Font) Font shape `T1/ppl/b/n' tried instead on input line 342. -{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] -LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <12> not available -(Font) Font shape `T1/ppl/b/n' tried instead on input line 372. -LaTeX Font Info: Try loading font information for TS1+cmtt on input line 387 + +Package hyperref Warning: Difference (2) between bookmark levels is greater +(hyperref) than one, level fixed on input line 345. + +[2 <./midterm_date.png>] [3] +LaTeX Font Info: Try loading font information for TS1+cmtt on input line 461 . (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmtt.fd File: ts1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions -) [2] [3] +) [4] [5] LaTeX Font Info: Font shape `T1/cmtt/bx/n' in size <10.95> not available -(Font) Font shape `T1/cmtt/m/n' tried instead on input line 473. +(Font) Font shape `T1/cmtt/m/n' tried instead on input line 547. - -File: lecture_11_files/lecture_11_6_0.pdf Graphic file (type pdf) + +File: lecture_11_files/lecture_11_8_0.pdf Graphic file (type pdf) - -Package pdftex.def Info: lecture_11_files/lecture_11_6_0.pdf used on input line - 487. + +Package pdftex.def Info: lecture_11_files/lecture_11_8_0.pdf used on input line + 561. (pdftex.def) Requested size: 449.6789pt x 337.25917pt. - [4] -Underfull \hbox (badness 10000) in paragraph at lines 489--490 + +Underfull \hbox (badness 10000) in paragraph at lines 563--564 [] - -File: mass_springs.png Graphic file (type png) - -Package pdftex.def Info: mass_springs.png used on input line 497. -(pdftex.def) Requested size: 89.93611pt x 152.576pt. +<../lecture_09/mass_springs.png, id=80, 112.42pt x 190.7125pt> +File: ../lecture_09/mass_springs.png Graphic file (type png) -[5 <./lecture_11_files/lecture_11_6_0.pdf> <./mass_springs.png>] [6] [7] -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 656. + +Package pdftex.def Info: ../lecture_09/mass_springs.png used on input line 571. -[8] -Package atveryend Info: Empty hook `AfterLastShipout' on input line 656. +(pdftex.def) Requested size: 89.93611pt x 152.576pt. + [6 <./lecture_11_files/lecture_11_8_0.pdf>] [7 <../lecture_09/mass_springs.png +>] [8] +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 734. + [9] +Package atveryend Info: Empty hook `AfterLastShipout' on input line 734. (./lecture_11.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 656. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 656. +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 734. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 734. Package rerunfilecheck Info: File `lecture_11.out' has not changed. -(rerunfilecheck) Checksum: 06B2288B56AA590C3216AAE67971C54B;297. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 656. +(rerunfilecheck) Checksum: 41743ED7C91140C56E53FBD51DB19D65;568. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 734. ) Here is how much of TeX's memory you used: - 10920 strings out of 493029 - 163179 string characters out of 6136234 - 268780 words of memory out of 5000000 - 14206 multiletter control sequences out of 15000+600000 + 10955 strings out of 493029 + 163773 string characters out of 6136234 + 268999 words of memory out of 5000000 + 14228 multiletter control sequences out of 15000+600000 39052 words of font info for 103 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 36i,9n,77p,460b,465s stack positions out of 5000i,500n,10000p,200000b,80000s @@ -817,10 +830,10 @@ hare/texmf/fonts/type1/public/cm-super/sfit1095.pfb> -Output written on lecture_11.pdf (8 pages, 154124 bytes). +Output written on lecture_11.pdf (9 pages, 191934 bytes). PDF statistics: - 117 PDF objects out of 1000 (max. 8388607) - 92 compressed objects within 1 object stream - 14 named destinations out of 1000 (max. 500000) - 43 words of extra memory for PDF output out of 10000 (max. 10000000) + 152 PDF objects out of 1000 (max. 8388607) + 121 compressed objects within 2 object streams + 27 named destinations out of 1000 (max. 500000) + 85 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/lecture_11/lecture_11.out b/lecture_11/lecture_11.out index 41c2cd3..481e738 100644 --- a/lecture_11/lecture_11.out +++ b/lecture_11/lecture_11.out @@ -1,4 +1,8 @@ -\BOOKMARK [1][-]{section.1}{LU Decomposition}{}% 1 -\BOOKMARK [2][-]{subsubsection.1.0.1}{efficient storage of matrices for solutions}{section.1}% 2 -\BOOKMARK [2][-]{subsection.1.1}{Pivoting for LU factorization}{section.1}% 3 -\BOOKMARK [2][-]{subsection.1.2}{Cholesky Factorization}{section.1}% 4 +\BOOKMARK [2][-]{subsection.0.1}{My question from last class}{}% 1 +\BOOKMARK [2][-]{subsection.0.2}{Your questions from last class}{}% 2 +\BOOKMARK [2][-]{subsection.0.3}{Midterm preference}{}% 3 +\BOOKMARK [3][-]{subsubsection.0.3.1}{Midterm Questions}{subsection.0.3}% 4 +\BOOKMARK [1][-]{section.1}{LU Decomposition}{}% 5 +\BOOKMARK [2][-]{subsubsection.1.0.1}{efficient storage of matrices for solutions}{section.1}% 6 +\BOOKMARK [2][-]{subsection.1.1}{Pivoting for LU factorization}{section.1}% 7 +\BOOKMARK [2][-]{subsection.1.2}{Cholesky Factorization}{section.1}% 8 diff --git a/lecture_11/lecture_11.pdf b/lecture_11/lecture_11.pdf index 3e2c828..9fa1342 100644 Binary files a/lecture_11/lecture_11.pdf and b/lecture_11/lecture_11.pdf differ diff --git a/lecture_11/lecture_11.tex b/lecture_11/lecture_11.tex index 22d4064..318852d 100644 --- a/lecture_11/lecture_11.tex +++ b/lecture_11/lecture_11.tex @@ -277,13 +277,68 @@ \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}18}]:} \PY{c}{\PYZpc{}plot \PYZhy{}\PYZhy{}format svg} +{\color{incolor}In [{\color{incolor}1}]:} \PY{c}{\PYZpc{}plot \PYZhy{}\PYZhy{}format svg} \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}19}]:} \PY{n}{setdefaults} +{\color{incolor}In [{\color{incolor}2}]:} \PY{n}{setdefaults} \end{Verbatim} + \subsection{My question from last +class}\label{my-question-from-last-class} + +\(A=\left[ \begin{array}{ccc} 10 & 2 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 10\end{array} \right]\) + +\begin{figure}[htbp] +\centering +\includegraphics{det_A.png} +\caption{responses to determinant of A} +\end{figure} + +\subsection{Your questions from last +class}\label{your-questions-from-last-class} + +\begin{enumerate} +\def\labelenumi{\arabic{enumi}.} +\item + Need more linear algebra review + + -We will keep doing Linear Algebra, try the practice problems in + 'linear\_algebra' +\item + How do I do HW3? + + -demo today +\item + For hw4 is the spring constant (K) suppose to be given? + + -yes, its 30 N/m +\item + Deapool or Joker? +\end{enumerate} + +\subsection{Midterm preference}\label{midterm-preference} + +\begin{figure}[htbp] +\centering +\includegraphics{midterm_date.png} +\caption{responses to midterm date} +\end{figure} + +\subsubsection{Midterm Questions}\label{midterm-questions} + +\begin{enumerate} +\def\labelenumi{\arabic{enumi}.} +\item + Notes allowed + + -no +\item + Will there be a review/study sheet + + -yes +\end{enumerate} + \section{LU Decomposition}\label{lu-decomposition} \subsubsection{efficient storage of matrices for @@ -366,6 +421,25 @@ y = 1 + \end{Verbatim} + + \begin{Verbatim}[commandchars=\\\{\}] +{\color{incolor}In [{\color{incolor}5}]:} \PY{c}{\PYZpc{} what is the determinant of L, U and A?} + + \PY{n+nb}{det}\PY{p}{(}\PY{n}{A}\PY{p}{)} + \PY{n+nb}{det}\PY{p}{(}\PY{n}{L}\PY{p}{)} + \PY{n+nb}{det}\PY{p}{(}\PY{n}{U}\PY{p}{)} + \PY{n+nb}{det}\PY{p}{(}\PY{n}{L}\PY{p}{)}\PY{o}{*}\PY{n+nb}{det}\PY{p}{(}\PY{n}{U}\PY{p}{)} + \PY{n+nb}{det}\PY{p}{(}\PY{n}{L}\PY{o}{*}\PY{n}{U}\PY{p}{)} +\end{Verbatim} + + \begin{Verbatim}[commandchars=\\\{\}] +ans = 5.0000 +ans = 1 +ans = 5 +ans = 5 +ans = 5.0000 + \end{Verbatim} \subsection{Pivoting for LU @@ -467,24 +541,24 @@ mailing list. \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}22}]:} \PY{c}{\PYZpc{} time LU solution vs backslash} - \PY{n}{t\PYZus{}lu}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{100}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} - \PY{n}{t\PYZus{}bs}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{100}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} - \PY{k}{for} \PY{n}{N}\PY{p}{=}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100} - \PY{n}{A}\PY{p}{=}\PY{n+nb}{rand}\PY{p}{(}\PY{n}{N}\PY{p}{,}\PY{n}{N}\PY{p}{)}\PY{p}{;} - \PY{n}{y}\PY{p}{=}\PY{n+nb}{rand}\PY{p}{(}\PY{n}{N}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} - \PY{p}{[}\PY{n}{L}\PY{p}{,}\PY{n}{U}\PY{p}{,}\PY{n}{P}\PY{p}{]}\PY{p}{=}\PY{n+nb}{lu}\PY{p}{(}\PY{n}{A}\PY{p}{)}\PY{p}{;} - - \PY{n+nb}{tic}\PY{p}{;} \PY{n}{d}\PY{p}{=}\PY{n}{L}\PY{o}{\PYZbs{}}\PY{n}{y}\PY{p}{;} \PY{n}{x}\PY{p}{=}\PY{n}{U}\PY{o}{\PYZbs{}}\PY{n}{d}\PY{p}{;} \PY{n}{t\PYZus{}lu}\PY{p}{(}\PY{n}{N}\PY{p}{)}\PY{p}{=}\PY{n+nb}{toc}\PY{p}{;} - - \PY{n+nb}{tic}\PY{p}{;} \PY{n}{x}\PY{p}{=}\PY{n}{A}\PY{o}{\PYZbs{}}\PY{n}{y}\PY{p}{;} \PY{n}{t\PYZus{}bs}\PY{p}{(}\PY{n}{N}\PY{p}{)}\PY{p}{=}\PY{n+nb}{toc}\PY{p}{;} - \PY{k}{end} - \PY{n+nb}{plot}\PY{p}{(}\PY{p}{[}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100}\PY{p}{]}\PY{p}{,}\PY{n}{t\PYZus{}lu}\PY{p}{,}\PY{p}{[}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100}\PY{p}{]}\PY{p}{,}\PY{n}{t\PYZus{}bs}\PY{p}{)} - \PY{n+nb}{legend}\PY{p}{(}\PY{l+s}{\PYZsq{}}\PY{l+s}{LU decomp\PYZsq{}}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{Octave \PYZbs{}\PYZbs{}\PYZsq{}}\PY{p}{)} +{\color{incolor}In [{\color{incolor}9}]:} \PY{c}{\PYZpc{} time LU solution vs backslash} + \PY{n}{t\PYZus{}lu}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{100}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} + \PY{n}{t\PYZus{}bs}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{100}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} + \PY{k}{for} \PY{n}{N}\PY{p}{=}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100} + \PY{n}{A}\PY{p}{=}\PY{n+nb}{rand}\PY{p}{(}\PY{n}{N}\PY{p}{,}\PY{n}{N}\PY{p}{)}\PY{p}{;} + \PY{n}{y}\PY{p}{=}\PY{n+nb}{rand}\PY{p}{(}\PY{n}{N}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} + \PY{p}{[}\PY{n}{L}\PY{p}{,}\PY{n}{U}\PY{p}{,}\PY{n}{P}\PY{p}{]}\PY{p}{=}\PY{n+nb}{lu}\PY{p}{(}\PY{n}{A}\PY{p}{)}\PY{p}{;} + + \PY{n+nb}{tic}\PY{p}{;} \PY{n}{d}\PY{p}{=}\PY{n+nb}{inv}\PY{p}{(}\PY{n}{L}\PY{p}{)}\PY{o}{*}\PY{n}{y}\PY{p}{;} \PY{n}{x}\PY{p}{=}\PY{n+nb}{inv}\PY{p}{(}\PY{n}{U}\PY{p}{)}\PY{o}{*}\PY{n}{d}\PY{p}{;} \PY{n}{t\PYZus{}lu}\PY{p}{(}\PY{n}{N}\PY{p}{)}\PY{p}{=}\PY{n+nb}{toc}\PY{p}{;} + + \PY{n+nb}{tic}\PY{p}{;} \PY{n}{x}\PY{p}{=}\PY{n+nb}{inv}\PY{p}{(}\PY{n}{A}\PY{p}{)}\PY{o}{*}\PY{n}{y}\PY{p}{;} \PY{n}{t\PYZus{}bs}\PY{p}{(}\PY{n}{N}\PY{p}{)}\PY{p}{=}\PY{n+nb}{toc}\PY{p}{;} + \PY{k}{end} + \PY{n+nb}{plot}\PY{p}{(}\PY{p}{[}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100}\PY{p}{]}\PY{p}{,}\PY{n}{t\PYZus{}lu}\PY{p}{,}\PY{p}{[}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{100}\PY{p}{]}\PY{p}{,}\PY{n}{t\PYZus{}bs}\PY{p}{)} + \PY{n+nb}{legend}\PY{p}{(}\PY{l+s}{\PYZsq{}}\PY{l+s}{LU decomp\PYZsq{}}\PY{p}{,}\PY{l+s}{\PYZsq{}}\PY{l+s}{Octave \PYZbs{}\PYZbs{}\PYZsq{}}\PY{p}{)} \end{Verbatim} \begin{center} - \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{lecture_11_files/lecture_11_6_0.pdf} + \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{lecture_11_files/lecture_11_8_0.pdf} \end{center} { \hspace*{\fill} \\} @@ -494,7 +568,7 @@ positions of the masses? \begin{figure}[htbp] \centering -\includegraphics{mass_springs.png} +\includegraphics{../lecture_09/mass_springs.png} \caption{Springs-masses} \end{figure} @@ -514,7 +588,7 @@ in matrix form: \(\left[ \begin{array}{cccc} 2k & -k & 0 & 0 \\ -k & 2k & -k & 0 \\ 0 & -k & 2k & -k \\ 0 & 0 & -k & k \end{array} \right] \left[ \begin{array}{c} x_{1} \\ x_{2} \\ x_{3} \\ x_{4} \end{array} \right]= \left[ \begin{array}{c} m_{1}g \\ m_{2}g \\ m_{3}g \\ m_{4}g \end{array} \right]\) \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}24}]:} \PY{n}{k}\PY{p}{=}\PY{l+m+mi}{10}\PY{p}{;} \PY{c}{\PYZpc{} N/m} +{\color{incolor}In [{\color{incolor}10}]:} \PY{n}{k}\PY{p}{=}\PY{l+m+mi}{10}\PY{p}{;} \PY{c}{\PYZpc{} N/m} \PY{n}{m1}\PY{p}{=}\PY{l+m+mi}{1}\PY{p}{;} \PY{c}{\PYZpc{} kg} \PY{n}{m2}\PY{p}{=}\PY{l+m+mi}{2}\PY{p}{;} \PY{n}{m3}\PY{p}{=}\PY{l+m+mi}{3}\PY{p}{;} @@ -565,7 +639,7 @@ equations: so for K \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}25}]:} \PY{n}{K} +{\color{incolor}In [{\color{incolor}11}]:} \PY{n}{K} \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] @@ -580,7 +654,7 @@ K = \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}26}]:} \PY{n}{u11}\PY{p}{=}\PY{n+nb}{sqrt}\PY{p}{(}\PY{n}{K}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{)} +{\color{incolor}In [{\color{incolor}12}]:} \PY{n}{u11}\PY{p}{=}\PY{n+nb}{sqrt}\PY{p}{(}\PY{n}{K}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{)} \PY{n}{u12}\PY{p}{=}\PY{p}{(}\PY{n}{K}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{,}\PY{l+m+mi}{2}\PY{p}{)}\PY{p}{)}\PY{o}{/}\PY{n}{u11} \PY{n}{u13}\PY{p}{=}\PY{p}{(}\PY{n}{K}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{,}\PY{l+m+mi}{3}\PY{p}{)}\PY{p}{)}\PY{o}{/}\PY{n}{u11} \PY{n}{u14}\PY{p}{=}\PY{p}{(}\PY{n}{K}\PY{p}{(}\PY{l+m+mi}{1}\PY{p}{,}\PY{l+m+mi}{4}\PY{p}{)}\PY{p}{)}\PY{o}{/}\PY{n}{u11} @@ -615,22 +689,22 @@ U = \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}27}]:} \PY{n}{U}\PY{o}{\PYZsq{}}\PY{o}{*}\PY{n}{U} +{\color{incolor}In [{\color{incolor}17}]:} \PY{p}{(}\PY{n}{U}\PY{o}{\PYZsq{}}\PY{o}{*}\PY{n}{U}\PY{p}{)}\PY{o}{\PYZsq{}}\PY{o}{==}\PY{n}{U}\PY{o}{\PYZsq{}}\PY{o}{*}\PY{n}{U} \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] ans = - 20.00000 -10.00000 0.00000 0.00000 - -10.00000 20.00000 -10.00000 0.00000 - 0.00000 -10.00000 20.00000 -10.00000 - 0.00000 0.00000 -10.00000 10.00000 + 1 1 1 1 + 1 1 1 1 + 1 1 1 1 + 1 1 1 1 \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -{\color{incolor}In [{\color{incolor}37}]:} \PY{c}{\PYZpc{} time solution for Cholesky vs backslash} +{\color{incolor}In [{\color{incolor}18}]:} \PY{c}{\PYZpc{} time solution for Cholesky vs backslash} \PY{n}{t\PYZus{}chol}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{1000}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} \PY{n}{t\PYZus{}bs}\PY{p}{=}\PY{n+nb}{zeros}\PY{p}{(}\PY{l+m+mi}{1000}\PY{p}{,}\PY{l+m+mi}{1}\PY{p}{)}\PY{p}{;} \PY{k}{for} \PY{n}{i}\PY{p}{=}\PY{l+m+mi}{1}\PY{p}{:}\PY{l+m+mi}{1000} @@ -643,11 +717,15 @@ ans = \end{Verbatim} \begin{Verbatim}[commandchars=\\\{\}] -average time spent for Cholesky factored solution = 1.623154e-05+/-1.166726e-05 -average time spent for backslash solution = 1.675844e-05+/-1.187234e-05 +average time spent for Cholesky factored solution = 1.465964e-05+/-9.806001e-06 +average time spent for backslash solution = 1.555967e-05+/-1.048561e-05 \end{Verbatim} + \begin{Verbatim}[commandchars=\\\{\}] +{\color{incolor}In [{\color{incolor} }]:} +\end{Verbatim} + % Add a bibliography block to the postdoc diff --git a/lecture_11/lecture_11_files/lecture_11_8_0.pdf b/lecture_11/lecture_11_files/lecture_11_8_0.pdf new file mode 100644 index 0000000..7f562c6 Binary files /dev/null and b/lecture_11/lecture_11_files/lecture_11_8_0.pdf differ diff --git a/lecture_11/lecture_11_files/lecture_11_8_0.svg b/lecture_11/lecture_11_files/lecture_11_8_0.svg new file mode 100644 index 0000000..37a1c3f --- /dev/null +++ b/lecture_11/lecture_11_files/lecture_11_8_0.svg @@ -0,0 +1,139 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0.0005 + + + + + 0.001 + + + + + 0.0015 + + + + + 0.002 + + + + + 0 + + + + + 20 + + + + + 40 + + + + + 60 + + + + + 80 + + + + + 100 + + + + + + + + + + + + + LU decomp + + + + + LU decomp + + + + + + Octave \\ + + + Octave \ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_11/octave-workspace b/lecture_11/octave-workspace index e69de29..8c437bb 100644 Binary files a/lecture_11/octave-workspace and b/lecture_11/octave-workspace differ