equal
deleted
inserted
replaced
145 \inctime{5} |
145 \inctime{5} |
146 \end{frame} |
146 \end{frame} |
147 |
147 |
148 \begin{frame}[fragile] |
148 \begin{frame}[fragile] |
149 \frametitle{Problem set 4} |
149 \frametitle{Problem set 4} |
150 Finite difference |
150 Central difference |
151 \begin{equation*} |
151 \begin{equation*} |
152 \frac{sin(x+h)-sin(x)}{h} |
152 \frac{sin(x+h)-sin(x-h)}{2h} |
153 \end{equation*} |
153 \end{equation*} |
154 \begin{lstlisting} |
154 \begin{lstlisting} |
155 >>> x = linspace(0,2*pi,100) |
155 In []: x = linspace(0, 2*pi, 100) |
156 >>> y = sin(x) |
156 In []: y = sin(x) |
157 >>> deltax = x[1] - x[0] |
157 In []: deltax = x[1] - x[0] |
158 \end{lstlisting} |
158 \end{lstlisting} |
159 \pause |
159 \pause |
160 \begin{enumerate} |
160 \begin{enumerate} |
161 \item Given this, get the finite difference of sin in the range 0 to 2*pi |
161 \item Given this, get the finite difference of sin in the range 0 to 2*pi |
162 \end{enumerate} |
162 \end{enumerate} |