diff options
author | Jovina | 2011-06-16 13:41:23 +0530 |
---|---|---|
committer | Jovina | 2011-06-16 13:41:23 +0530 |
commit | 475acd5b517a7e376931a44852fc0e63d42fd698 (patch) | |
tree | 4b35b0530cf95613b016da996624de5be317d94c | |
parent | fc6e0600fb5a3e5e54c4bb0aecc11f2b4896e829 (diff) | |
download | st-scripts-475acd5b517a7e376931a44852fc0e63d42fd698.tar.gz st-scripts-475acd5b517a7e376931a44852fc0e63d42fd698.tar.bz2 st-scripts-475acd5b517a7e376931a44852fc0e63d42fd698.zip |
Major changes to script & slides of 'using sage to teach'.
-rw-r--r-- | using_sage_to_teach/script.rst | 306 | ||||
-rw-r--r-- | using_sage_to_teach/slides.org | 105 | ||||
-rw-r--r-- | using_sage_to_teach/slides.tex | 225 |
3 files changed, 490 insertions, 146 deletions
diff --git a/using_sage_to_teach/script.rst b/using_sage_to_teach/script.rst index e8a0cc7..90ad773 100644 --- a/using_sage_to_teach/script.rst +++ b/using_sage_to_teach/script.rst @@ -9,7 +9,8 @@ .. Prerequisites .. ------------- -.. 1. Getting started with lists +.. 1. Getting started with Sage + #. Getting started with Symbolics .. Author : Nishanth Amuluru Internal Reviewer : @@ -20,37 +21,68 @@ Script ------ -{{{ Show the slide containing title }}} +.. L1 -Hello friends and welcome to the tutorial on Using SAGE to teach +{{{ Show the first slide containing title, name of the production +team along with the logo of MHRD }}} -{{{ Show the slide containing the outline slide }}} +.. R1 -In this tutorial, we shall learn +Hello friends and welcome to the tutorial on 'Using SAGE to teach'. - * How to use the "@interact" feature of SAGE for better demonstration - * How to use SAGE for collaborative learning +.. L2 -Let us look at a typical example of demonstrating a damped oscillation. +{{{ Show the slide containing the objectives }}} + +.. R2 + +At the end of this tutorial, you will be able to, + + 1. Use ``@interact`` feature of SAGE for better demonstration. + #. Share, publish and edit SAGE worksheets for collaborative learning. + +.. L3 + +{{{ Switch to the pre-requisite slide }}} + +.. R3 + +Before beginning this tutorial,we would suggest you to complete the +tutorial on "Getting started with Sage" and +"Getting started with Symbolics." + +.. R4 + +Let us start by looking at a typical example of demonstrating a +damped oscillation. + +.. L4 :: t = var('t') p1 = plot( e^(-t) * sin(2*t), (t, 0, 15)) show(p1) -Now let us reduce the damping factor +.. R5 + +Now let us reduce the damping factor by half + +.. L5 :: t = var('t') p1 = plot(e^(-t/2) * sin(2*t), (t, 0, 15)) show(p1) +.. R6 + Now if we want to reduce the damping factor even more, we would be using -e^(-t/3). We can observe that every time we have to change, all we do is change -something very small and re evaluate the cell. +e^(-t/3). We can observe that every time we have to change, all we do is +change something very small and re-evaluate the cell. This process can be simplified, using the ``@interact`` feature of SAGE. +.. L6 :: @interact @@ -59,22 +91,46 @@ This process can be simplified, using the ``@interact`` feature of SAGE. p1 = plot( e^(-t/n) * sin(2*t), (t, 0, 20)) show(p1) -We can see that the function is evaluated and the plot is shown. We can also -see that there is a field to enter the value of ``n`` and it is currently set -to ``1``. Let us change it to 2 and hit enter. +.. R7 + +We can see that the function is evaluated and the plot is shown. +We can also see that there is a field to enter the value of ``n`` and +it is currently set to ``1``. Let us change it to 2 and hit enter. + +.. L7 +:: + + 2<enter> + +.. R8 -We see that the new plot with reduced damping factor is shown. Similarly we can -change ``n`` to any desired value and hit enter and the function will be -evaluated. +We see that the new plot with reduced damping factor is shown. +Similarly we can change ``n`` to any desired value and hit enter and the +function will be evaluated. This is a very handy tool while demonstrating or teaching. -{{{ Pause here and try out the following exercises }}} +Pause the video here, try out the following exercise and resume the video. -%% 1 %% Plot the sine curve and vary its frequency using the ``@interact`` +.. L8 -{{{ continue from paused state }}} +.. L9 + +{{{ Show slide with exercise 1 }}} +.. R9 + + Plot the sine curve and vary its frequency using the ``@interact`` + feature. + +.. R10 + +Switch to your worksheet for solution. + +.. L10 + +{{{ continue from paused state }}} +{{{ Switch to the sage worksheet }}} :: @interact @@ -83,29 +139,59 @@ This is a very handy tool while demonstrating or teaching. p2 = plot(sin(n*x), (x, 0, 2*pi)) show(p2) -Often we would want to vary a parameter over range instead of taking it as an -input from the user. For instance we do not want the user to give ``n`` as 0 -for the damping oscillation we discussed. In such cases we use a range of -values as the default argument. +.. R11 + +Often we would want to vary a parameter over range instead of taking it +as an input from the user. For instance we do not want the user to +give ``n`` as 0 for the damping oscillation we discussed. In such cases +we use a range of values as the default argument. + +.. L11 :: @interact def plot_damped(n=(1..10)): t = var('t') - p1 = plot( e^(-t/n) * sin(2*t), (t, 0, 20)) + p1 = plot( e^(-t/n) * sin(2*t)), (t, 0, 20)) show(p1) -We get similar plot but the only difference is the input widget. Here it is a -slider unlike an input field. We can see that as the slider is moved, the +.. R12 + +We get similar plot but the only difference is the input widget. +Here it is a slider unlike an input field. + +.. L12 + +.. L13 + +{{{ Move the slider two times and show the plot obtained }}} + +.. R13 + +We can see that as the slider is moved, the function is evaluated and plotted accordingly. -{{{ Pause here and try out the following exercises }}} +Pause the video here, try out the following exercise and resume the video. -%% 2 %% Take a string as input from user and circular shift it to the left and - vary the shift length using a slider +.. L14 -{{{ continue from paused state }}} +{{{ Show slide with exercise 2 }}} + +.. R14 + + Take a string as input from user and circular shift it to the left and + vary the shift length using a slider. + +.. R15 + +For this problem, again we will use the ``@interact`` feature of sage. +We shall first assign a string say 'MADAM' to a variable and then shift +the alphabets one by one. +.. L15 + +{{{ continue from paused state }}} +{{{ Switch to the sage worksheet }}} :: @interact @@ -116,8 +202,20 @@ function is evaluated and plotted accordingly. print "Actual String:", s print "Shifted String:", "".join(shifted_chars) -Sometimes we want the user to have only a given set of options. We use a list -of items as the default argument in such situations. +.. L16 + +{{{ Move the slider 2 times and show the output }}} + +.. R16 + +As we move the slider, we see that shifting is taking place. + +.. R17 + +Sometimes we want the user to have only a given set of options. +We use a list of items as the default argument in such situations. + +.. L17 :: @interact @@ -131,51 +229,131 @@ of items as the default argument in such situations. print "Actual String:", s print "Shifted String:", "".join(shifted_chars) -We can see that buttons are displayed which enables us to select from a given -set of options. +.. R18 + +We can see that buttons are displayed which enables us to select from a +given set of options. + +.. L18 + +.. L19 + +{{{ Demonstrate the use of left and right buttons }}} +{{{ press 'left' button and move the slider to show the output + then press 'right' button and move the slider to show the output }}} + +.. R19 + +We see that, as we select the left or right button, the shifting takes +place appropriately. + +Thus, we have learnt how to use the ``@interact`` feature of SAGE for better +demonstration. Now we shall look at how to use SAGE worksheets for +collaborative learning. + +.. R20 + +The first feature we shall see is the ``publish`` feature. Open a worksheet +and in the top right, we can see a button called ``publish``. +Click on that and we get a confirmation page with an option for +re-publishing. + +.. L20 + +{{{ Open a new worksheet and click on the 'publish' button }}} + +.. L21 -We have learnt how to use the ``@interact`` feature of SAGE for better -demonstration. We shall look at how to use SAGE worksheets for collaborative -learning. +{{{ Demonstrate the actions }}} -The first feature we shall see is the ``publish`` feature. Open a worksheet and -in the top right, we can see a button called ``publish``. Click on that and we -get a confirmation page with an option for re publishing. +.. R21 -For now lets forget that option and simply publish by clicking ``yes``. The -worksheet is now published. +For now lets forget that option and simply publish by clicking ``yes``. +The worksheet is now published. Now lets sign out and go to the sage notebook home. We see link to browse -published worksheets. Lets click on it and we can see the worksheet. This does -not require login and anyone can view the worksheet. +published worksheets. Lets click on it and we can see the worksheet. +This does not require login and anyone can view the worksheet. -Alternatively, if one wants to edit the sheet, there is a link on top left -corner that enables the user to download a copy of the sheet onto their home. -This way they can edit a copy of the worksheet. +Alternatively, if one wants to edit the sheet, there is a link on top +left corner that enables the user to download a copy of the sheet onto +their home. This way they can edit a copy of the worksheet. -We have learnt how to publish the worksheets to enable users to edit a copy. -Next, we shall look at how to enable users to edit the actual worksheet itself. +We have learnt how to publish the worksheets to enable users to edit a +copy.Next, we shall look at how to enable users to edit the actual +worksheet itself. -Let us open the worksheet and we see a link called ``share`` on the top right -corner of the worksheet. Click the link and we get a box where we can type the -usernames of users whom we want to share the worksheet with. We can even -specify multiple users by seperating their names using commas. Once we have -shared the worksheet, the worksheet appears on the home of shared users. +.. L22 + +{{{ Open a worksheet }}} + +.. R22 + +Let us open the worksheet and we see a link called ``share`` on the +top right corner of the worksheet. Click the link and we get a box +where we can type the usernames of users whom we want to share the +worksheet with. We can even specify multiple users by seperating their +names using commas. Once we have shared the worksheet, the worksheet +appears on the home of shared users. + +.. L23 {{{ Show summary slide }}} -This brings us to the end of the tutorial. -we have learnt +.. R23 + +This brings us to the end of this tutorial.In this tutorial, +we have learnt to, + + 1. Use interactive feaures of SAGE using ``@interact``. + #. Publish our work. + #. Edit a copy of one of the published worksheets. + #. Share the worksheets with fellow users. + +.. L24 + +{{{Show self assessment questions slide}}} + +.. R24 + +Here are some self assessment questions for you to solve + +1. Which default argument, when used with ``@interact`` gives a slider + starting at 0 and ending in 10. + + - (0..11) + - range(0, 11) + - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + - (0..10) + + 2. What is the input widget resulted by using ``n = [2, 4, 5, 9]`` in + the default arguments along with ``@interact``. + + - input field + - set of buttons + - slider + - None + +.. L25 + +{{{solution of self assessment questions on slide}}} + +.. R25 + +And the answers, + +1. The default argument, used with ``@interact`` which gives a slider + starting at 0 and ending in 10 is (0..10). + +2. The input widget resulted by using ``n = [2, 4, 5, 9]`` in the + default arguments along with ``@interact`` will be a set of buttons. - * How to user interactive feaures of SAGE - * How to publish our work - * How to edit a copy of one of the published worksheets - * How to share the worksheets with fellow users +.. L26 -{{{ Show the "sponsored by FOSSEE" slide }}} +{{{ Show the Thank you slide }}} -This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India +.. R26 -Hope you have enjoyed and found it useful. +Hope you have enjoyed this tutorial and found it useful. Thank you! diff --git a/using_sage_to_teach/slides.org b/using_sage_to_teach/slides.org new file mode 100644 index 0000000..e9551f9 --- /dev/null +++ b/using_sage_to_teach/slides.org @@ -0,0 +1,105 @@ +#+LaTeX_CLASS: beamer +#+LaTeX_CLASS_OPTIONS: [presentation] +#+BEAMER_FRAME_LEVEL: 1 + +#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} +#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra) +#+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 + +#+LaTeX_CLASS: beamer +#+LaTeX_CLASS_OPTIONS: [presentation] + +#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl} +#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} + +#+LaTeX_HEADER: \usepackage{listings} + +#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries, +#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, +#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries} + +#+TITLE: +#+AUTHOR: FOSSEE +#+EMAIL: +#+DATE: + +#+DESCRIPTION: +#+KEYWORDS: +#+LANGUAGE: en +#+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t +#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc + +* +#+begin_latex +\begin{center} +\vspace{12pt} +\textcolor{blue}{\huge Using Sage to teach} +\end{center} +\vspace{18pt} +\begin{center} +\vspace{10pt} +\includegraphics[scale=0.95]{../images/fossee-logo.png}\\ +\vspace{5pt} +\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ +\scriptsize Funded by National Mission on Education through ICT\\ +\scriptsize MHRD,Govt. of India\\ +\includegraphics[scale=0.30]{../images/iitb-logo.png}\\ +\end{center} +#+end_latex +* Objectives + At the end of this tutorial, you will be able to, + + - Use ``@interact`` feature of SAGE for better demonstration. + - Share, publish and edit SAGE worksheets for collaborative learning. +* Pre-requisite + Spoken tuorial on - + - Getting started with Sage. + - Getting started with Symbolics. +* Exercise 1 +- Plot the sine curve and vary its frequency using the ``@interact`` feature. +* Exercise 2 +- Take a string as input from user and circular shift it to the left and + vary the shift length using a slider. +* Summary + In this tutorial,we have learnt to, + + - Use interactive feaures of SAGE using ``@interact``. + - Publish our work. + - Edit a copy of one of the published worksheets. + - Share the worksheets with fellow users. +* Evaluation + 1. Which default argument, when used with ``@interact`` gives a slider + starting at 0 and ending in 10. + + - (0..11) + - range(0, 11) + - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + - (0..10) + + 2. What is the input widget resulted by using ``n = [2, 4, 5, 9]`` in the + default arguments along with ``@interact``. + + - input field + - set of buttons + - slider + - None +* Solutions + 1. (0..10) + + 2. Set of buttons +* +#+begin_latex + \begin{block}{} + \begin{center} + \textcolor{blue}{\Large THANK YOU!} + \end{center} + \end{block} +\begin{block}{} + \begin{center} + For more Information, visit our website\\ + \url{http://fossee.in/} + \end{center} + \end{block} +#+end_latex + + diff --git a/using_sage_to_teach/slides.tex b/using_sage_to_teach/slides.tex index df1462c..1213358 100644 --- a/using_sage_to_teach/slides.tex +++ b/using_sage_to_teach/slides.tex @@ -1,106 +1,167 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%Tutorial slides on Python. -% -% Author: FOSSEE -% Copyright (c) 2009, FOSSEE, IIT Bombay -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\documentclass[14pt,compress]{beamer} -%\documentclass[draft]{beamer} -%\documentclass[compress,handout]{beamer} -%\usepackage{pgfpages} -%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] - -% Modified from: generic-ornate-15min-45min.de.tex -\mode<presentation> -{ - \usetheme{Warsaw} - \useoutertheme{infolines} - \setbeamercovered{transparent} -} - -\usepackage[english]{babel} +% Created 2011-06-16 Thu 12:19 +\documentclass[presentation]{beamer} \usepackage[latin1]{inputenc} -%\usepackage{times} \usepackage[T1]{fontenc} - -\usepackage{ae,aecompl} -\usepackage{mathpazo,courier,euler} -\usepackage[scaled=.95]{helvet} - -\definecolor{darkgreen}{rgb}{0,0.5,0} - +\usepackage{fixltx2e} +\usepackage{graphicx} +\usepackage{longtable} +\usepackage{float} +\usepackage{wrapfig} +\usepackage{soul} +\usepackage{textcomp} +\usepackage{marvosym} +\usepackage{wasysym} +\usepackage{latexsym} +\usepackage{amssymb} +\usepackage{hyperref} +\tolerance=1000 +\usepackage[english]{babel} \usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} \usepackage{listings} -\lstset{language=Python, - basicstyle=\ttfamily\bfseries, - commentstyle=\color{red}\itshape, - stringstyle=\color{darkgreen}, - showstringspaces=false, - keywordstyle=\color{blue}\bfseries} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Macros -\setbeamercolor{emphbar}{bg=blue!20, fg=black} -\newcommand{\emphbar}[1] -{\begin{beamercolorbox}[rounded=true]{emphbar} - {#1} - \end{beamercolorbox} -} -\newcounter{time} -\setcounter{time}{0} -\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} - -\newcommand{\typ}[1]{\lstinline{#1}} - -\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } - -% Title page -\title{Your Title Here} - -\author[FOSSEE] {FOSSEE} - -\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} +\lstset{language=Python, basicstyle=\ttfamily\bfseries, +commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, +showstringspaces=false, keywordstyle=\color{blue}\bfseries} +\providecommand{\alert}[1]{\textbf{#1}} + +\title{} +\author{FOSSEE} \date{} -% DOCUMENT STARTS +\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} + + + + + + + + + + \begin{frame} - \maketitle + +\begin{center} +\vspace{12pt} +\textcolor{blue}{\huge Using Sage to teach} +\end{center} +\vspace{18pt} +\begin{center} +\vspace{10pt} +\includegraphics[scale=0.95]{../images/fossee-logo.png}\\ +\vspace{5pt} +\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ +\scriptsize Funded by National Mission on Education through ICT\\ +\scriptsize MHRD,Govt. of India\\ +\includegraphics[scale=0.30]{../images/iitb-logo.png}\\ +\end{center} \end{frame} +\begin{frame} +\frametitle{Objectives} +\label{sec-2} + + At the end of this tutorial, you will be able to, + -\begin{frame}[fragile] - \frametitle{Outline} - \begin{itemize} - \item - \end{itemize} +\begin{itemize} +\item Use ``@interact'' feature of SAGE for better demonstration. +\item Share, publish and edit SAGE worksheets for collaborative learning. +\end{itemize} \end{frame} +\begin{frame} +\frametitle{Pre-requisite} +\label{sec-3} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% All other slides here. %% -%% The same slides will be used in a classroom setting. %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Spoken tuorial on - -\begin{frame}[fragile] - \frametitle{Summary} - \begin{itemize} - \item - \end{itemize} +\begin{itemize} +\item Getting started with Sage. +\item Getting started with Symbolics. +\end{itemize} \end{frame} +\begin{frame} +\frametitle{Exercise 1} +\label{sec-4} + +\begin{itemize} +\item Plot the sine curve and vary its frequency using the ``@interact'' feature. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Exercise 2} +\label{sec-5} + + +\begin{itemize} +\item Take a string as input from user and circular shift it to the left and + vary the shift length using a slider. +\end{itemize} +\end{frame} \begin{frame} - \frametitle{Thank you!} +\frametitle{Summary} +\label{sec-6} + + In this tutorial,we have learnt to, + + +\begin{itemize} +\item Use interactive feaures of SAGE using ``@interact''. +\item Publish our work. +\item Edit a copy of one of the published worksheets. +\item Share the worksheets with fellow users. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Evaluation} +\label{sec-7} + + +\begin{enumerate} +\item Which default argument, when used with ``@interact'' gives a slider + starting at 0 and ending in 10. +\begin{itemize} +\item (0..11) +\item range(0, 11) +\item~[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]~ +\item (0..10) +\end{itemize} +\vspace{5pt} +\item What is the input widget resulted by using ``n = [2, 4, 5, 9]'' in the + default arguments along with ``@interact''. +\begin{itemize} +\item input field +\item set of buttons +\item slider +\item None +\end{itemize} +\end{enumerate} +\end{frame} +\begin{frame} +\frametitle{Solutions} +\label{sec-8} + + +\begin{enumerate} +\item (0..10) +\vspace{12pt} +\item Set of buttons +\end{enumerate} +\end{frame} +\begin{frame} + \begin{block}{} \begin{center} - This spoken tutorial has been produced by the - \textcolor{blue}{FOSSEE} team, which is funded by the + \textcolor{blue}{\Large THANK YOU!} \end{center} + \end{block} +\begin{block}{} \begin{center} - \textcolor{blue}{National Mission on Education through \\ - Information \& Communication Technology \\ - MHRD, Govt. of India}. + For more Information, visit our website\\ + \url{http://fossee.in/} \end{center} \end{block} \end{frame} -\end{document} +\end{document}
\ No newline at end of file |