summaryrefslogtreecommitdiff
path: root/day1/session6.tex
diff options
context:
space:
mode:
Diffstat (limited to 'day1/session6.tex')
-rwxr-xr-xday1/session6.tex19
1 files changed, 19 insertions, 0 deletions
diff --git a/day1/session6.tex b/day1/session6.tex
index b7d1422..61b536c 100755
--- a/day1/session6.tex
+++ b/day1/session6.tex
@@ -311,6 +311,25 @@ Out[]: -0.66623943249251527
\end{center}
\end{frame}
+\begin{frame}[fragile]
+ \frametitle{Exercise Problem}
+ Find the root of the equation $x^2 - sin(x) + cos^2(x)$ nearest to $0$
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Solution}
+ \begin{small}
+ \begin{lstlisting}
+ def f(x):
+ return x**2 - sin(x) + cos(x)*cos(x)
+ fsolve(f, 0)
+ \end{lstlisting}
+ \end{small}
+ \begin{center}
+\includegraphics[height=2in, interpolate=true]{data/fsolve_tanx}
+ \end{center}
+\end{frame}
+
%% \begin{frame}[fragile]
%% \frametitle{Scipy Methods \dots}
%% \begin{small}