summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--day2/session2.tex6
1 files changed, 2 insertions, 4 deletions
diff --git a/day2/session2.tex b/day2/session2.tex
index f93b02f..0f471f5 100644
--- a/day2/session2.tex
+++ b/day2/session2.tex
@@ -338,12 +338,12 @@
Numerically solve ODEs\\
\begin{align*}
\frac{dx}{dt}&=-e^{-t}x^2\\
- x(0)&=2
+ x&=2 \quad at \ t=0
\end{align*}
\begin{lstlisting}
>>> def dx_dt(x,t):
return -np.exp(-t)*x**2
-
+>>> t=np.linspace(0,2,100)
>>> x=integrate.odeint(dx_dt, 2, t)
>>> plt.plot(x,t)
\end{lstlisting}
@@ -372,8 +372,6 @@
\frametitle{Interpolation - Splines}
Plot the Cubic Spline of $sin(x)$
\begin{lstlisting}
->>> x = np.arange(0,2*np.pi,np.pi/4)
->>> y = np.sin(x)
>>> tck = interpolate.splrep(x,y)
>>> X = np.arange(0,2*np.pi,np.pi/50)
>>> Y = interpolate.splev(X,tck,der=0)