plotting-data/slides.org
changeset 457 68813d8d80fb
parent 434 c8ffd52305ff
equal deleted inserted replaced
456:be96dc6c9743 457:68813d8d80fb
     1 #+LaTeX_CLASS: beamer
     1 #+LaTeX_CLASS: beamer
     2 #+LaTeX_CLASS_OPTIONS: [presentation]
     2 #+LaTeX_CLASS_OPTIONS: [presentation]
     3 #+BEAMER_FRAME_LEVEL: 1
     3 #+BEAMER_FRAME_LEVEL: 1
     4 
     4 
     5 #+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
     5 #+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
     6 #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
     6 #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
     7 #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
     7 #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
     8 #+OPTIONS:   H:5 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
     8 
       
     9 #+LaTeX_CLASS: beamer
       
    10 #+LaTeX_CLASS_OPTIONS: [presentation]
       
    11 
       
    12 #+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
       
    13 #+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
       
    14 
       
    15 #+LaTeX_HEADER: \usepackage{listings}
       
    16 
       
    17 #+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
       
    18 #+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
       
    19 #+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
     9 
    20 
    10 #+TITLE: Plotting Experimental Data
    21 #+TITLE: Plotting Experimental Data
    11 #+AUTHOR: FOSSEE
    22 #+AUTHOR: FOSSEE
    12 #+DATE: 2010-09-14 Tue
    23 #+DATE: 2010-09-14 Tue
    13 #+EMAIL:     info@fossee.in
    24 #+EMAIL:     info@fossee.in
    14 
    25 
    15 # \author[FOSSEE] {FOSSEE}
    26 #+DESCRIPTION: 
    16 
    27 #+KEYWORDS: 
    17 # \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    28 #+LANGUAGE:  en
    18 # \date{}
    29 #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
    19 
    30 #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
    20 * Tutorial Plan 
    31 
    21 ** Plotting Experiment Data and Error Bars 
    32 * Outline 
    22 * Pre-requisites 
    33    - Defining sequence of numbers
    23 ** Plotting simple analytical Functions 
    34    - Squaring sequence of numbers
    24 * plot L vs. T^2 
    35    - Plotting Data Points
       
    36    - Indicating Error through Errorbars
       
    37 
       
    38 * Simple Pendulum Data
    25 
    39 
    26 #+ORGTBL: L vs T^2 orgtbl-to-latex
    40 #+ORGTBL: L vs T^2 orgtbl-to-latex
    27 
    41 
    28   | L   | T    |
    42   | L   | T    |
    29   | 0.1 | 0.69 |
    43   | 0.1 | 0.69 |
    34   | 0.6 | 1.58 |
    48   | 0.6 | 1.58 |
    35   | 0.7 | 1.77 |
    49   | 0.7 | 1.77 |
    36   | 0.8 | 1.83 |
    50   | 0.8 | 1.83 |
    37   | 0.9 | 1.94 |
    51   | 0.9 | 1.94 |
    38   
    52   
    39   
       
    40 
       
    41 
    53 
    42 * Initializing L & T
    54 * Initializing L & T
    43   : In []: L = [0.1, 0.2, 0.3, 0.4, 0.5,
    55   : L = [0.1, 0.2, 0.3, 0.4, 0.5,
    44   :            0.6, 0.7, 0.8, 0.9]
    56   :      0.6, 0.7, 0.8, 0.9]
    45   : In []: t = [0.69, 0.90, 1.19,
    57   : t = [0.69, 0.90, 1.19,
    46   :             1.30, 1.47, 1.58,
    58   :      1.30, 1.47, 1.58,
    47   :            1.77, 1.83, 1.94]
    59   :      1.77, 1.83, 1.94]
    48 * square()
    60 
    49   : In []: tsquare=square(t)
    61 
    50   
    62 
    51   : array([ 0.4761,  0.81  ,  1.4161,  1.69  ,  2.1609,  2.4964,  3.1329,
    63 * Question 1
    52   :       3.3489,  3.7636])
    64   - Plot the given experimental data with large dots.
    53 
    65   The data is on your screen.     
    54   
    66   
    55 * Plotting   
    67 
    56   : In[]: plot(L,t,.)
    68 * Question 1 Data
    57   
    69 
    58 
    70 #+ORGTBL: L vs T^2 orgtbl-to-latex
    59   : In[]: plot(L,t,o)
    71     
       
    72   
       
    73    |    S |     n |
       
    74    | 0.19 | 10.74 |
       
    75    | 0.38 | 14.01 |
       
    76    | 0.57 | 18.52 |
       
    77    | 0.77 | 20.23 |
       
    78    | 0.96 | 22.88 |
       
    79    | 1.15 | 24.59 |
       
    80    | 1.34 | 27.55 |
       
    81    | 1.54 | 28.48 |
       
    82    | 1.73 | 30.20 |
       
    83     
       
    84 
       
    85 * Solution 1
       
    86 
       
    87   : S=[0.19,0.38,0.57,0.77,0.96,
       
    88   :   1.15,1.34,1.54,1.73]
       
    89   : n=[10.74,14.01,18.52,20.23,
       
    90   :    22.88,24.59,27.55,28.48,30.20]
       
    91   : plot(S,n,'o')
       
    92 
       
    93 * Question 2
       
    94   - Plot the given experimental data with small dots.
       
    95   The data is on your screen.     
       
    96 
       
    97 * Question 2 Data
       
    98 
       
    99 #+ORGTBL: L vs T^2 orgtbl-to-latex
       
   100 
       
   101    |    P |    D |
       
   102    | 1.48 | 0.68 |
       
   103    | 2.96 | 0.89 |
       
   104    | 4.44 | 1.18 |
       
   105    | 5.92 | 1.29 |
       
   106    | 7.40 | 1.46 |
       
   107    | 8.88 | 1.57 |
       
   108    | 10.3 | 1.76 |
       
   109    | 11.8 | 1.82 |
       
   110    | 13.3 | 1.93 |
       
   111   
       
   112 * Solution 2
       
   113 
       
   114    : P=[1.48,2.96,4.44,5.92,7.40,
       
   115    :   8.88,10.3,11.8,13.3]
       
   116    : D=[0.68,0.89,1.18,1.29,1.46,
       
   117    :   1.57,1.76,1.82,1.93]
       
   118    : plot(P,D,'.')
    60 
   119 
    61 * Adding Error 
   120 * Adding Error 
    62 
   121 
    63 
   122 #+ORGTBL: L vs T^2 orgtbl-to-latex
    64   |   L |    T | /Delta L | /Delta T |
   123 
       
   124   |   L |    T | \delta L | \delta T |
    65   | 0.1 | 0.69 |     0.08 |     0.04 |
   125   | 0.1 | 0.69 |     0.08 |     0.04 |
    66   | 0.2 | 0.90 |     0.09 |     0.08 |
   126   | 0.2 | 0.90 |     0.09 |     0.08 |
    67   | 0.3 | 1.19 |     0.07 |     0.11 |
   127   | 0.3 | 1.19 |     0.07 |     0.03 |
    68   | 0.4 | 1.30 |     0.05 |     0.05 |
   128   | 0.4 | 1.30 |     0.05 |     0.05 |
    69   | 0.5 | 1.47 |     0.06 |     0.03 |
   129   | 0.5 | 1.47 |     0.06 |     0.03 |
    70   | 0.6 | 1.58 |     0.00 |     0.03 |
   130   | 0.6 | 1.58 |     0.00 |     0.03 |
    71   | 0.7 | 1.77 |     0.06 |     0.01 |
   131   | 0.7 | 1.77 |     0.06 |     0.04 |
    72   | 0.8 | 1.83 |     0.06 |     0.07 |
   132   | 0.8 | 1.83 |     0.06 |     0.07 |
    73   | 0.9 | 1.94 |     0.01 |     0.01 |
   133   | 0.9 | 1.94 |     0.01 |     0.08 |
    74  
   134  
    75  
   135  
    76 * Plotting Error bar 
   136 * Plotting Error bar 
    77   
   137   
    78   : In[]: errorbar(L,tsquare,xerr=delta_L, yerr=delta_T,
   138   : errorbar(L,tsquare,xerr=delta_L, yerr=delta_T,
    79   :                fmt='b.')
   139   :         fmt='b.')
    80 
   140 
    81 
   141 
       
   142 * Question 1
       
   143 
       
   144   - Plot the given experimental data with large green dots.Also include
       
   145   the error in your plot. 
       
   146 
       
   147   
       
   148 * Question 1 Data
       
   149 
       
   150   #+ORGTBL: L vs T^2 orgtbl-to-latex
       
   151 
       
   152   |    S |     n | \delta S | \delta n |
       
   153   | 0.19 | 10.74 |    0.006 |     0.61 |
       
   154   | 0.38 | 14.01 |    0.006 |     0.69 |
       
   155   | 0.57 | 18.52 |    0.005 |     0.53 |
       
   156   | 0.77 | 20.23 |    0.003 |     0.38 |
       
   157   | 0.96 | 22.88 |    0.004 |     0.46 |
       
   158   | 1.15 | 24.59 |    0.007 |     0.37 |
       
   159   | 1.34 | 27.55 |    0.004 |     0.46 |
       
   160   | 1.54 | 28.48 |    0.004 |     0.46 |
       
   161   | 1.73 | 30.20 |    0.007 |     0.37 |
       
   162   
       
   163   
       
   164     
       
   165 
       
   166 * Solution 1
       
   167   
       
   168   : S=[0.19,0.38,0.57,0.77,0.96,
       
   169   :   1.15,1.34,1.54,1.73]
       
   170   : n=[10.74,14.01,18.52,20.23,
       
   171   :   22.88,24.59,27.55,28.48,30.20]
       
   172   : delta_S=[0.006,0.006,0.005,0.003,
       
   173   :         0.004,0.007,0.004,0.004,0.007]
       
   174   : delta_n=[0.61,0.69,0.53,0.38,0.46,
       
   175   :         0.37,0.46,0.46,0.37]
       
   176   : errorbar(S,n,xerr=delta_S, yerr=delta_n, 
       
   177   :         fmt='go')
       
   178 
       
   179 * Summary 
       
   180  : L = [0.1, 0.2, 0.3, 0.4, 0.5,
       
   181  :      0.6, 0.7, 0.8, 0.9]  
       
   182  : plot(x,y,'o')
       
   183  : plot(x,y,'.')
       
   184 * Thank you!
       
   185 #+begin_latex                                                                                                                                                
       
   186   \begin{block}{}                                                                                                                                            
       
   187   \begin{center}                                                                                                                                             
       
   188   This spoken tutorial has been produced by the                                                                                                              
       
   189   \textcolor{blue}{FOSSEE} team, which is funded by the                                                                                                      
       
   190   \end{center}                                                                                                                                               
       
   191   \begin{center}                                                                                                                                             
       
   192     \textcolor{blue}{National Mission on Education through \\                                                                                                
       
   193       Information \& Communication Technology \\                                                                                                             
       
   194       MHRD, Govt. of India}.                                                                                                                                 
       
   195   \end{center}                                                                                                                                               
       
   196   \end{block}                                                                                                                                                
       
   197 #+end_latex
       
   198 
       
   199 
       
   200