day1/session6.tex
changeset 379 682b6f66fe11
parent 378 2299700a8b97
child 382 41c34770d63a
equal deleted inserted replaced
378:2299700a8b97 379:682b6f66fe11
   309 \begin{center}
   309 \begin{center}
   310 \includegraphics[height=2in, interpolate=true]{data/fsolve}    
   310 \includegraphics[height=2in, interpolate=true]{data/fsolve}    
   311 \end{center}
   311 \end{center}
   312 \end{frame}
   312 \end{frame}
   313 
   313 
       
   314 \begin{frame}[fragile]
       
   315   \frametitle{Exercise Problem}
       
   316   Find the root of the equation $x^2 - sin(x) + cos^2(x)$ nearest to $0$
       
   317 \end{frame}
       
   318 
       
   319 \begin{frame}[fragile]
       
   320   \frametitle{Solution}
       
   321   \begin{small}
       
   322   \begin{lstlisting}
       
   323     def f(x):
       
   324         return x**2 - sin(x) + cos(x)*cos(x)
       
   325     fsolve(f, 0)
       
   326   \end{lstlisting}
       
   327   \end{small}
       
   328   \begin{center}
       
   329 \includegraphics[height=2in, interpolate=true]{data/fsolve_tanx}
       
   330   \end{center}
       
   331 \end{frame}
       
   332 
   314 %% \begin{frame}[fragile]
   333 %% \begin{frame}[fragile]
   315 %% \frametitle{Scipy Methods \dots}
   334 %% \frametitle{Scipy Methods \dots}
   316 %% \begin{small}
   335 %% \begin{small}
   317 %% \begin{lstlisting}
   336 %% \begin{lstlisting}
   318 %% In []: from scipy.optimize import fixed_point
   337 %% In []: from scipy.optimize import fixed_point