This is accompanying code for my Structural Optimization lecture MRM-0156.
Every exercise and lecture notebook in the contents below carries a Colab badge that opens it in Google Colab, ready to run. The first cell installs the required packages; after that you can work through the notebook as usual. All you need is a Google account. Note that Colab discards your changes unless you save a copy to your own Google Drive.
We use uv to manage Python and all packages. You do not need to install Python, Anaconda or anything else beforehand — uv takes care of it.
Step 1. Install uv by running this in a terminal:
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shStep 2. Close and reopen the terminal, then run:
git clone https://github.com/meyer-nils/structural_optimization.git
cd structural_optimization
uv run jupyter labThat's it. The last command downloads a suitable Python version, creates an isolated environment with the exact package versions from uv.lock and opens JupyterLab in your browser. Use it again any time you want to continue working.
Prefer Visual Studio Code?
Install Visual Studio Code with the "Python" and "Jupyter" extensions, run uv sync once in the repository, then open the folder in VS Code. Click "Select Kernel" in the top right of a notebook and choose the interpreter from the .venv folder.
- 1 Introduction
- 2 Unconstrained optimization
- 3 Constrained optimization
- 4 Optimization using local approximations
- 5 Trusses in a nutshell
- 6 Optimization of truss structures
- 7 Finite element analysis in a nutshell
- 8 Optimization of continuum structures