author | asokan <asokan@fossee.in> |
Tue, 18 May 2010 15:40:17 +0530 | |
changeset 126 | 2eac725a5766 |
parent 90 | 314a711c042f |
permissions | -rw-r--r-- |
85 | 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2 |
%Tutorial slides on Python. |
|
3 |
% |
|
4 |
% Author: FOSSEE |
|
5 |
% Copyright (c) 2009, FOSSEE, IIT Bombay |
|
6 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
7 |
||
8 |
\documentclass[14pt,compress]{beamer} |
|
9 |
%\documentclass[draft]{beamer} |
|
10 |
%\documentclass[compress,handout]{beamer} |
|
11 |
%\usepackage{pgfpages} |
|
12 |
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] |
|
13 |
||
14 |
% Modified from: generic-ornate-15min-45min.de.tex |
|
15 |
\mode<presentation> |
|
16 |
{ |
|
17 |
\usetheme{Warsaw} |
|
18 |
\useoutertheme{infolines} |
|
19 |
\setbeamercovered{transparent} |
|
20 |
} |
|
21 |
||
22 |
\usepackage[english]{babel} |
|
23 |
\usepackage[latin1]{inputenc} |
|
24 |
%\usepackage{times} |
|
25 |
\usepackage[T1]{fontenc} |
|
26 |
||
27 |
% Taken from Fernando's slides. |
|
28 |
\usepackage{ae,aecompl} |
|
29 |
\usepackage{mathpazo,courier,euler} |
|
30 |
\usepackage[scaled=.95]{helvet} |
|
31 |
||
32 |
\definecolor{darkgreen}{rgb}{0,0.5,0} |
|
33 |
||
34 |
\usepackage{listings} |
|
35 |
\lstset{language=Python, |
|
36 |
basicstyle=\ttfamily\bfseries, |
|
37 |
commentstyle=\color{red}\itshape, |
|
38 |
stringstyle=\color{darkgreen}, |
|
39 |
showstringspaces=false, |
|
40 |
keywordstyle=\color{blue}\bfseries} |
|
41 |
||
42 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
43 |
% Macros |
|
44 |
\setbeamercolor{emphbar}{bg=blue!20, fg=black} |
|
45 |
\newcommand{\emphbar}[1] |
|
46 |
{\begin{beamercolorbox}[rounded=true]{emphbar} |
|
47 |
{#1} |
|
48 |
\end{beamercolorbox} |
|
49 |
} |
|
50 |
\newcounter{time} |
|
51 |
\setcounter{time}{0} |
|
52 |
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} |
|
53 |
||
54 |
\newcommand{\typ}[1]{\lstinline{#1}} |
|
55 |
||
56 |
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } |
|
57 |
||
58 |
% Title page |
|
86 | 59 |
\title{Python for Scientific Computing: Ordinary Differential Equation} |
85 | 60 |
|
61 |
\author[FOSSEE] {FOSSEE} |
|
62 |
||
63 |
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
|
64 |
\date{} |
|
65 |
||
66 |
% DOCUMENT STARTS |
|
67 |
\begin{document} |
|
68 |
||
69 |
\begin{frame} |
|
70 |
\maketitle |
|
71 |
\end{frame} |
|
72 |
||
73 |
\begin{frame} |
|
74 |
\frametitle{About the Session} |
|
75 |
\begin{block}{Goal} |
|
76 |
Solving ordinary differential equations. |
|
77 |
\end{block} |
|
78 |
\begin{block}{Prerequisite} |
|
79 |
\begin{itemize} |
|
80 |
\item Understanding of Arrays. |
|
87
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
81 |
\item functions and lists |
85 | 82 |
\end{itemize} |
83 |
\end{block} |
|
84 |
\end{frame} |
|
85 |
||
86 |
\begin{frame}[fragile] |
|
87
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
87 |
\frametitle{Solving ODEs using SciPy} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
88 |
\begin{itemize} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
89 |
\item Let's consider the spread of an epidemic in a population |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
90 |
\item $\frac{dy}{dt} = ky(L-y)$ gives the spread of the disease |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
91 |
\item L is the total population. |
90 | 92 |
\item Use L = 250000, k = 0.00003, y(0) = 250 |
87
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
93 |
\end{itemize} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
94 |
\end{frame} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
95 |
|
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
96 |
\begin{frame}[fragile] |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
97 |
\frametitle{ODEs - Simple Pendulum} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
98 |
We shall use the simple ODE of a simple pendulum. |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
99 |
\begin{equation*} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
100 |
\ddot{\theta} = -\frac{g}{L}sin(\theta) |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
101 |
\end{equation*} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
102 |
\begin{itemize} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
103 |
\item This equation can be written as a system of two first order ODEs |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
104 |
\end{itemize} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
105 |
\begin{align} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
106 |
\dot{\theta} &= \omega \\ |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
107 |
\dot{\omega} &= -\frac{g}{L}sin(\theta) \\ |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
108 |
\text{At}\ t &= 0 : \nonumber \\ |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
109 |
\theta = \theta_0(10^o)\quad & \&\quad \omega = 0\ (Initial\ values)\nonumber |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
110 |
\end{align} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
111 |
\end{frame} |
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
112 |
|
62be6012121f
Added changes to ode presentation.
Shantanu <shantanu@fossee.in>
parents:
86
diff
changeset
|
113 |
\begin{frame}[fragile] |
85 | 114 |
\frametitle{Summary} |
115 |
\begin{block}{} |
|
86 | 116 |
Solving ordinary differential equations |
117 |
\end{block} |
|
85 | 118 |
\end{frame} |
119 |
||
120 |
\begin{frame} |
|
121 |
\frametitle{Thank you!} |
|
122 |
\begin{block}{} |
|
123 |
This session is part of \textcolor{blue}{FOSSEE} project funded by: |
|
124 |
\begin{center} |
|
125 |
\textcolor{blue}{NME through ICT from MHRD, Govt. of India}. |
|
126 |
\end{center} |
|
127 |
\end{block} |
|
128 |
\end{frame} |
|
129 |
||
130 |
\end{document} |