This GitHub repository contains the Jupyter notebooks associated with the Control Systems I course - taught by Prof. Emilio Frazzoli during the fall semester 2024.
Jupyter notebook is a web-based interactive computing platform. It provides a means to combine live code with narrated text and visualisations.
Throughout this course, Jupyter notebook(s) will be provided as a means to support and reinforce the concepts introduced in the lectures. Namely, these can be thought of as an interactive alternative to lecture notes and theory sheets.
We support two ways of using (Jupyter) notebooks:
- Downloading and running the notebooks locally. Download the files locally, and then run them using a web browser or VS Code. (Note that integrations with other IDEs exist, but we will not support them officially).
- Using Google Colab. Click on the Colab notebook link on Moodle and run them directly for there.
Note that the first option will usually result in a smoother experience, especially with interactive plots.
To get started with the course materials, you'll need to download the notebooks to your local machine. Follow one of these two methods:
A. Moodle
- Navigate to the course page on Moodle.
- Locate and download the weekly ZIP file containing the notebook.
- Move the ZIP file to a suitable directory (location) on your computer for the notebooks.
- Unzip the file and continue with Step 2 - Setting up the environment.
B. GitHub
- Click on the link to the CS1-Notebooks repository on GitHub through the course page on Moodle.
- Click the green
Code
button near the top of the page. - In the dropdown menu, click
Download ZIP
. - Once downloaded, extract the ZIP file to your chosen directory.
Alternatively, if you prefer using the command line:
git clone https://github.com/idsc-frazzoli/CS1-Notebooks.git
cd CS1-Notebooks
NOTE: when using git clone
, the cloned repository will be placed within the current directory.
Windows
-
Install Python from the official Python website. You need Python version 3.9 or higher.
-
Open Command Prompt and navigate to the project directory.
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
.\venv\Scripts\activate
-
Install Jupyter:
pip install jupyter
Linux and MacOS
-
Install Python (version > 3.9) by downloading it from the official Python website, or using a package manager (e.g.,
apt
for Ubuntu,brew
for macOS). -
Open a terminal and navigate to the project directory: Terminal navigation tutorial provides a quick introduction to terminal navigation.
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Install required dependencies:
pip3 install -r requirements.txt
-
Setup jupyter kernel
python3 -m ipykernel install --user --name=venv
To run the notebooks, you can choose between two options:
A. Using the Notebooks with a web-editor Jupyter notebooks - this finds all notebooks within the current directory and trusts them.
find . -name '*.ipynb' -exec jupyter trust {} \;
The below runs the notebook.
jupyter notebook
B. Using the notebooks with VSCode Install VSCode (if not already present), then:
- Install the
Python
andJupyter
extensions for VSCode. - Choose the python interpreter. Press
Ctrl+Shift+P
and selectPython: Select Interpreter
. Select thevenv
interpreter. - Open a notebook file (
.ipynb
). - Choose jupyter kernel. Press
Ctrl+Shift+P
and selectNotebook: Select Notebook Kernel
. - Then select
Jupyter Kernel
, and select the kernelvenv
should be present. - You should be able to run the cells from within VSCode.
Alternatively, if you prefer not to install any software, Google Colab offers a convenient (although not as smooth) way to execute the notebooks online. If you don't already have a Google account, you can create one using your ETH email by following these instructions.
The link to the individual notebooks can be found on moodle. Alternatively, follow this link for the folder containing all the concurrent notebooks.