day1/session6.tex
changeset 265 ac31e2f3754e
parent 258 8d5ac98e3247
child 266 28d4714a9702
--- a/day1/session6.tex	Sat Oct 31 01:23:23 2009 +0530
+++ b/day1/session6.tex	Wed Nov 04 09:33:37 2009 +0530
@@ -138,7 +138,7 @@
 \dot{\theta} &= \omega \\
 \dot{\omega} &= -\frac{g}{L}sin(\theta) \\
  \text{At}\ t &= 0 : \nonumber \\
- \theta = \theta_0\quad & \&\quad  \omega = 0 \nonumber
+ \theta = \theta_0(10^o)\quad & \&\quad  \omega = 0\ (Initial\ values)\nonumber 
 \end{align}
 \end{frame}
 
@@ -149,9 +149,9 @@
 \item Define a function as below
 \end{itemize}
 \begin{lstlisting}
-In []: def pend_int(unknown, t, p):
-  ....     theta, omega = unknown
-  ....     g, L = p
+In []: def pend_int(initial, t):
+  ....     theta, omega = initial
+  ....     g, L = -9.81, 0.2
   ....     f=[omega, -(g/L)*sin(theta)]
   ....     return f
   ....
@@ -162,25 +162,22 @@
 \frametitle{Solving ODEs using SciPy \ldots}
 \begin{itemize}
 \item \typ{t} is the time variable \\ 
-\item \typ{p} has the constants \\
 \item \typ{initial} has the initial values
 \end{itemize}
 \begin{lstlisting}
 In []: t = linspace(0, 10, 101)
-In []: p=(-9.81, 0.2)
 In []: initial = [10*2*pi/360, 0]
-\end{lstlisting}
+\end{lstlisting} 
 \end{frame}
 
 \begin{frame}[fragile]
 \frametitle{Solving ODEs using SciPy \ldots}
-\begin{small}
-  \typ{In []: from scipy.integrate import odeint}
-\end{small}
+%%\begin{small}
+\typ{In []: from scipy.integrate import odeint}
+%%\end{small}
 \begin{lstlisting}
 In []: pend_sol = odeint(pend_int, 
-                         initial,t, 
-                         args=(p,))
+                         initial,t)
 \end{lstlisting}
 \end{frame}
 
@@ -308,14 +305,13 @@
 \begin{frame}[fragile]
 \frametitle{Initial Estimates \ldots}
 \begin{lstlisting}
-  In []: def our_f(x):
-   ....:     return cos(x)-x**2
-   ....: 
-  In []: x = linspace(-pi/2, pi/2, 11)
+In []: def our_f(x):
+ ....:     return cos(x) - x*x
+ ....: 
+In []: x = linspace(-pi/2, pi/2, 11)
+In []: y = our_f(x)
 \end{lstlisting}
-\begin{itemize}
-\item Get the intervals of x, where sign changes occur
-\end{itemize}
+Get the intervals of x, where sign changes occur
 \end{frame}
 
 \begin{frame}[fragile]
@@ -335,7 +331,6 @@
 \frametitle{Scipy Methods - \typ{roots}}
 \begin{itemize}
 \item Calculates the roots of polynomials
-\item Array of coefficients is the only parameter
 \end{itemize}
 \begin{lstlisting}
   In []: coeffs = [1, 6, 13]