getting-started-with-symbolics/slides.org
changeset 442 a9b71932cbfa
parent 418 8a42b4203f6d
child 458 9a1c5d134feb
equal deleted inserted replaced
441:430035b678f7 442:a9b71932cbfa
       
     1 #+LaTeX_CLASS: beamer
       
     2 #+LaTeX_CLASS_OPTIONS: [presentation]
       
     3 #+BEAMER_FRAME_LEVEL: 1
       
     4 
       
     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)
       
     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 
       
     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}
       
    20 
       
    21 #+TITLE:   Getting started with symbolics
       
    22 #+AUTHOR:    FOSSEE
       
    23 #+EMAIL:     
       
    24 #+DATE:    
       
    25 
       
    26 #+DESCRIPTION: 
       
    27 #+KEYWORDS: 
       
    28 #+LANGUAGE:  en
       
    29 #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
       
    30 #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
       
    31 
       
    32 * Outline
       
    33   - Defining symbolic expressions in sage.  
       
    34   - Using built-in constants and functions.   
       
    35   - Performing Integration, differentiation using sage. 
       
    36   - Defining matrices. 
       
    37   - Defining Symbolic functions.  
       
    38   - Simplifying and solving symbolic expressions and functions.
       
    39 
       
    40 * Questions 1
       
    41   - Define the following expression as symbolic
       
    42     expression in sage.
       
    43 
       
    44     - x^2+y^2
       
    45     - y^2-4ax
       
    46   
       
    47 * Solutions 1
       
    48 #+begin_src python
       
    49   var('x,y')
       
    50   x^2+y^2
       
    51 
       
    52   var('a,x,y')
       
    53   y^2-4*a*x
       
    54 #+end_src python
       
    55 * Questions 2
       
    56   - Find the values of the following constants upto 6 digits  precision 
       
    57    
       
    58     - pi^2
       
    59    
       
    60       
       
    61   - Find the value of the following.
       
    62 
       
    63    - sin(pi/4)
       
    64    - ln(23)  
       
    65 
       
    66 * Solutions 2
       
    67 #+begin_src python
       
    68   n(pi^2,digits=6)
       
    69   n(sin(pi/4))
       
    70   n(log(23,e))
       
    71 #+end_src python
       
    72 * Question 2
       
    73   - Define the piecewise function. 
       
    74    f(x)=3x+2 
       
    75    when x is in the closed interval 0 to 4.
       
    76    f(x)=4x^2
       
    77    between 4 to 6. 
       
    78    
       
    79   - Sum  of 1/(n^2-1) where n ranges from 1 to infinity. 
       
    80 
       
    81 * Solution Q1
       
    82 #+begin_src python
       
    83   var('x') 
       
    84   h(x)=3*x+2 
       
    85   g(x)= 4*x^2
       
    86   f=Piecewise([[(0,4),h(x)],[(4,6),g(x)]],x)
       
    87   f
       
    88 #+end_src python
       
    89 * Solution Q2
       
    90 #+begin_src python  
       
    91   var('n')
       
    92   f=1/(n^2-1) 
       
    93   sum(f(n), n, 1, oo)
       
    94 #+end_src python  
       
    95  
       
    96 
       
    97 * Questions 3
       
    98   - Differentiate the following. 
       
    99       
       
   100     - x^5*log(x^7)  , degree=4 
       
   101 
       
   102   - Integrate the given expression 
       
   103       
       
   104     - x*sin(x^2) 
       
   105 
       
   106   - Find x
       
   107     - cos(x^2)-log(x)=0
       
   108     - Does the equation have a root between 1,2. 
       
   109 
       
   110 * Solutions 3
       
   111 #+begin_src python
       
   112   var('x')
       
   113   f(x)= x^5*log(x^7) 
       
   114   diff(f(x),x,5)
       
   115 
       
   116   var('x')
       
   117   integral(x*sin(x^2),x) 
       
   118 
       
   119   var('x')
       
   120   f=cos(x^2)-log(x)
       
   121   find_root(f(x)==0,1,2)
       
   122 #+end_src
       
   123 
       
   124 * Question 4
       
   125   - Find the determinant and inverse of :
       
   126 
       
   127       A=[[x,0,1][y,1,0][z,0,y]]
       
   128 
       
   129 * Solution 4
       
   130 #+begin_src python  
       
   131   var('x,y,z')
       
   132   A=matrix([[x,0,1],[y,1,0],[z,0,y]])
       
   133   A.det()
       
   134   A.inverse()
       
   135 #+end_src
       
   136 * Summary
       
   137  - We learnt about defining symbolic 
       
   138    expression and functions.  
       
   139  - Using built-in constants and functions.  
       
   140  - Using <Tab>  to see the documentation of a 
       
   141    function.  
       
   142  
       
   143 * Summary 
       
   144  - Simple calculus operations .  
       
   145  - Substituting values in expression 
       
   146    using substitute function.
       
   147  - Creating symbolic matrices and 
       
   148    performing operation on them .
       
   149 
       
   150 * Thank you!
       
   151 #+begin_latex
       
   152   \begin{block}{}
       
   153   \begin{center}
       
   154   This spoken tutorial has been produced by the
       
   155   \textcolor{blue}{FOSSEE} team, which is funded by the 
       
   156   \end{center}
       
   157   \begin{center}
       
   158     \textcolor{blue}{National Mission on Education through \\
       
   159       Information \& Communication Technology \\ 
       
   160       MHRD, Govt. of India}.
       
   161   \end{center}  
       
   162   \end{block}
       
   163 #+end_latex
       
   164 
       
   165 
       
   166