day1/session6.tex
changeset 337 56aa2efbf7d9
parent 330 46533051b9d3
child 339 8ac5fe07810f
equal deleted inserted replaced
335:45bcdc34bf73 337:56aa2efbf7d9
   214 
   214 
   215 \begin{frame}[fragile]
   215 \begin{frame}[fragile]
   216 \frametitle{Scipy Methods - \typ{roots}}
   216 \frametitle{Scipy Methods - \typ{roots}}
   217 \begin{itemize}
   217 \begin{itemize}
   218 \item Calculates the roots of polynomials
   218 \item Calculates the roots of polynomials
   219 \end{itemize}
   219 \item To calculate the roots of $x^2-5x+6$ 
   220 \begin{lstlisting}
   220 \end{itemize}
   221   In []: coeffs = [1, 6, 13]
   221 \begin{lstlisting}
       
   222   In []: coeffs = [1, -5, 6]
   222   In []: roots(coeffs)
   223   In []: roots(coeffs)
   223 \end{lstlisting}
   224   Out[]: array([3., 2.])
       
   225 \end{lstlisting}
       
   226 \vspace*{-.2in}
       
   227 \begin{center}
       
   228 \includegraphics[height=1.6in, interpolate=true]{data/roots}    
       
   229 \end{center}
   224 \end{frame}
   230 \end{frame}
   225 
   231 
   226 \begin{frame}[fragile]
   232 \begin{frame}[fragile]
   227 \frametitle{Scipy Methods - \typ{fsolve}}
   233 \frametitle{Scipy Methods - \typ{fsolve}}
   228 \begin{small}
   234 \begin{small}
   289 Find the root of $sin(x)+cos^2(x)$ nearest to $0$
   295 Find the root of $sin(x)+cos^2(x)$ nearest to $0$
   290 \begin{lstlisting}
   296 \begin{lstlisting}
   291 In []: fsolve(f, 0)
   297 In []: fsolve(f, 0)
   292 Out[]: -0.66623943249251527
   298 Out[]: -0.66623943249251527
   293 \end{lstlisting}
   299 \end{lstlisting}
       
   300 \begin{center}
       
   301 \includegraphics[height=2in, interpolate=true]{data/fsolve}    
       
   302 \end{center}
   294 \end{frame}
   303 \end{frame}
   295 
   304 
   296 %% \begin{frame}[fragile]
   305 %% \begin{frame}[fragile]
   297 %% \frametitle{Scipy Methods \dots}
   306 %% \frametitle{Scipy Methods \dots}
   298 %% \begin{small}
   307 %% \begin{small}