115
|
1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
2 |
% Tutorial slides on Python.
|
|
3 |
%
|
|
4 |
% Author: Prabhu Ramachandran <prabhu at aero.iitb.ac.in>
|
|
5 |
% Copyright (c) 2005-2009, Prabhu Ramachandran
|
|
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{split}
|
|
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 |
%%% This is from Fernando's setup.
|
|
59 |
% \usepackage{color}
|
|
60 |
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
|
|
61 |
% % Use and configure listings package for nicely formatted code
|
|
62 |
% \usepackage{listings}
|
|
63 |
% \lstset{
|
|
64 |
% language=Python,
|
|
65 |
% basicstyle=\small\ttfamily,
|
|
66 |
% commentstyle=\ttfamily\color{blue},
|
|
67 |
% stringstyle=\ttfamily\color{orange},
|
|
68 |
% showstringspaces=false,
|
|
69 |
% breaklines=true,
|
|
70 |
% postbreak = \space\dots
|
|
71 |
% }
|
|
72 |
|
|
73 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
74 |
% Title page
|
|
75 |
\title[]{Arrays \& Least Squares Fit}
|
|
76 |
|
|
77 |
\author[FOSSEE] {FOSSEE}
|
|
78 |
|
|
79 |
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
|
|
80 |
\date[] {31, October 2009}
|
|
81 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
82 |
|
|
83 |
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
|
|
84 |
%\logo{\pgfuseimage{iitmlogo}}
|
|
85 |
|
|
86 |
|
|
87 |
%% Delete this, if you do not want the table of contents to pop up at
|
|
88 |
%% the beginning of each subsection:
|
|
89 |
\AtBeginSubsection[]
|
|
90 |
{
|
|
91 |
\begin{frame}<beamer>
|
|
92 |
\frametitle{Outline}
|
|
93 |
\tableofcontents[currentsection,currentsubsection]
|
|
94 |
\end{frame}
|
|
95 |
}
|
|
96 |
|
|
97 |
\AtBeginSection[]
|
|
98 |
{
|
|
99 |
\begin{frame}<beamer>
|
|
100 |
\frametitle{Outline}
|
|
101 |
\tableofcontents[currentsection,currentsubsection]
|
|
102 |
\end{frame}
|
|
103 |
}
|
|
104 |
|
|
105 |
\newcommand{\num}{\texttt{numpy}}
|
|
106 |
|
|
107 |
|
|
108 |
% If you wish to uncover everything in a step-wise fashion, uncomment
|
|
109 |
% the following command:
|
|
110 |
%\beamerdefaultoverlayspecification{<+->}
|
|
111 |
|
|
112 |
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
|
|
113 |
|
|
114 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
115 |
% DOCUMENT STARTS
|
|
116 |
\begin{document}
|
|
117 |
|
|
118 |
\begin{frame}
|
|
119 |
\maketitle
|
|
120 |
\end{frame}
|
|
121 |
|
|
122 |
%% \begin{frame}
|
|
123 |
%% \frametitle{Outline}
|
|
124 |
%% \tableofcontents
|
|
125 |
%% % You might wish to add the option [pausesections]
|
|
126 |
%% \end{frame}
|
|
127 |
|
|
128 |
\begin{frame}
|
|
129 |
\frametitle{Least Squares Fit}
|
|
130 |
In this session -
|
|
131 |
\begin{itemize}
|
|
132 |
\item We shall plot a least squares fit curve for time-period(T) squared vs. length(L) plot of a Simple Pendulum.
|
|
133 |
\item Given a file containing L and T values
|
|
134 |
\end{itemize}
|
|
135 |
\end{frame}
|
|
136 |
|
|
137 |
\begin{frame}
|
|
138 |
\frametitle{Least Squares Fit \ldots}
|
|
139 |
Machinery Required -
|
|
140 |
\begin{itemize}
|
|
141 |
\item Reading files and parsing data
|
|
142 |
\item Plotting points, lines
|
|
143 |
\item Calculating the Coefficients of the Least Squares Fit curve
|
|
144 |
\begin{itemize}
|
|
145 |
\item Arrays
|
|
146 |
\end{itemize}
|
|
147 |
\end{itemize}
|
|
148 |
\end{frame}
|
|
149 |
|
|
150 |
\begin{frame}
|
|
151 |
\frametitle{Arrays}
|
|
152 |
\end{frame}
|
|
153 |
|
|
154 |
\end{document}
|
|
155 |
|
|
156 |
Least squares: Smooth curve fit.
|
|
157 |
Array Operations: Mean, average (etc region wise like district wise and state wise from SSLC.txt)
|
|
158 |
Subject wise average. Introduce idea of dictionary.
|
|
159 |
|
|
160 |
Session 3
|
|
161 |
|
|
162 |
import scipy
|
|
163 |
from scipy import linalg.
|
|
164 |
|
|
165 |
choose some meaningful plot. ??
|
|
166 |
Newton's law of cooling.
|
|
167 |
u, v, f - optics
|
|
168 |
hooke's law
|
|
169 |
Least fit curves.
|
|
170 |
|
|
171 |
|
|
172 |
Choose a named problem.
|
|
173 |
ODE - first order. Whatever.
|
|
174 |
|
|
175 |
|
|
176 |
arrays, etc etc.
|
|
177 |
sum, average, mean. whatever. statistical
|
|
178 |
sslc data
|
|
179 |
numpy load text??
|