Back close

Course Detail

Course Name Programming for Scientific Computing
Course Code 24CSA210
Program 5 Year Integrated MSc/ BSc. (H) in Mathematics with Minor in Data Science
Semester III
Credits 4
Campus Amritapuri

Syllabus

Unit 1

Review of programing in Python: Data types, strings, arrays, lists, conditionals, loops and iterative operations, functions, scope; Plotting using matplotlib. Error handling, basic file operations. Writing programs in multiple scripts, debugging the code with print statements or assertions; Remarks on floating point arithmetic. [2 weeks]
Sample applications (lab exercises) [2 weeks]

  1. Basic programming practice. Working with arrays:
  2. Linear interpolation of data sets; other built-in interpolation functions.
Unit 2

Array and list operations, tuples, object id and references, passing arrays by reference; sets, dictionaries; Introduction to NumPy and SciPy. Random number generators and demonstrations of simulation of probability distributions. [3 weeks]
Sample Applications (lab exercises): [2 weeks]

3. Finding roots: Newton-Raphson and bisection methods.

4. Statistical experiments like coin toss or dice problems; generating statistical samples from distributions like binomial, normal distributions, binned frequency table and histogram, estimation of statistical parameters for finite samples.

Units 3-4

Classes and OOP: definition, attributes, methods, instances, accessor and mutator methods; function classes for mathematical computations, static methods and attributes. Inheritance: generalization and specialization; Polymorphism, class hierarchies, subclasses. [4 weeks]
Sample applications and demonstrations: [5 weeks]
5. Vector and complex number classes; operator overloading.
6. Numerical Differentiation of simple functions; Numerical Integration using Trapezoid or Simpsons’ rule.
7. Solving set of first order ordinary differential equations using a Runge-Kutta method – projectile motion, simple harmonic oscillator, planetary motion; SciPy integrators;
Particle class for particle dynamics with methods to modify its position, velocity, solving for trajectory of particle using particle class supplying forces and initial conditions.

Unit 5

Recursion; Sorting and searching, and introduction to algorithmic complexity – time and memory complexity; Linear least squares fitting. [2 weeks]
Sample applications and demonstrations: [2 weeks]
8. Factorials, Fibonacci series, Euclid’s algorithm for GCD calculation.
9. Sorting randomly ordered eigenvalue-eigenvector pairs in the increasing order of eigenvalues, searching for eigenvector for a given eigenvalue or equivalent examples.
Further applications (if time permits):
10. Sample application for arrays – images. Sample exercises: I/O operations with images; data structure of images, RGB pixel arrays, extracting R, G, and B arrays, grayscale images, flipping and cropping images (slicing image arrays). [1 week]

A term project may be given during the last third of the semester, carried out in groups of two to four students.

Course Objectives and Outcomes

Course Outcomes: On successful completion, students will be able to
CO1: Understand programming language syntax and its definition by example of Python.
CO2: Adequately use standard programming constructs: branching, selection, repetition, functions, composition, modules, aggregated data (arrays, lists, etc.)
CO3: Identify and debug coding errors in a python program
CO4: Understand the concepts of error handling, basic file operations, sets, dictionaries.
CO5: Use programing as a tool to understand probability concepts; understand and fit a straight line to a linear data set, perform numerical differentiation and integration, integrate simple differential equations, solve for eigenvalues and eigenvectors, sort and search them.


Evaluation Pattern:
As in the rules for Assessment Procedure (R.14)

Textbooks/ References

  1. Tony Gaddis, Starting Out with Python, 3E, Pearson, 2015.Book contains flowcharting and pedagogical program development in an introductory Python book. Ch. 1 to 5, Ch 7.
  2. Hans Petter Langtangen, A Primer on Scientific Programming with Python, 5E, Springer, 2016. Ch. 1 to 3, Ch. 4 (carefully selected material appropriate for first year students)
  3. Christian Hill, Learning Scientific Programming with Python, 2016(carefully selected material appropriate for first year students)
  4. David J. Pine, Introduction to Python for Science and Engineering (2019, CRC Press)
  5. Peter R. Turner, Thomas Arildsen, Kathleen Kavanagh, Applied Scientific Computing with Python (2018, Springer) (SciPy interpolation functions, integrators)
  6. Zed A Shaw, Learn Python the Hard Way, 3E, Pearson, 2017
  7. Mahendra Verma, Practical Numerical Computing Using Python: Scientific & Engineering Applications, Self-Published
  8. One material and tutorials: www.python.org; https://www.learnpython.org; www.vpython.org; https://www.pythonlikeyoumeanit.com.

Skills and Employability: Entire course contents with tutorials and assignments help build foundations and develops computational thinking, programming skills – design and implementation of software for scientific, engineering and industrial computing applications in universities, industries and research labs/organizations.

DISCLAIMER: The appearance of external links on this web site does not constitute endorsement by the School of Biotechnology/Amrita Vishwa Vidyapeetham or the information, products or services contained therein. For other than authorized activities, the Amrita Vishwa Vidyapeetham does not exercise any editorial control over the information you may find at these locations. These links are provided consistent with the stated purpose of this web site.

Admissions Apply Now