getting-started-with-symbolics/slides.org
changeset 522 d33698326409
parent 521 88a01948450d
child 523 54bdda4aefa5
equal deleted inserted replaced
521:88a01948450d 522:d33698326409
     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 * Question 1
       
    41   - Define the following expression as symbolic
       
    42     expression in sage.
       
    43 
       
    44     - x^2+y^2
       
    45     - y^2-4ax
       
    46   
       
    47 * Solution 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 * Question 2
       
    56   - Find the values of the following constants upto 6 digits  precision 
       
    57    
       
    58     - pi^2
       
    59     - euler_gamma^2
       
    60    
       
    61       
       
    62   - Find the value of the following.
       
    63 
       
    64    - sin(pi/4)
       
    65    - ln(23)  
       
    66 
       
    67 * Solution 2
       
    68 #+begin_src python
       
    69   n(pi^2,digits=6)
       
    70   n(sin(pi/4))
       
    71   n(log(23,e))
       
    72 #+end_src python
       
    73 * Question 3
       
    74   - Define the piecewise function. 
       
    75    f(x)=3x+2 
       
    76    when x is in the closed interval 0 to 4.
       
    77    f(x)=4x^2
       
    78    between 4 to 6. 
       
    79    
       
    80   - Sum  of 1/(n^2-1) where n ranges from 1 to infinity. 
       
    81 
       
    82 * Solution 3
       
    83 #+begin_src python
       
    84   var('x') 
       
    85   h(x)=3*x+2 
       
    86   g(x)= 4*x^2
       
    87   f=Piecewise([[(0,4),h(x)],[(4,6),g(x)]],x)
       
    88   f
       
    89 #+end_src python
       
    90 
       
    91 #+begin_src python  
       
    92   var('n')
       
    93   f=1/(n^2-1) 
       
    94   sum(f(n), n, 1, oo)
       
    95 #+end_src python  
       
    96 
       
    97 * Question 4
       
    98   - Differentiate the following. 
       
    99       
       
   100     - sin(x^3)+log(3x), to the second order
       
   101     - x^5*log(x^7), to the fourth order
       
   102 
       
   103   - Integrate the given expression 
       
   104       
       
   105     - x*sin(x^2) 
       
   106 
       
   107   - Find x
       
   108     - cos(x^2)-log(x)=0
       
   109     - Does the equation have a root between 1,2. 
       
   110 
       
   111 * Solution 4
       
   112 #+begin_src python
       
   113   var('x')
       
   114   f(x)= x^5*log(x^7) 
       
   115   diff(f(x),x,5)
       
   116 
       
   117   var('x')
       
   118   integral(x*sin(x^2),x) 
       
   119 
       
   120   var('x')
       
   121   f=cos(x^2)-log(x)
       
   122   find_root(f(x)==0,1,2)
       
   123 #+end_src
       
   124 
       
   125 * Question 5
       
   126   - Find the determinant and inverse of :
       
   127 
       
   128       A=[[x,0,1][y,1,0][z,0,y]]
       
   129 
       
   130 * Solution 5
       
   131 #+begin_src python  
       
   132   var('x,y,z')
       
   133   A=matrix([[x,0,1],[y,1,0],[z,0,y]])
       
   134   A.det()
       
   135   A.inverse()
       
   136 #+end_src
       
   137 * Summary
       
   138  - We learnt about defining symbolic expression and functions.
       
   139  - Using built-in constants and functions.
       
   140  - Using <Tab> to see the documentation of a function.
       
   141  - Simple calculus operations .
       
   142  - Substituting values in expression using substitute function.
       
   143  - Creating symbolic matrices and performing operation on them .
       
   144 * Thank you!
       
   145 #+begin_latex
       
   146   \begin{block}{}
       
   147   \begin{center}
       
   148   This spoken tutorial has been produced by the
       
   149   \textcolor{blue}{FOSSEE} team, which is funded by the 
       
   150   \end{center}
       
   151   \begin{center}
       
   152     \textcolor{blue}{National Mission on Education through \\
       
   153       Information \& Communication Technology \\ 
       
   154       MHRD, Govt. of India}.
       
   155   \end{center}  
       
   156   \end{block}
       
   157 #+end_latex
       
   158 
       
   159 
       
   160