Module page
Laboratory of programming and calculus
academic year: | 2013/2014 |
instructor: | Biancamaria Della Vecchia |
degree course: | Mathematics - DM 270/04 (triennale), I year |
type of training activity: | affine e integrativa |
credits: | 9 (72 class hours) |
scientific sector: | MAT/08 Analisi numerica |
teaching language: | italiano |
program: | A-H |
period: | I sem (30/09/2013 - 17/01/2014) |
Lecture meeting time and location
Presence: highly recommended
Module aims: The main goal is to introduce the students to a constructive approach to mathematics also by means of personal computers. In this respect, the course complements other courses of the first year where the logic/deductive point of view is more emphasized. A major part of this course will be devoted to problem solving, to the analysis of basic algorithms and to their implementation in C.
Module subject: Introduction to C++ language: types of variables, type conversion, arrays, logical operators (or, and, not), read and write statements, conditional statements (if-else) and cycle statements (for, while, do-while). Mathematical functions. Structure of a C++ program. Functions. Passing variables. Basics on the use of pointers. Representation of integer and real numbers in computers. Error propagation in arithmetic operations. Stable and unstable algorithms: computation of pi. Computation of a polynomial in a point (Horner algorithm). Matrices, vectors and systems of linear equations: Gauss and Jacobi methods. Graphic library Gnuplot: plot of a function. Numerical methods for finding roots of a nonlinear equation: bisection, Newton and secant methods. Taylor formula for computing some mathematical functions. Polynomial interpolation. Numerical methods for computing definite integrals.
Detailed module subject: Weekly list of course lessons
Suggested reading: Materials provided by the teacher on the Web Luis J. Aguilar, "Fondamenti di programmazione in C++", McGraw-Hill, 2008 or equivalent. A. Quarteroni, R. Sacco, F. Saleri, "Matematica numerica", Springer, 2008 As an alternative: A.Quarteroni , "Elementi di Calcolo Numerico", Progetto Leonardo ,1998 J.F. Epperson, "Introduzione all'analisi numerica", McGraw-Hill, 2003
Issues:
- Very short introduction to C++ (Prof. M.Marfurt)
- Notes to use C compiler in Linux (A. Seghini)
- Example of a simple C++ code
- Analysis of error propagation (M. Marfurt)
- C++ on Mac
- Recursive sequences and the algorithm of Erone
- Numerical solution of systems of linear equations (M. Marfurt)
- Notes on using GNUPLOT
- A small GNUPLOT tutorial
- A short course of C (M. Falcone)
- Recurrence sequences and the Erone algorithm
Type of course: standard
Exercises:
- Exercise sheet #1
- Exercise sheet #2
- Exercise sheet #3
- Exercise sheet #4
- Exercise sheet #5
- Exercise sheet #6
- Exercise #7
- Exercise sheet #8
- Exercise sheet #9
- Exercise sheet #10
- Exercise sheet #11
- Exercise sheet #12
Examination test: Text of the mid-term exam November 2013
Useful links:
- Numerical Recipes in C, Second Edition (1992) Link
- Allen B. Downey: How to think like a computer scientist (2012) Link
- M. Banahan, D. Brady, M. Doran: The C Book Link
- M. Henricson, E. Nyquist and E. Utvecklings: Industrial Strength C++ (1997) Link
- B. Eckel: Thinking in C++, 2nd edition, Volume 1 (2001) Link
- B. Eckel: Thinking in C++, 2nd edition, Volume 2 (2003) Link
- Registration to the course and middle-term exam Link
Knowledge and understanding: Successful students will be able to have a basic knowledge of programming and of the mathematical properties of simple algorithms. They will also achieve some fundamental notions about convergence, order of convergence, errors and complexity for elementary algorithms.
Skills and attributes: Successful students will be able to write a simple C code for scientific purposes and to manage elementary numerical algorithms to solve problems. They will be able to choose the appropriate algorithm for simple problems like finding the root of an equation, computing an integral or solving a linear system. During the laboratory sessions they will learn how to use PCs, graphic tools and a LAN network.
Personal study: the percentage of personal study required by this course is the 65% of the total.