Scientific Computing in Python : Online class, July 14 - 16 and 21 - 22, 2022 (in Spanish)

Cusco

4 Events in the Peruvian spring

Content of the course

Prior to the Peruvian-German Spring School and Conference on Scientific Computing, this introductory course on scientific computing implemented in the Python programming language will be offered. During the course attendees will learn about the Python programming language and the many tools it provides to assist scientists in their research. Python is currently one of the most popular languages for being high-level, easy to use, interpreted and its flexibility of interaction with other high-performance languages such as C++ among other aspects.

First an introduction to the syntax, data structures, control structures and method creation in Python language will be given. Afterwards, the module Numpy will be presented. This library brings tools for vector and matrix operations and other numerical procedures. At the same time the module scipy will be shown. The focus will be on linear algebra and ordinary differential equations solvers, numerical integration and optimization methods and other numerical methods which are implemented in these two libraries. Finally, Matplotlib module for rendering scientific figures and graphs will be presented.

The dynamic of the course is based on "learning by doing". Each class is prepared to have small talks, demonstrative Python implementations and coding challenges for the attendees. One small task will be assigned to each of you that must be carried out by yourselfs and uploaded to the website. Each task aims to consolidate the knowledge obtained during the course. Then you will have the suggestions and corrections from the teacher on how to improve it.

The demonstrations and your implementations in Python will be mainly carried out in the platform Google Colab. It allows you to write and execute Python in your own browser with no additional configuration required, access to computational resources free of charge and easy sharing.

Registration

Registration is closed!

Online Access

The classes will be held online using the platform Zoom. The link to the platform are already available for all registered participants in the events listed in the calendar.

The access code to the virtual room will be send to each participant soon.

Program

Dates for each class can be found in the following calendar:

You could also download the calendar in this link.

Course materials

Lecture #1: - Introduction to Python programming

Lecture #1: - Introduction to Python programming


Details

In this class you will learn the basic lexicographic, syntactic and semantic features of the Python language.

Nature

Important links:

You will be able to access the class published in Google Colab here

Discussion of class exercises:

Exercise #1:

It is a leap year

Exercise #2:

Print the first 10 integers

Exercise #3:

Growing pattern

Exercise #4:

Sum of the numerical series

Exercise #5:

Table of multiplication of the number n

Exercise #6:

Print the list

Exercise #7:

Sum the elements of the list

Ejercicio #8:

Adds and multiplies

Exercise #9:

It is Palindrome

Exercise #10:

It is palindrome (recursive)

Exercise #11:

Is prime number

Exercise #12:

Fibonacci sequence

Exercise #13:

Collatz con conjecture

Exercise #14:

Reverse number

Exercise #15:

Counting occurrences of an integer in a list

Exercise #16:

Make pairs

Exercise #17:

Stack calculator

Tutorials:

Working with .ipynb in Google Colab.

Mount one folder from Google Drive in Google Colab.

Interactive Forum:

You will be able to access the forum at the end of the class through the following link:

Lecture #2, #3: - Handling vectors and matrices in Python: Numpy Module

Lecture #2: - Handling vectors and matrices in Python: Numpy Module


Details

Vectors or multidimensional arrays and matrices are a fundamental pillar in the development of computational solutions related to numerical operations. When information is represented in this form then it is said to be "vectorized". One of the great advantages of vector computing is that it largely eliminates the need to use cycles explicitly. That is, operations between vectors are performed at a lower level of programming which is usually much more efficient. This avoids using one of the great disadvantages of an interpreted language such as Python: iterative control structures.

Video Lecture 2 Part 1

Video Lecture 2 Part 2

Important links:

You will be able to access the published lecture in Google Colab through the following links:

Discussion of exercises:

Working with vectors

Lecture 2 Part 2 Exercise 1

Evaluating a function in a mesh.

Lecture 2 Part 2 Exercise 2

Simulating Darcy law (2D)

Interactive Forum:

You will be able to access the forums at the end of both lectures through the following links:

Lecture #4: - Linear Algebra

Lecture #4: - Linear Algebra


Details

There are dissimilar ways to represent a matrix in Python. The np.ndArray, np.Matrix and sympy.Matrix data types allow to do so. Using these types, symbolic and numeric algebraic operations can be performed efficiently.

Video Lecture 4

Important links:

You will be able to access the published lecture in Google Colab through the following links:

Interactive Forum:

You will be able to access the forums at the end of both lectures through the following links:

Lecture #5: - Ordinary differential equations

Lecture #5: - Ordinary differential equations


Details

For solving ordinary differential equations there is the odeint function implemented in the scipy.integrate module. This is a simple interface that packages the functions of the ODEPACK library which is implemented in FORTRAN language. The numerical methods used are part of the package called LSODE.

Video Lecture 5

Important links:

You will be able to access the published lecture in Google Colab through the following links:

Interactive Forum:

You will be able to access the forums at the end of both lectures through the following links:


Projects

You will be able to evaluate yourself by solving one of the two problems presented in the following projects:
Deadline for projects

The deadline for submission of projects is July 31, 2022 at 11:59pm Peru time.

IMPORTANT: The delivery of the projects is NOT by e-mail. For this purpose another form will be enabled for you to upload your files or indicate the address of the Google Colab spreadsheet where you developed the solutions.

Upload projects

You will be able to upload your project solution through the link upload form.

There will be two ways to send it. The first one will be to compress all the files that make up your solution in a single .zip file. In the second variant you will be able to implement your solution in Google Colab and share it directly through the url of the link. In the form header you will find you will find more indications on how to perform both processes.

Examples of project solutions

Below you will find examples of solutions for both projects:


Lecturer

The course was taught by M.Sc. Dayron Chang Dominguez, researcher of the Institute for Analysis and Numerics from Otto-von-Guericke University, Germany.

Contact

For all questions regarding this Python course do not hesitate to contact Dayron Chang Dominguez.

Cusco
News
News