Skip to content
Lorena A. Barba edited this page May 21, 2025 · 1 revision
Screenshot 2025-05-21 at 6 31 22 PM

"Land on Vector Spaces with Python," or EngComp4 is the fourth learning module of the Engineering Computations collection.

Since August 2019, until April 2025, the module was complemented by an open online course in a self-hosted instance of the Open edX learning platform. After all these years years, this platform is being taken offline. Here, we reproduce the contents of the "About" page of the online course.

Course Description

This is the fourth module in Engineering Computations (EngComp4), applying Python and core numerical libraries (NumPy, SymPy, Matplotlib) to explore the foundations of linear algebra, with a geometrical and practical approach.

You learn to view matrices as linear transformations of vectors, and develop intuition about their role in linear systems of equations. Playing with transformations, you understand eigenvalues and eigenvectors, and discover matrix decomposition. We use Python to compute all the eigenthings and apply them to population models in ecology, Markov Chains, and the Google Page Rank algorithm. You learn about singular-value decomposition and its application to image compression, least squares problems, and linear regression.

The target audience is second-year science and engineering students, with minimal background in linear algebra through a first college course or even high-school mathematics.

What You'll Learn

  • Making linear combinations of vectors, and the concepts of basis vectors and span
  • Matrix-vector multiplication as a combination of the matrix columns scaled by the vector coordinates
  • Setting up special transformation like rotation, shear, scaling, identity
  • What is special about eigenvectors: they stay on their span after transformation
  • Using functions from the NumPy Linalg library to compute vector norms, solve linear systems, find eigenvalues
  • Applications of eigenvectors in ecology, Markov Chains, Google's PageRank algorithm
  • Computing singular value decomposition and applying it to image compression, least squares problems, and linear regression

Instructor

Lorena A. Barba Professor of Mechanical and Aerospace Engineering The George Washington University

Course Outline

  • Get started!

    • Overview
    • Graded HW1
    • Graded HW2
    • Copyright notice
  • Transform all the vectors

    • Vectors
    • Matrices
    • Some special transformations
    • Matrix-matrix multiplication
    • What we've learned
    • Quiz
  • The matrix is everywhere

    • As a linear transformation
    • A circle to an ellipse
    • A system of equations
    • A change of basis
    • Matrices in three-dimensional space
    • What we've learned
    • Graded HW3
    • Quiz
  • Eigenvectors for the win

    • Geometry of eigendecomposition
    • Eigendecomposition in general
    • Compute eigenthings in Python
    • Applications
    • Quiz
    • Graded HW4
  • Stick to the essentials: SV

    • Geometry of singular-value decomposition
    • Compute SVD in Python
    • SVD in higher dimension
    • Application to image compression
    • Non-square matrices
    • Graded HW5
    • Final Challenge

About This Course

This is the fourth learning module of the “Engineering Computations” series. It explores the foundations of linear algebra through a geometrical and practical approach, using computational thinking.

This learning module uses the Python programming language, and Jupyter notebooks. All of the learning tools are free and open source, and all the materials are open and free.

The module consists of four lessons:

  1. Transform all the vectors
  2. The matrix is everywhere
  3. Eigenvectors for the win
  4. Stick to the essentials: SVD

Requirements

This module assumes a foundation in Python programming, as provided by completing our first module, "Get Data Off the Ground with Python." It assumes minimal or no background in linear algebra.

Lessons

Follow the links below to see each lesson rendered by the nbviewer service as a static webpage.

You can also launch an interactive session with the course's Jupyter notebooks using the free Binder service. Try it!

Launch in Binder

After Binder launches, you should see a Jupyter dashboard (file navigator). Select the folder notebooks_en to access the four lessons of this course as fully executable Jupyter notebooks.

Please note that Binder is a free service from Project Jupyter. Depending on demand, it can be a bit slow. But it's free!

Lesson 1: Transform all the vectors

What is a vector? The physicist's view versus the computer scientist's view. Fundamental vector operations: visualizing vector addition and multiplication by a scalar. Intuitive presentation of basis vectors, linear combination and span. What is a matrix? A matrix as a linear transformation mapping a vector in one space, to another space. Visualizing linear transformations. Matrix-vector multiplication: a linear combination of the matrix columns. Some special transformations: rotation, shear, scaling. Matrix-matrix multiplication: a composition of two linear transformations. Idea of inverse of a matrix as a transformation that takes vectors back to where they came from.

Lesson 2: The matrix is everywhere

A matrix is a linear transformation… visualize it. Norm of a vector. A matrix maps a circle to an ellipse… visualize it. A vector that doesn't change direction after a linear transformation is an eigenvector of the matrix. A matrix is a system of equations… visualize it (row perspective). Inconsistent and underdetermined systems. A matrix is a change of basis… visualize it. An inverse of that matrix will change the vector's coordinates back to the original basis. Matrices in three-dimensional space: linear transformations in 3D; 3D systems of linear equations; dimension and rank. Visualize the transformations of rank-deficient matrices.

Lesson 3: Eigenvectors for the win

Geometry of eigendecomposition. Eigenvectors revisited: a matrix transforms a circle to an ellipse, whose semimajor and semiminor axes align with the eigenvectors. Composition of scaling transformation and a rotation transformation: not enough! Complete the composition. Symmetric matrices, orthogonal eigenvectors. Eigendecomposition in general. Diagonalizable matrices. Similar matrices. Eigendecomposition is similarity via a change of basis. Compute eigenthings in Python, using NumPy or SymPy. Eigenvalues in ecology: matrix population models. Markov chains. PageRank algorithm.

Lesson 4: Stick to the essentials: SVD

Geometrical interpretation of singular value decomposition (SVD). While eigendecomposition is a combination of change of basis and stretching, SVD is a combination of rotation and stretching, which can be treated as a generalization of eigendecomposition. Example: SVD in image compression. A 2D image can be represented as an array where each pixel is an element of the array. By applying SVD and dropping smaller singular values, we can reconstruct the original image at a lower computational and memory cost. Non-square matrices: SVD in general; pseudo-inverse. Application to linear least squares; linear regression with SVD.

Frequently Asked Questions

Why are you using Python?

Python is free. Python is a complete programming solution, with excellent interactive options and visualization tools. Python is a good learning language: it has easy syntax, it is interpreted and it has dynamic typing. Python has a large community: people post and answer each other's questions about Python all the time. For numerical computing, Python libraries can do everything you need to do. Python is exploding in popularity and is used for teaching programming at the top schools. Python is used in industry; it can help you get a job.

I'm having problems viewing the course. Could it be my browser?

The Open edX platform works best with current versions of Chrome, Firefox or Safari, or with Internet Explorer version 9 and above. See the list of supported browsers for the most up-to-date information.

What software do I need for this course?

At first, you can work on this course without any new software: just your browser. We will guide you to use free online resources for interactive computing with Python and Jupyter. For example, you can follow along with our lessons using the free website jupyter.org/try. Bear in mind that it doesn't give you permanent storage: if you create a Jupyter document on this service, be sure to download it before leaving the website.

What is Jupyter?

Jupyter is a set of open-source tools for interactive computing. At the center of the Jupyter world is the Notebook: a document that combines text and multi-media content with executable code. It is a powerful platform to learn computing because it lets you chunk a program into small, digestible portions, and intermix these with narration and explanation. It is also becoming the staple environment to develop ideas and present finished analyses in data science and engineering.

What does it mean that the course materials are open?

It means that the authors of all the materials used in this course give everyone in the world a license to use the material in any way, to redistribute, modify and essentially do whatever they like with it. The only condition is that we are given attribution. Content is under a Creative Commons CC-BY 4.0 International license and code is under a BSD 3-clause license.

Is there a required textbook for this course?

There is no required textbook. We have written up original materials and share them with everyone completely free.

I'm an instructor at another institution. Can I adopt these materials for my course?

Feel free! We're happy if you use the materials in any way. All we ask is that you attribute the materials to us.