{
 "metadata": {
  "name": "",
  "signature": "sha256:dfde8b5162ed0e45a15b6b15bf56248e83f3503ab2319fe83ead558e68ca9a9a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Introduzione al Python per il calcolo scientifico."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "28/11/2014\n",
      "\n",
      "docente: Francesca Mazzia\n",
      "\n",
      "Il materiale \u00e8 distribuito con licenza\n",
      "Creative Commons Attribuzione-Non commerciale-Non Opere Derivate 2.5 Italy License http://creativecommons.org/licenses/by-nc-nd/2.5/it/"
     ]
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {
      "slideshow": {
       "slide_type": "-"
      }
     },
     "source": [
      "Python"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {
      "slideshow": {
       "slide_type": "-"
      }
     },
     "source": [
      "Linguaggio di programmazione  ad alte prestazioni che pu\u00f2 essere utilizzato in modo efficiente anche  per il calcolo scientifico.\n",
      " \n",
      "Le istruzione Python possono essere eseguito utilizzando alcune IDE come spyder  o IPython e associandolo a pacchetti quali numpy, scipy, simpy,  diventa un potenete strumento di calcolo scientifico, confrontabile con Matlab, Octave o R per quanto riguarda la facilit\u00e0 di utilizzo ma con prestazioni che possono essere  molto pi\u00f9 efficienti.  Fra i linguaggi di alto livello l'unico che lo supera per prestazioni\n",
      "\u00e8 il nuovissimo linguaggio di nome Julia. Per il calcolo scientifico il Fortran rimane comunque il linguaggio pi\u00f9 efficienti al pari del c, ma il livello di difficolt\u00e0  per  scrivere un codice in Fortran o c \u00e8 sicuramente molto pi\u00f9 elevato di quello richiesto per Python."
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Possiamo eseguire alcune istruzioni Python usando una interfaccia come Ipython o Spyder,\n",
      "entrati in questo ambiente compare il prompt, il che significa che il calcolatore \\`e pronto a ricevere le\n",
      "istruzioni Python ed ad eseguirle.  \n",
      "Se vogliamo eseguire la somma 3+2 basta\n",
      "scrivere l'istruzione e premere il tasto invio. \n",
      "Otteniamo immediatamente la risposta."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "3+2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 167,
       "text": [
        "5"
       ]
      }
     ],
     "prompt_number": 167
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "e il calcolatore \u00e8 di nuovo pronto a ricevere un nuovo comando. Se vogliamo assegnare il risultato dell'operazione alla variabile di nome var\n",
      "basta scrivere:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var = 3+2\n",
      "var"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 168,
       "text": [
        "5"
       ]
      }
     ],
     "prompt_number": 168
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Questa istruzione si chiama **istruzione di assegnazione**. Il risultato dell'operazione non viene visualizzato. Per visualizzare il risultato dobbiamo digitare al prompt il nome della variabile oppure scrivere una istruzione di stampa:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "print(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "5\n"
       ]
      }
     ],
     "prompt_number": 169
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Possiamo assegnare a una variabile il valore di una espressione pi\u00f9 complicata.  Per\n",
      "far questo dobbiamo sapere a quali simboli corrispondono le principali\n",
      "operazioni aritmetico-logiche:\n",
      "\n",
      "\n",
      "* $+$    addizione\n",
      "* $-$    sottrazione \n",
      "* $*$    moltiplicazione \n",
      "* $/$     divisione \n",
      "* $//$   divisione intera\n",
      "* $**$    elevamento a potenza \n",
      "* &     and logico \n",
      "* |     or logico \n",
      "* ~     not logico \n",
      "* ==    uguale  \n",
      "* !     diverso \n",
      "* $<>$    diverso\n",
      "* $<$     minore \n",
      "* $<=$    minore uguale \n",
      "* $>$     maggiore\n",
      "* $>=$    maggiore uguale\n",
      "\n",
      "Le espressioni aritmetiche e logiche seguono le classiche regole di precedenza,\n",
      "che \u00e8 possibile modificare utilizzando le parentesi tonde.\n",
      "\n",
      "Per avere informazioni su tutte le operazioni che possono essere eseguite in\n",
      "Python si pu\u00f2 consultare The Python Language Reference, che in spyder si ottiene digitando \n",
      "dal tasto $?$  il link alla Python documentation. La funzione help() permette di aprire un help interattivo sulle console di IPython e \n",
      "di spyder. In IPython si pu\u00f2 digitare anche il nome di una funzione seguito dal ?.\n",
      "\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "help?"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 170
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "help('==')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Operator precedence\n",
        "*******************\n",
        "\n",
        "The following table summarizes the operator precedence in Python, from\n",
        "lowest precedence (least binding) to highest precedence (most\n",
        "binding).  Operators in the same box have the same precedence.  Unless\n",
        "the syntax is explicitly given, operators are binary.  Operators in\n",
        "the same box group left to right (except for exponentiation, which\n",
        "groups from right to left).\n",
        "\n",
        "Note that comparisons, membership tests, and identity tests, all have\n",
        "the same precedence and have a left-to-right chaining feature as\n",
        "described in the *Comparisons* section.\n",
        "\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| Operator                                        | Description                           |\n",
        "+=================================================+=======================================+\n",
        "| \"lambda\"                                        | Lambda expression                     |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"if\" -- \"else\"                                  | Conditional expression                |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"or\"                                            | Boolean OR                            |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"and\"                                           | Boolean AND                           |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"not\" \"x\"                                       | Boolean NOT                           |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"in\", \"not in\", \"is\", \"is not\", \"<\", \"<=\", \">\", | Comparisons, including membership     |\n",
        "| \">=\", \"!=\", \"==\"                                | tests and identity tests              |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"|\"                                             | Bitwise OR                            |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"^\"                                             | Bitwise XOR                           |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"&\"                                             | Bitwise AND                           |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"<<\", \">>\"                                      | Shifts                                |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"+\", \"-\"                                        | Addition and subtraction              |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"*\", \"/\", \"//\", \"%\"                             | Multiplication, division, remainder   |\n",
        "|                                                 | [5]                                   |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"+x\", \"-x\", \"~x\"                                | Positive, negative, bitwise NOT       |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"**\"                                            | Exponentiation [6]                    |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"x[index]\", \"x[index:index]\",                   | Subscription, slicing, call,          |\n",
        "| \"x(arguments...)\", \"x.attribute\"                | attribute reference                   |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "| \"(expressions...)\", \"[expressions...]\", \"{key:  | Binding or tuple display, list        |\n",
        "| value...}\", \"{expressions...}\"                  | display, dictionary display, set      |\n",
        "|                                                 | display                               |\n",
        "+-------------------------------------------------+---------------------------------------+\n",
        "\n",
        "-[ Footnotes ]-\n",
        "\n",
        "[1] While \"abs(x%y) < abs(y)\" is true mathematically, for floats\n",
        "    it may not be true numerically due to roundoff.  For example, and\n",
        "    assuming a platform on which a Python float is an IEEE 754 double-\n",
        "    precision number, in order that \"-1e-100 % 1e100\" have the same\n",
        "    sign as \"1e100\", the computed result is \"-1e-100 + 1e100\", which\n",
        "    is numerically exactly equal to \"1e100\".  The function\n",
        "    \"math.fmod()\" returns a result whose sign matches the sign of the\n",
        "    first argument instead, and so returns \"-1e-100\" in this case.\n",
        "    Which approach is more appropriate depends on the application.\n",
        "\n",
        "[2] If x is very close to an exact integer multiple of y, it's\n",
        "    possible for \"x//y\" to be one larger than \"(x-x%y)//y\" due to\n",
        "    rounding.  In such cases, Python returns the latter result, in\n",
        "    order to preserve that \"divmod(x,y)[0] * y + x % y\" be very close\n",
        "    to \"x\".\n",
        "\n",
        "[3] While comparisons between strings make sense at the byte\n",
        "    level, they may be counter-intuitive to users.  For example, the\n",
        "    strings \"\"\\u00C7\"\" and \"\"\\u0327\\u0043\"\" compare differently, even\n",
        "    though they both represent the same unicode character (LATIN\n",
        "    CAPITAL LETTER C WITH CEDILLA).  To compare strings in a human\n",
        "    recognizable way, compare using \"unicodedata.normalize()\".\n",
        "\n",
        "[4] Due to automatic garbage-collection, free lists, and the\n",
        "    dynamic nature of descriptors, you may notice seemingly unusual\n",
        "    behaviour in certain uses of the \"is\" operator, like those\n",
        "    involving comparisons between instance methods, or constants.\n",
        "    Check their documentation for more info.\n",
        "\n",
        "[5] The \"%\" operator is also used for string formatting; the same\n",
        "    precedence applies.\n",
        "\n",
        "[6] The power operator \"**\" binds less tightly than an arithmetic\n",
        "    or bitwise unary operator on its right, that is, \"2**-1\" is \"0.5\".\n",
        "\n",
        "Related help topics: lambda, or, and, not, in, is, BOOLEAN, COMPARISON,BITWISE, SHIFTING, BINARY, FORMATTING, POWER, UNARY, ATTRIBUTES,SUBSCRIPTS, SLICINGS, CALLS, TUPLES, LISTS, DICTIONARIES, COMPARISON\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 172
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Possiamo ora eseguire, per calcolare $$\\frac{5 \\cdot 2}{(3+2)^2}$$\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var=5*3/(3+2)**2 \n",
      "print(var)\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.6\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 173,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 173
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "se state usando 2.7 il risultato e' zero la divisione viene eseguita fra interi perch\u00e8 tutte le costanti sono intere. Questa e' una caratteristica di Python 2.7.  Per avere un risultato reale e' importante usare costanti reali. Calcoliamo $$\\frac{5 \\cdot 2}{(3+2)^2}$$"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var=5.*3./(3.+2.)**2. \n",
      "print(var)\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.6\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 174,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 174
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Per poter lavorare in python 2.7 come in Python 3 si  utilizza l'istruzione divisione analoga a quella di Python 3."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "from __future__ import division\n",
      "var=5*3/(3+2)**2 \n",
      "print(var)\n",
      "type(var)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.6\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 175,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 175
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Un'altra sostanziale differenza fra Python 2.7 e Python 3 e' nella funzione print. Se usate Python 2.7 importate  la funzione print di Python 3:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "from __future__ import print_function\n",
      "print?"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 179
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var=5*3/(3+2)**2 \n",
      "print('var = ',var)\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "var =  0.6\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 180,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 180
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Si possono  calcolare i valori delle principali funzioni. Ad\n",
      "esempio sono predefinite le funzioni in una variabile:\n",
      "\n",
      "\n",
      "* abs(x)  valore assoluto di x     \n",
      "* log(x)  logaritmo naturale          \n",
      "* exp(x)  esponenziale  $e^x$\n",
      "* sin(x)  seno,                        \n",
      "* cos(x)  coseno,                      \n",
      "* tan(x)  tangente.\n",
      "\n",
      "La maggior parte delle funzioni aritmetiche fanno parte del modulo numpy.\n",
      "Per poter utilizzare il modulo numpy bisogna, dopo averlo installato importarlo,\n",
      "se si usa python in ambiente spyder numpy \u00e8 automaticamente  importato all'avvio della console.\n",
      "Le istuzioni per importare il modulo numpy sono, per esempio:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import numpy as np"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 182
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "\n",
      "Tutti i metodi e le funzioni  di numpy devono essere precedute da np. per poter essere eseguite."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var = (5 * 3/(3+np.cos(5)))**np.log(2) * 100 \n",
      "print('var = ',var)\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "var =  286.610384332\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 183,
       "text": [
        "numpy.float64"
       ]
      }
     ],
     "prompt_number": 183
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var = (5 * 3/(3+cos(5)))**log(2) * 100 \n",
      "var\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "NameError",
       "evalue": "name 'cos' is not defined",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[1;32m<ipython-input-184-8375d53a4c3f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mvar\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;36m5\u001b[0m \u001b[1;33m*\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mcos\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m**\u001b[0m\u001b[0mlog\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m*\u001b[0m \u001b[1;36m100\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mvar\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[0mtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvar\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
        "\u001b[1;31mNameError\u001b[0m: name 'cos' is not defined"
       ]
      }
     ],
     "prompt_number": 184
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "\n",
      "Sono di particolare utilit\u00e0 anche alcune  *costanti*. Le\n",
      "costanti sono dei contenitori di valori che non cambiano nel corso\n",
      "dell'esecuzione di un algoritmo. In numpy vi sono delle costanti predefinite,\n",
      "come, ad esempio, la costante np.pi  che contiene il valore di $\\pi$:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.pi"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 185,
       "text": [
        "3.141592653589793"
       ]
      }
     ],
     "prompt_number": 185
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Esiste anche il modulo math che permette di lavorare con le funzioni standard. Anche questo modulo va importato prima di essere utilizzato:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import math as mt\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 186
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "var = (5 * 3/(3+mt.cos(5)))**mt.log(2) * 100 \n",
      "print('var = ', var)\n",
      "type(var)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "var =  286.6103843321482\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 187,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 187
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Le istruzioni possone essere inserite in un file di tipo script"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "%run stampavar"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "name": "stdout",
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "var  = 3\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "3\n"
       ]
      }
     ],
     "prompt_number": 190
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Le variabili possono essere di tipi diversi. Le operazioni automaticamente cambiano i tipi di dati. La function type permette di controllare il tipo del dato. "
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Tipo Intero"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "n=3\n",
      "print(n)\n",
      "type(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "3\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 191,
       "text": [
        "int"
       ]
      }
     ],
     "prompt_number": 191
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "n=10**50\n",
      "print(n)\n",
      "type(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "100000000000000000000000000000000000000000000000000\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 192,
       "text": [
        "int"
       ]
      }
     ],
     "prompt_number": 192
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "n = np.int(3)\n",
      "type(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 193,
       "text": [
        "int"
       ]
      }
     ],
     "prompt_number": 193
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "n = np.int(10**30)\n",
      "type(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 194,
       "text": [
        "int"
       ]
      }
     ],
     "prompt_number": 194
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Reali "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "type(3.9)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 195,
       "text": [
        "float"
       ]
      }
     ],
     "prompt_number": 195
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "v=np.float32(1.0)\n",
      "v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 196,
       "text": [
        "1.0"
       ]
      }
     ],
     "prompt_number": 196
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "type(v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 197,
       "text": [
        "numpy.float32"
       ]
      }
     ],
     "prompt_number": 197
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "x=np.float64(1.0)\n",
      "type(x)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 198,
       "text": [
        "numpy.float64"
       ]
      }
     ],
     "prompt_number": 198
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Possiamo decidere il comportamento da assumere quando si verifica una operazione invalida, di default si ignora l'errore"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "x=np.float32(0.0)\n",
      "y=np.float32(1.0)\n",
      "np.seterr(all='ignore')\n",
      "z= y/x\n",
      "print('z = ',z )  \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "z =  inf\n"
       ]
      }
     ],
     "prompt_number": 201
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      " s= x/x\n",
      " print( 's = %(s)10.00f' % {\"s\":s})\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "s =        nan\n"
       ]
      }
     ],
     "prompt_number": 202
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "La precisione di macchina e' il pi\u00f9 piccolo numero positivo  che aggiunto ad uno ci genera il successivo numero di macchina, usando 32 bit   \u00e8:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      " np.finfo(x).eps"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 203,
       "text": [
        "1.1920929e-07"
       ]
      }
     ],
     "prompt_number": 203
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Il pi\u00f9 piccolo numero floating point positivo  usando la rappresentazione a 32 bit \u00e8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).tiny"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 204,
       "text": [
        "1.1754944e-38"
       ]
      }
     ],
     "prompt_number": 204
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Il massimo numero floating point positivo usando la rappresentazione a 32 bit \u00e8:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).max"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 205,
       "text": [
        "3.4028235e+38"
       ]
      }
     ],
     "prompt_number": 205
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "type(np.finfo(x).max)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 206,
       "text": [
        "numpy.float32"
       ]
      }
     ],
     "prompt_number": 206
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "In questo caso  \u00e8 possibile usare dei numeri pi\u00f9 grandi, infatti si passa automaticamente alla rappresentazione floating point a 64 bit"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "print(np.finfo(x).max*2)\n",
      "type(np.finfo(x).max*2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "6.80564693277e+38\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 207,
       "text": [
        "numpy.float64"
       ]
      }
     ],
     "prompt_number": 207
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Per la rappresentazione a 64 bit la precisione di macchina \u00e8:\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "x = np.float64(0.0)\n",
      "np.finfo(x).eps"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 208,
       "text": [
        "2.2204460492503131e-16"
       ]
      }
     ],
     "prompt_number": 208
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "In questo caso usare numeri pi\u00f9 grandi del massimo numero rappresentabile genera INF oppure un errore di overflow:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).max\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 209,
       "text": [
        "1.7976931348623157e+308"
       ]
      }
     ],
     "prompt_number": 209
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "non possiamo superare il massimo numero rappresentabile, questa operazione genera inf"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).max*2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 211,
       "text": [
        "inf"
       ]
      }
     ],
     "prompt_number": 211
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "possiamo tranquillamente usare numeri pi\u00f9 piccoli del pi\u00f9 piccolo numero floating point positivo. Questi numeri vengono detti numeri denormali e consentono l'underflow graduale."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).tiny"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 212,
       "text": [
        "2.2250738585072014e-308"
       ]
      }
     ],
     "prompt_number": 212
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.finfo(x).tiny/2**53"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 217,
       "text": [
        "0.0"
       ]
      }
     ],
     "prompt_number": 217
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Tipo Complesso"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(complex(-1.0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(-1+0j)\n"
       ]
      }
     ],
     "prompt_number": 218
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a =-1+0j\n",
      "b = 0+1j\n",
      "print(a+b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(-1+1j)\n"
       ]
      }
     ],
     "prompt_number": 219
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(np.sqrt(-1.0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "nan\n"
       ]
      }
     ],
     "prompt_number": 220
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(np.sqrt(complex(-1.0)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1j\n"
       ]
      }
     ],
     "prompt_number": 221
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import scipy as sp\n",
      "print(sp.sqrt(-1.0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1j\n"
       ]
      }
     ],
     "prompt_number": 222
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import cmath\n",
      "print(cmath.sqrt(-1.0))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1j\n"
       ]
      }
     ],
     "prompt_number": 223
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Stringhe"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "c = \"la mia prima stringa\"\n",
      "print(c)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "la mia prima stringa\n"
       ]
      }
     ],
     "prompt_number": 224
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "c=\"\"\"la mia seconda stringa \n",
      "su pi\u00f9 righe\n",
      "in tutto tre righe\"\"\"\n",
      "print(c)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "la mia seconda stringa \n",
        "su pi\u00f9 righe\n",
        "in tutto tre righe\n"
       ]
      }
     ],
     "prompt_number": 225
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Liste"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "v = [1, 2, 3]\n",
      "v\n",
      "type(v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 227,
       "text": [
        "list"
       ]
      }
     ],
     "prompt_number": 227
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "v[1]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 228,
       "text": [
        "2"
       ]
      }
     ],
     "prompt_number": 228
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "v[0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 229,
       "text": [
        "1"
       ]
      }
     ],
     "prompt_number": 229
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "v.append(4)\n",
      "print(v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[1, 2, 3, 4]\n"
       ]
      }
     ],
     "prompt_number": 230
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "g=v.pop()\n",
      "print(g)\n",
      "print(v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "4\n",
        "[1, 2, 3]\n"
       ]
      }
     ],
     "prompt_number": 231
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "L'istruzione whos permette di visualizzare le variabili in uso nel workspace:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "%whos"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Variable         Type             Data/Info\n",
        "-------------------------------------------\n",
        "A                ndarray          3x3: 9 elems, type `float64`, 72 bytes\n",
        "P1               Punto            (2, 3)\n",
        "P2               Punto            (3, 4)\n",
        "P3               Punto            (5, 7)\n",
        "Punto            type             <class '__main__.Punto'>\n",
        "a                complex          (-1+0j)\n",
        "b                complex          1j\n",
        "c                str              la mia seconda stringa \\n<...>righe\\nin tutto tre righe\n",
        "cmath            module           <module 'cmath' (built-in)>\n",
        "d                str              CiaoCiao\n",
        "df               float64          2.71828182846\n",
        "dfh              ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "division         _Feature         _Feature((2, 2, 0, 'alpha<...> 0, 0, 'alpha', 0), 8192)\n",
        "epsmach          function         <function epsmach at 0x04F19B70>\n",
        "epsmio           float            2.220446049250313e-16\n",
        "err4             ndarray          4: 4 elems, type `float64`, 32 bytes\n",
        "err6             ndarray          6: 6 elems, type `float64`, 48 bytes\n",
        "errass           ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "errore           float64          0.0998287306223\n",
        "errrel           ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "esempio_radici   function         <function esempio_radici at 0x04F19858>\n",
        "file             str              CIAO; provo a scrivere ne<...> a scrivere nel file; 4\\n\n",
        "g                int              4\n",
        "g1               int              1\n",
        "g2               int              2\n",
        "g3               str              ciao\n",
        "h                ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "imp              module           <module 'importlib' from <...>\\importlib\\\\__init__.py'>\n",
        "k                str              \\n\n",
        "kmio             int              52\n",
        "mt               module           <module 'math' (built-in)>\n",
        "n                int              1000000000000000000000000000000\n",
        "np               module           <module 'numpy' from 'C:\\<...>ges\\\\numpy\\\\__init__.py'>\n",
        "p                ndarray          7: 7 elems, type `int32`, 28 bytes\n",
        "p4               ndarray          5: 5 elems, type `int32`, 20 bytes\n",
        "p6               ndarray          7: 7 elems, type `int32`, 28 bytes\n",
        "pf               TextIOWrapper    <_io.TextIOWrapper name='<...>de='r' encoding='cp1252'>\n",
        "plt              module           <module 'matplotlib.pyplo<...>\\\\matplotlib\\\\pyplot.py'>\n",
        "pm               module           <module 'primo_modulo' fr<...>ebooks\\\\primo_modulo.py'>\n",
        "print_function   _Feature         _Feature((2, 6, 0, 'alpha<...>0, 0, 'alpha', 0), 65536)\n",
        "r1               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r2               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r3               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r4               ndarray          4: 4 elems, type `complex128`, 64 bytes\n",
        "r6               ndarray          6: 6 elems, type `complex128`, 96 bytes\n",
        "rad              float64          0.00479367628048\n",
        "s                float32          nan\n",
        "sfile            set              {';', 'f', 'i', 'c', '1',<...>'3', '\\n', 's', 'p', 'A'}\n",
        "somma            function         <function somma at 0x04EBB270>\n",
        "somma2           function         <function somma at 0x04F19978>\n",
        "sommal           function         <function <lambda> at 0x04F19A50>\n",
        "sp               module           <module 'scipy' from 'C:\\<...>ges\\\\scipy\\\\__init__.py'>\n",
        "v                list             n=3\n",
        "var              str              3\n",
        "vl               list             n=3\n",
        "voti             dict             n=3\n",
        "x                float64          0.0\n",
        "y                float32          1.0\n",
        "ye               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "z                float32          inf\n"
       ]
      }
     ],
     "prompt_number": 232
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "IPython supporta le  \"magic functions\" facendo preceder il comando dal carattere %. Per esempio run e whos sono magic functions. \n",
      "Essendo per default settato il comando automagic si pu\u00f2 anche non mettere il simbolo % prima delle magic functions.\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "del var"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 233
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "whos"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Variable         Type             Data/Info\n",
        "-------------------------------------------\n",
        "A                ndarray          3x3: 9 elems, type `float64`, 72 bytes\n",
        "P1               Punto            (2, 3)\n",
        "P2               Punto            (3, 4)\n",
        "P3               Punto            (5, 7)\n",
        "Punto            type             <class '__main__.Punto'>\n",
        "a                complex          (-1+0j)\n",
        "b                complex          1j\n",
        "c                str              la mia seconda stringa \\n<...>righe\\nin tutto tre righe\n",
        "cmath            module           <module 'cmath' (built-in)>\n",
        "d                str              CiaoCiao\n",
        "df               float64          2.71828182846\n",
        "dfh              ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "division         _Feature         _Feature((2, 2, 0, 'alpha<...> 0, 0, 'alpha', 0), 8192)\n",
        "epsmach          function         <function epsmach at 0x04F19B70>\n",
        "epsmio           float            2.220446049250313e-16\n",
        "err4             ndarray          4: 4 elems, type `float64`, 32 bytes\n",
        "err6             ndarray          6: 6 elems, type `float64`, 48 bytes\n",
        "errass           ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "errore           float64          0.0998287306223\n",
        "errrel           ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "esempio_radici   function         <function esempio_radici at 0x04F19858>\n",
        "file             str              CIAO; provo a scrivere ne<...> a scrivere nel file; 4\\n\n",
        "g                int              4\n",
        "g1               int              1\n",
        "g2               int              2\n",
        "g3               str              ciao\n",
        "h                ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "imp              module           <module 'importlib' from <...>\\importlib\\\\__init__.py'>\n",
        "k                str              \\n\n",
        "kmio             int              52\n",
        "mt               module           <module 'math' (built-in)>\n",
        "n                int              1000000000000000000000000000000\n",
        "np               module           <module 'numpy' from 'C:\\<...>ges\\\\numpy\\\\__init__.py'>\n",
        "p                ndarray          7: 7 elems, type `int32`, 28 bytes\n",
        "p4               ndarray          5: 5 elems, type `int32`, 20 bytes\n",
        "p6               ndarray          7: 7 elems, type `int32`, 28 bytes\n",
        "pf               TextIOWrapper    <_io.TextIOWrapper name='<...>de='r' encoding='cp1252'>\n",
        "plt              module           <module 'matplotlib.pyplo<...>\\\\matplotlib\\\\pyplot.py'>\n",
        "pm               module           <module 'primo_modulo' fr<...>ebooks\\\\primo_modulo.py'>\n",
        "print_function   _Feature         _Feature((2, 6, 0, 'alpha<...>0, 0, 'alpha', 0), 65536)\n",
        "r1               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r2               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r3               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "r4               ndarray          4: 4 elems, type `complex128`, 64 bytes\n",
        "r6               ndarray          6: 6 elems, type `complex128`, 96 bytes\n",
        "rad              float64          0.00479367628048\n",
        "s                float32          nan\n",
        "sfile            set              {';', 'f', 'i', 'c', '1',<...>'3', '\\n', 's', 'p', 'A'}\n",
        "somma            function         <function somma at 0x04EBB270>\n",
        "somma2           function         <function somma at 0x04F19978>\n",
        "sommal           function         <function <lambda> at 0x04F19A50>\n",
        "sp               module           <module 'scipy' from 'C:\\<...>ges\\\\scipy\\\\__init__.py'>\n",
        "v                list             n=3\n",
        "vl               list             n=3\n",
        "voti             dict             n=3\n",
        "x                float64          0.0\n",
        "y                float32          1.0\n",
        "ye               ndarray          500: 500 elems, type `float64`, 4000 bytes\n",
        "z                float32          inf\n"
       ]
      }
     ],
     "prompt_number": 234
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "In spyder per visualizzare le variabili si usa  la finestra variable explorer. "
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Istruzioni di assegnazione"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a = 3\n",
      "b = 2*a\n",
      "print(type(b))\n",
      "print(b)\n",
      "d=a*b\n",
      "print(d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "<class 'int'>\n",
        "6\n",
        "18\n"
       ]
      }
     ],
     "prompt_number": 235
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "b = 'Ciao'\n",
      "print(type(b))\n",
      "\n",
      "c = b + b\n",
      "print(c)\n",
      "\n",
      "d=2*b\n",
      "print(d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "<class 'str'>\n",
        "CiaoCiao\n",
        "CiaoCiao\n"
       ]
      }
     ],
     "prompt_number": 236
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Per le liste l'istruzione di assegnazione fa condividere alle due variabili le stesse locazioni di memoria:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a =[1,2,'ciao']\n",
      "b=a\n",
      "b[2]=10\n",
      "print(a) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[1, 2, 10]\n"
       ]
      }
     ],
     "prompt_number": 237
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Il modo pi\u00f9 semplice per fare la copia di una lista e copiare non l'oggetto ma tutti gli elementi"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a =[1,2,'ciao']\n",
      "b=a[:]\n",
      "b[2]=10\n",
      "print(a)\n",
      "print(b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[1, 2, 'ciao']\n",
        "[1, 2, 10]\n"
       ]
      }
     ],
     "prompt_number": 238
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "La lunghezza di una lista si trova con la funzione len"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "len(a)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 239,
       "text": [
        "3"
       ]
      }
     ],
     "prompt_number": 239
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Tuple"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a=(1,2,'ciao')\n",
      "b=a\n",
      "a[0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 240,
       "text": [
        "1"
       ]
      }
     ],
     "prompt_number": 240
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Non si possono aggiornare gli elementi di una tupla come quelli di una lista"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a[0]=10"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "TypeError",
       "evalue": "'tuple' object does not support item assignment",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[1;32m<ipython-input-242-7fdc77ffae9b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[1;31mTypeError\u001b[0m: 'tuple' object does not support item assignment"
       ]
      }
     ],
     "prompt_number": 242
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "la  tupla si pu\u00f2 spacchettare"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "(g1,g2,g3)=a\n",
      "print(g1)\n",
      "print(g2)\n",
      "print(g3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1\n",
        "2\n",
        "ciao\n"
       ]
      }
     ],
     "prompt_number": 243
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Dictionary"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "voti = {\"Maria\":10,\"Antonio\":7, \"Giovanni\":9}\n",
      "print(voti)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "{'Maria': 10, 'Antonio': 7, 'Giovanni': 9}\n"
       ]
      }
     ],
     "prompt_number": 244
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "voti.values()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 245,
       "text": [
        "dict_values([10, 7, 9])"
       ]
      }
     ],
     "prompt_number": 245
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "voti.keys()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 246,
       "text": [
        "dict_keys(['Maria', 'Antonio', 'Giovanni'])"
       ]
      }
     ],
     "prompt_number": 246
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "voti[\"Giovanni\"]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 247,
       "text": [
        "9"
       ]
      }
     ],
     "prompt_number": 247
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "len(voti)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 248,
       "text": [
        "3"
       ]
      }
     ],
     "prompt_number": 248
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Funzioni"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def somma(a,b=1):\n",
      "    s=a+b\n",
      "    return(s)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 249
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "somma(2,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 250,
       "text": [
        "5"
       ]
      }
     ],
     "prompt_number": 250
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def somma(a,b=1):\n",
      "    s=a+b\n",
      "    a=4\n",
      "    return(s)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 251
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "a=3\n",
      "print(somma(a))\n",
      "print(a)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "4\n",
        "3\n"
       ]
      }
     ],
     "prompt_number": 252
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "somma2 = somma  # le funzioni sono oggetti posso usarli in operazioni di assegnazione \n",
      "print(somma2(2,3))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "5\n"
       ]
      }
     ],
     "prompt_number": 253
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "somma2=2*somma # non posso per\u00f2 moltplicare una funzione con uno scalare"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "TypeError",
       "evalue": "unsupported operand type(s) for *: 'int' and 'function'",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[1;32m<ipython-input-254-15cf9a54b47c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0msomma2\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0msomma\u001b[0m \u001b[1;31m# non posso per\u00f2 moltplicare una funzione con uno scalare\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for *: 'int' and 'function'"
       ]
      }
     ],
     "prompt_number": 254
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "somma2=somma*somma # e neanche due funzioni fra loro"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "TypeError",
       "evalue": "unsupported operand type(s) for *: 'function' and 'function'",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[1;32m<ipython-input-255-88ed40513481>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0msomma2\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0msomma\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0msomma\u001b[0m \u001b[1;31m# e neanche due funzioni fra loro\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for *: 'function' and 'function'"
       ]
      }
     ],
     "prompt_number": 255
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Funzioni semplici si possono implementare usando le cosidette lambda function"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "print(\"lambda function utilizzo = \",  (lambda a,b:a+b)(2,3)  )"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "lambda function utilizzo =  5\n"
       ]
      }
     ],
     "prompt_number": 256
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "sommal =  (lambda a,b:a+b)  # assegnazione \n",
      "print(sommal(2,3))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "5\n"
       ]
      }
     ],
     "prompt_number": 257
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Esempio semplice ciclo di selezione"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def somma(vl):\n",
      "    \"\"\"\n",
      "    somma dei primi due elementi di una lista\n",
      "    input  lista\n",
      "    output  tupla (somma , messaggio di errore)\n",
      "    \"\"\"\n",
      "    n=len(vl)\n",
      "    if n == 2:\n",
      "       s=vl[0]+vl[1]\n",
      "       errormessage = \"nessun errore\"\n",
      "    elif n > 2:\n",
      "       s=vl[0]+vl[1]\n",
      "       errormessage = \"solo i primi due elementi sono stati sommati\"\n",
      "    else:\n",
      "       s=vl[0]\n",
      "       errormessage = \"s contiene un singolo elemento\"         \n",
      "    vl[0]=5\n",
      "    return(s, errormessage)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 258
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "vl = [1,2,3]\n",
      "print(somma(vl))\n",
      "print(vl)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(3, 'solo i primi due elementi sono stati sommati')\n",
        "[5, 2, 3]\n"
       ]
      }
     ],
     "prompt_number": 259
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "help(somma)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Help on function somma in module __main__:\n",
        "\n",
        "somma(vl)\n",
        "    somma dei primi due elementi di una lista\n",
        "    input  lista\n",
        "    output  tupla (somma , messaggio di errore)\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 260
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Esempio ciclo di ripetizione while.\n",
      "\n",
      "Costruiamo una funzione che abbia come dati di input la base usata dal calcolatore e in output la precisione di macchina. Ricordo che la precisione di macchina e'  il numero, potenza della base, che aggiunto ad 1 genera il successivo numero di macchina. Un numero pi\u00f9 piccolo della precisione di macchina aggiunto ad uno genera zero."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import numpy as np\n",
      "def epsmach(base):\n",
      "    epsmach = 1\n",
      "    k = 0\n",
      "    while ((1+epsmach) > 1):\n",
      "        epsmach = epsmach/base\n",
      "        k = k+1\n",
      "    return (epsmach*2, k-1)\n",
      "\n",
      "print(epsmach(2))\n",
      "print(np.finfo(1.0).eps)\n",
      "epsmio, kmio = epsmach(2)\n",
      "print('eps =',epsmio,',  k =',kmio)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(2.220446049250313e-16, 52)\n",
        "2.22044604925e-16\n",
        "eps = 2.220446049250313e-16 ,  k = 52\n"
       ]
      }
     ],
     "prompt_number": 261
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Esempio ciclo di ripetizione for.\n",
      "Funzione che calcola per n volte la radice quadrata di un numero e per n volte il quadrato del numero risultante. Esempio di ciclo for, esempio di errori di arrotondamento"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "def  esempio_radici(xt,n):\n",
      "    x=xt\n",
      "    for i in range(0,n,1):\n",
      "      x = np.sqrt(x)\n",
      "     \n",
      "    for i in range(0,n):\n",
      "      x = x**2\n",
      "\n",
      "    errore_relativo = abs(xt-x)/abs(xt)\n",
      "    return (x, errore_relativo)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 262
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "n = 55\n",
      "x, errore = esempio_radici(100,n)\n",
      "print('x =',x,',n = ', n,', errore= ',errore)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "x = 1.0 ,n =  55 , errore=  0.99\n"
       ]
      }
     ],
     "prompt_number": 266
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Vettori e Matrici"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A = np.array([3., 5., 6.]) # per utilizzare vettori e matrici facciamo ricorso a numpy\n",
      "print(A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[ 3.  5.  6.]\n"
       ]
      }
     ],
     "prompt_number": 267
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A.size"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 268,
       "text": [
        "3"
       ]
      }
     ],
     "prompt_number": 268
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[0] + A[1] + A[2]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 269,
       "text": [
        "14.0"
       ]
      }
     ],
     "prompt_number": 269
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.sum(A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 270,
       "text": [
        "14.0"
       ]
      }
     ],
     "prompt_number": 270
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.min(A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 271,
       "text": [
        "3.0"
       ]
      }
     ],
     "prompt_number": 271
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.argmin(A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 272,
       "text": [
        "0"
       ]
      }
     ],
     "prompt_number": 272
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[np.argmin(A)]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 273,
       "text": [
        "3.0"
       ]
      }
     ],
     "prompt_number": 273
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.argmax(A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 274,
       "text": [
        "2"
       ]
      }
     ],
     "prompt_number": 274
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[np.argmax(A)]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 275,
       "text": [
        "6.0"
       ]
      }
     ],
     "prompt_number": 275
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A=np.array([[  3.,   5.,   7.],\n",
      "           [  8.,   9.,  10.],\n",
      "           [  2.,   3.,   5.]])\n",
      "A"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 276,
       "text": [
        "array([[  3.,   5.,   7.],\n",
        "       [  8.,   9.,  10.],\n",
        "       [  2.,   3.,   5.]])"
       ]
      }
     ],
     "prompt_number": 276
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[0,0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 277,
       "text": [
        "3.0"
       ]
      }
     ],
     "prompt_number": 277
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[:,0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 278,
       "text": [
        "array([ 3.,  8.,  2.])"
       ]
      }
     ],
     "prompt_number": 278
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[0,:]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 279,
       "text": [
        "array([ 3.,  5.,  7.])"
       ]
      }
     ],
     "prompt_number": 279
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "A[1:3,1:3]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 280,
       "text": [
        "array([[  9.,  10.],\n",
        "       [  3.,   5.]])"
       ]
      }
     ],
     "prompt_number": 280
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.linspace(0,5,20)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 281,
       "text": [
        "array([ 0.        ,  0.26315789,  0.52631579,  0.78947368,  1.05263158,\n",
        "        1.31578947,  1.57894737,  1.84210526,  2.10526316,  2.36842105,\n",
        "        2.63157895,  2.89473684,  3.15789474,  3.42105263,  3.68421053,\n",
        "        3.94736842,  4.21052632,  4.47368421,  4.73684211,  5.        ])"
       ]
      }
     ],
     "prompt_number": 281
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "np.logspace(0,5,10)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 282,
       "text": [
        "array([  1.00000000e+00,   3.59381366e+00,   1.29154967e+01,\n",
        "         4.64158883e+01,   1.66810054e+02,   5.99484250e+02,\n",
        "         2.15443469e+03,   7.74263683e+03,   2.78255940e+04,\n",
        "         1.00000000e+05])"
       ]
      }
     ],
     "prompt_number": 282
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "%matplotlib inline\n",
      "import matplotlib.pyplot as plt\n",
      "\n",
      "x=np.logspace(0,9,500)\n",
      "r1=x*(np.sqrt(x**2+1)-x)\n",
      "r2=x*np.sqrt(x**2+1)-x**2\n",
      "r3=x/(np.sqrt(x**2+1)+x)\n",
      "v=plt.semilogx(x,r1,'r.',x,r2,'b.',x,r3,'g-',lw=2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEFCAYAAAAG45eHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFSdJREFUeJzt3X+Q3HV9x/Hn+y4RPAocmAAKMXGEEFCmRCMyisNadcQ4\nBadIVeoP0HrWVsV2FKvDNLG2teo49deoXPlR2hoBf6FWUouVixSqIwokCvGIAg1kCES4EIjkx92n\nf3z3kmOze7t3t3u7+7nnY2Zn97vfz36/79vbvPaTz/fz/V6klJAk5amn3QVIklrHkJekjBnykpQx\nQ16SMmbIS1LGDHlJytikIR8RiyLixoj4ZUT8I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9RTPe9\njvLMsXbXNWH901r5uZrie/UnwHnlNtd0Qk3ldc8GBjvlcw68H3hZuU1H/O4q1l/XyPbrnQzVsJTS\nTeWTpibad4EzgIgYv8DZ54AvlMdOv9OsGmZaV0RsBf4BODUiPpQmnNnbrpqAVwKvAA6LiONTSpe2\nu6aIOIpiyO1g4MZW1DPVmlJKl5SX3wY8nMr/EtpdV0QsoxjS6gc+3wk1AZ8FPh8RLwOGOqSmu4C3\nA1e0qp5p1HQ98DdRHDe8pxNqioidwEeAQ4BPNrL9poV8DdUuXvbilNJOil9ou9Sq6xGKse92qFXT\ne2lhONRRq6Z1wLr2lFS9pvGFlNJVs15RodZ79Y/At9pTUs2afge069hTzd9fSml1Owqi9vu0Hnh9\ne0qqWdN9wLumsqFWH3jt1DOtOrEua2pMJ9YEnVmXNTUm65paHfIPAIsmLC+iM47md2Jd1tSYTqwJ\nOrMua2pM1jW1OuT3XeAsIp5GMQWwpWPwDerEuqype2uCzqzLmqypqbNrvkpxpcpdFGNJF5affw3w\nK4ojxR9u5ZHzbqnLmrq3pk6ty5qsqdbNC5RJUsa8do0kZcyQl6SMGfKSlDFDXpIyZshLUsYMeUnK\nmCEvSRkz5CUpY4a8JGXs/wEehXIlHEnNzAAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x63cfbf0>"
       ]
      }
     ],
     "prompt_number": 283
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import matplotlib.pyplot as plt\n",
      "%matplotlib qt  # funzione di Ipython \n",
      "x=np.logspace(0,9,500)\n",
      "\n",
      "r1=x*(np.sqrt(x**2+1)-x)\n",
      "r2=x*np.sqrt(x**2+1)-x**2\n",
      "r3=x/(np.sqrt(x**2+1)+x)\n",
      "\n",
      "v=plt.semilogx(x,r1,'r.',x,r2,'b.',x,r3,'g-',lw=2)\n",
      "print(v)\n",
      "print(v[0])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "UsageError: unrecognized arguments: # funzione di Ipython"
       ]
      }
     ],
     "prompt_number": 284
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Approssimazione della derivata usando le differenze in avanti"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "#%%\n",
      "h = np.array([0.1, 0.01, 0.001, 1e-4, 1e-7, 1e-12])\n",
      "# approssimazione della derivata di exp(1) differenze in avanti\n",
      "dfh = (np.exp(1+h)-np.exp(1))/h\n",
      "# valore esatto\n",
      "df = np.exp(1)\n",
      "# errore assoluto\n",
      "errass = np.abs(df-dfh)\n",
      "errrel = errass/np.abs(df)\n",
      "# grafico in scala logaritmica\n",
      "plt.loglog(h,errrel,'o-b')\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEHCAYAAACncpHfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNXdx/HPz7CEIlahta0YpVL1EWsfsRTUKqQvlkR4\nFHdEoa5YscatKsoisYIi1kKD1UrZBCog1SqQCgglgFgtaK1YBZWKZVFwq1VrAonn+eMMdowBZjJ3\n7p3l+369fJl7mdzzu5Pk/Oae1ZxziIhI/tkn6gBERCQaSgAiInlKCUBEJE8pAYiI5CklABGRPKUE\nICKSp5QARETylBKAiEieSmsCMLNvm9kkM5ubznJERCR5aU0Azrk3nHOXpbMMERFpnIQSgJlNMbNt\nZra23vlSM1tnZq+Z2ZD0hCgiIumQ6BPAVKA0/oSZFQD3xs53APqb2VFmNtDMxpnZQcGGKiIiQUoo\nATjnVgIf1DvdGXjdObfRObcTmA30dc7NcM5d55zbamatzew3wLF6QhARySxNUvjetsCmuOPNQJf4\nFzjn3geu2NNFzEzLkYqINIJzzlL5/lQ6gQOruJ1ze/1v5MiRjXpN/XPxx429ZqKv2V1Zi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Pd2xY5cbOlwPHh3y/LYBJ+H0yBodc9hmx37XZQNcw3+vYv10I9A75\nnrsBv4r9fl8bYrlXk2S9FWDZCdddad0QpgHxzRvg2yG7xL/AOfc+vt0s3oSIyq1/HFa5l6RYbrIx\nvAn8JMAykyn7ReDssMuNlV0edrnOuU+BdPQtJVL2H4A/hF1uXPkPhl22c245sDyCcivwST5oja1T\nGhR2J3BUkw7yrdx4UcaQb++73uv8KDtn7jnsBBDV+kH5Vm6mxJBv77vea91zVpUddgKIav2gfCs3\nU2LIt/dd77XuObvKbmznRAKdF7OArUANvs3q4tj5U4D1+E7PW1RubsSQb++73mvdcy7cs9YCEhHJ\nUxk3E1hERMKhBCAikqeUAERE8pQSgIhInlICEBHJU0oAIiJ5SglARCRPKQGIiOSp/wdou1MnSZ4i\nowAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x6388d70>"
       ]
      }
     ],
     "prompt_number": 285
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "#%%\n",
      "# costruiamo un vettore con elementi\n",
      "# che variano da 10**(-16) a 1\n",
      "h = np.logspace(-19,0,500)\n",
      "# approssimazione della derivata\n",
      "dfh = (np.exp(1+h)-np.exp(1))/h\n",
      "# valore esatto\n",
      "df = np.exp(1)\n",
      "# errore assoluto\n",
      "errass = np.abs(df-dfh)\n",
      "errrel = errass/np.abs(df)\n",
      "# grafico in scala logaritmica\n",
      "plt.loglog(h,errrel,'*-r')\n",
      "plt.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEHCAYAAACgHI2PAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnWl4VFXWtu9dlRoTkpCEGUJAmUGcRUFBbSVIeJXBlhh6\nQE0cogioDUE/RdvGV9CooGghLdoJg92A2k4EbQegfVtFBRGRDgISIAESMldS4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F02YEhEpuSgHj4iIiD/qdSMiUnLRF/qEfjlXmtkeM3vVzFYHznKDmb1mZm+a2fdFZmmT52Yz\nO1jLdFPgLJfXcnxoZo8EzhK8x1LIddsmT9C125Il2LpNyBJs3bbJ42XtRl/oE/rjjAE7nXNPAg+G\nzOKc+8459wTwOfBOkVmS8gDzwBSwhILvgEp4bQ7XXpt7gJWBs8TQYynYuk0Seu22CLZuW4Vct23y\neFm7hRV6j/1yJoB7zGw7cFHgLHX3Ae9lyeI5z0Hn3G3AJmBr4CyY2Z3Afqqfmg6axZccmXKvW895\n6nKtXU9Zcq9bj1lyr1vfebxwzhXyB1gBXA0cato3DPwMLAfOA34ArgAeAF4GRpv+7UctjzcMfBo6\nC3AJ8EZkr81I675QWWr79sWQJetr4jlT5nXrO4+Ptev5tcm8bn1nybNui1jLXT+/rx8k5Q+7vOUH\nvQ74sml7E7Cp5XuWAa8DR4GNwKXALmA3cH2gLD8DG2v7tgDXRvDabALurm1/ANwYOMtNwI7a/9W6\nwGvmnO1A/1de1q2vPD7XrofXxsu69ZTFy7rt1VrO+tx5WiD4kLVfzuOxZHHObelBlsx5gL0RZfk2\noiypeiz1MNOv9GbdZspTy7QlhizOub30Zt1myfItvVm3WfMkreWuhb4YG9NN/DFlgbjyKEtnsWWK\nKY+ytFdYntCFPqZ+OTFlgbjyKEtnsWWKKY+ytFdYntCFPqZ+OTFliS2PsvRXppjyKEsMeXxebFjk\nQsT7wAlglup5qYdq+28FfqJ6gXPzoGWJLY+y9FemmPIoS7x51OtGRKTkQp+6ERGRHlOhFxEpORV6\nEZGSU6EXESk5FXoRkZJToRcRKTkVehGRklOhFxEpuf8BebZGlY7tlPYAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x76869d0>"
       ]
      }
     ],
     "prompt_number": 286
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "\n",
      "# esempio di problema mal condizionato\n",
      "# trovare le radici multiple di polinomi\n",
      "# (x-1)^4\n",
      "\n",
      "p4 = np.array([1, -4, 6, -4, 1])\n",
      "r4 = np.roots(p4)\n",
      "# roots calcola le radici\n",
      "# errore relativo\n",
      "err4 = abs(r4-1)\n",
      "print (\"errore assoluto polinomio di grado 4\" )\n",
      "for rad in err4:\n",
      "    print (rad)\n",
      "# calcoliamo le radici di (x-1)^6\n",
      "\n",
      "p6 = np.array([ 1, -6, 15, -20, 15, -6, 1])\n",
      "r6 = np.roots(p6)\n",
      "# roots calcola le radici \n",
      "# errore relativo\n",
      "err6 = abs(r6-1)\n",
      "\n",
      "print( \"errore assoluto polinomio di grado 6\" )\n",
      "for rad in err6:\n",
      "    print (rad)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "errore assoluto polinomio di grado 4\n",
        "0.00021716253075\n",
        "0.00021713185991\n",
        "0.00021713185991\n",
        "0.000217101202328\n",
        "errore assoluto polinomio di grado 6\n",
        "0.00479996633537\n",
        "0.00479841997446\n",
        "0.00479841997446\n",
        "0.0047952747979\n",
        "0.0047952747979\n",
        "0.00479367628048\n"
       ]
      }
     ],
     "prompt_number": 287
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Grafico di un polinomio in un intervallo specificato"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import matplotlib.pyplot as plt\n",
      "%matplotlib qt\n",
      "p = np.array([1,-6,15,-20,15,-6,1]) # coefficienti del polinomio  (x-1)^6\n",
      "x = np.linspace(0.995,1.005,500)  # intervallo [0.995,1.005] \n",
      "y = (x-1)**6\n",
      "ye = np.polyval(p,x)#funzione per valutare un polinomio in un punto\n",
      "plt.plot(x,y,'-b',lw=4)\n",
      "plt.plot(x,ye,'og')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 288,
       "text": [
        "[<matplotlib.lines.Line2D at 0x751a8f0>]"
       ]
      }
     ],
     "prompt_number": 288
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Moduli"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "I moduli sono dei file che contengono oggetti Python come funzioni o classi o variabili che possono essere importati e utilizzati da altri moduli e possono far parte di pacchetti pi\u00f9 complessi.\n",
      "Scriviamo il modulo nel file primo_modulo.py"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import primo_modulo as pm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "print(pm.a)\n",
      "print(pm.b)\n",
      "print(pm.somma(2,3))\n",
      "print(pm.prodotto(2,2))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Se modifichiamo il codice del modulo pm  aggiungendo, per esempio, una funzione dobbiamo ricaricarlo con l'istruzione"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "import importlib as imp\n",
      "imp.reload(pm)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Files\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pf =open(\"provafile.txt\",\"w\")\n",
      "pf.write(\"CIAO, provo a scrivere nel file\\n\")\n",
      "pf.write(\"CIAO, provo ancora a scrivere nel file\\n\")\n",
      "pf.close()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pf =open(\"provafile.txt\",\"r\")\n",
      "print(pf.read())\n",
      "pf.close()\n",
      "pf =open(\"provafile.txt\",\"r\")\n",
      "print(pf.readline())\n",
      "print(pf.readline())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pf =open(\"provafile.txt\",\"w\")\n",
      "pf.write(\"CIAO; provo a scrivere nel file; 1\\n\")\n",
      "pf.write(\"CIAO; provo a scrivere nel file; 2\\n\")\n",
      "pf.writelines([\"CIAO; provo a scrivere nel file; 3\\n\",\"CIAO; provo a scrivere nel file; 4\\n\" ])\n",
      "pf.close()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pf =open(\"provafile.txt\",\"r\")\n",
      "file = pf.read()\n",
      "print(file)\n",
      "pf.close()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Alcuni esempi di operazioni sulle stringhe"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for k in file:\n",
      "    print (k)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sfile = set(file)\n",
      "print(sfile)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(file.upper())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(file.lower())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(file.split())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(file.split(';'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Classi"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "class Punto: \n",
      "  def __init__(self, x=0, y=0): \n",
      "    self.x = x \n",
      "    self.y = y \n",
      "  def __str__(self): \n",
      "    return '(' + str(self.x) + ', ' + str(self.y) + ')' "
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "P1= Punto(2,3)\n",
      "print(P1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "class Punto: \n",
      "    \"\"\"Classe punto\"\"\"\n",
      "    def __init__(self, x=0, y=0): \n",
      "        self.x = x \n",
      "        self.y = y     \n",
      "    def __add__(self,AltroPunto):\n",
      "        return Punto(self.x + AltroPunto.x, self.y + AltroPunto.y) \n",
      "    def __str__(self): \n",
      "        return '(' + str(self.x) + ', ' + str(self.y) + ')' "
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "P1= Punto(2,3)\n",
      "P2=Punto(3,4)\n",
      "P3= P1+P2\n",
      "print(P3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(Punto.__doc__)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}