This GitHub repository contains the Juypter notebooks for the Control Systems II course taught by Prof. Emilio Frazzoli at ETH Zürich, spring semester 2024.
There are two ways to use the notebooks. Either you download them locally on the computer where you have Python and Jupyter installed, or you simply open them in Google Colab and start coding directly in your browser. We recommend that you use VS Code for your editor. If you need help setting up the notebooks locally, see the installation guide below.
Before proceeding, ensure you have Git installed on your system to clone the repository. If not, you can download it from Git's official website.
To clone the repository, open a terminal or command prompt and run the following command:
git clone https://github.com/idsc-frazzoli/CS2-2024-notebooks.git
Alternatively, you can manually download the notebooks:
- Navigate to the GitHub repository in your web browser.
- Find the
Code
button and click it, then selectDownload ZIP
. - Extract the ZIP file to your desired directory.
-
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
-
Install Python by downloading it from the official Python website or using a package manager (e.g.,
apt
for Ubuntu,brew
for macOS). Ensure it is version 3.9 or higher. -
Open a terminal and navigate to the project directory.
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
- On Linux:
source venv/bin/activate
- On Mac:
source venv/bin/activate
-
Install Jupyter:
pip install jupyter
After activating your virtual environment and installing Jupyter, set up the Jupyter kernel with the following command:
python -m ipykernel install --user --name=venv
Replace venv
with the name of your virtual environment if you used a different name.
To start Jupyter Notebook, run:
jupyter notebook
This will open Jupyter Notebook in your default web browser, allowing you to open and run the notebooks you've cloned or downloaded.
If you are using VSCode, follow these additional steps to integrate your setup:
- Install the Python and Jupyter extensions for VSCode.
- In VSCode, open the command palette (Ctrl+Shift+P) and select
Python: Select Interpreter
. Choose the virtual environment you created. - Open a notebook file (
.ipynb
), and you should be able to run the cells using the Python kernel you've set up.
All notebooks are available on this CS2 Google Drive folder. You need to open the files as a new copy with Google Colab The kernel runs automatically from the browser and no additional installations must be made.
Each notebook consists of controls case studies and coding exercises. All dependencies and background functions are handled by the cs2solutions package. Please ensure that this is installed at the start of the notebook using pip install cs2solutions
.
This package contains useful functions, unit tests, and solutions. More information is found on it's official repository: cs2solutions