This repository contains the lecture materials and tutorials for the course "Applied Optimization" currently taught at the University of Hamburg. The course focuses on practical optimization techniques using the Julia programming language.
The course covers applied optimization methods with hands-on tutorials and real-world examples. Students learn to solve optimization problems using Julia and various optimization packages.
-
lectures/- Course lecture materials- Lecture content in Quarto markdown (
.qmd) files - Each renders to a reading page, a PDF and a slide deck (
*-presentation.html) for classroom use - Supporting images and files
- Lecture content in Quarto markdown (
-
tutorials/- Interactive tutorials and exercises- Step-by-step Julia tutorials in
.qmdformat - Hands-on exercises covering optimization concepts
- Data files and supporting materials in
data/andimages/
- Step-by-step Julia tutorials in
-
general/- General course information and resources -
chatbot/- Introduction of the course chatbot (slide deck and reading page, no PDF)_survey.qmdis the start-of-course survey, included while it is open
helpers/- Post-processing automation scripts (see Helper Functions)_site/- Generated website output (created by Quarto)_freeze/- Quarto's computational cache
_quarto.yml- Main Quarto configuration and build settings_brand.yml- Website branding and stylingapplied-optimization/- Julia environment (Project.toml,Manifest.toml) the tutorials run inpyproject.toml- Python dependencies for helper scripts (managed with uv)
The project uses Quarto as the main build system with automated post-processing:
- Render Phase: Quarto processes
.qmdfiles into HTML, creating the website in_site/ - Post-Render Phase: Helper scripts automatically process the generated content
The build pipeline is configured in _quarto.yml:
project:
type: website
post-render:
- helpers/convert_pypercent.py
- ../Lecture-Foundations/scripts/split_refs_post.py
- ../Lecture-Foundations/scripts/create_pdf.pyThe helpers/ directory contains automation scripts that run after each build:
Purpose: Converts Jupyter notebooks to Julia percent format
- Input: All
.ipynbfiles in_site/tutorials/ - Output: Corresponding
.jlfiles in percent format - Technology: Uses Jupytext for format conversion
- Usage: Enables easy editing of tutorials in Julia-native format
How it works:
- Finds all notebook files in the tutorials directory
- Reads each notebook using Jupytext
- Converts to Julia percent format (
.jlfiles with# %%cell separators) - Saves the
.jlfile and deletes the notebook, so students only download the.jl
Purpose: Every render prints the revealjs decks it touched to PDF
(?print-pdf in headless chromium, with MathJax fonts inlined). The scripts
live in the shared standard repo, not in helpers/, and run as two post-render
hooks:
-
split_refs_post.pyspreads a deck's bibliography over slides of four entries -
create_pdf.pythen writeslecture-XX-presentation.pdfnext to the deck in_site/lectures/, linked on the lecture page as "Slides (PDF)". Photos larger than a slide needs are shrunk in the PDF only -
Prerequisites: the sibling checkout
../Lecture-Foundations,uv run playwright install chromiumonce per machine, and rendering throughuv run -
A deck that cannot be printed fails the render on purpose, as its page already links the PDF
-
One deck by hand: after a full render,
uv run ../Lecture-Foundations/scripts/create_pdf.py _site/lectures/lecture-XX-presentation.html _site/lectures/lecture-XX-presentation.pdf
- Julia 1.13 - For running computational content
- Python - For helper scripts and Quarto
- Quarto - For building the website
-
Clone the repository:
git clone https://github.com/beyondsimulations/Applied-Optimization.git cd Applied-Optimization -
Install Julia dependencies:
julia --project=applied-optimization -e 'using Pkg; Pkg.instantiate()' -
Install Python dependencies:
uv sync
To build the complete website with all post-processing:
uv run quarto renderThis will:
- Render all
.qmdfiles to HTML - Execute the post-render helper scripts
- Generate PDFs and Julia files
- Create the complete website in
_site/
To publish that build:
bash ../Lecture-Foundations/scripts/publish-gh-pages.shIt publishes without rendering again and keeps the gh-pages branch at a single commit, so past builds of the site do not pile up in the repository. A bare quarto publish renders again outside uv, where the slide PDF hook cannot run.
For development with live preview:
uv run quarto previewNote: Post-render scripts only run on full renders, not during preview mode.
- Create a new
.qmdfile inlectures/following the naming convention:lecture-XX-topic.qmd - For presentations, create a corresponding
lecture-XX-presentation.htmlfile - Add the
format-linksentry "Slides (PDF)" to the front matter, as in the other lectures - Run
uv run quarto renderto process and generate PDFs automatically
- Create tutorial files in
tutorials/following the pattern:tutorial-XX-YY-topic.qmd - Include any data files in
tutorials/data/ - The build process will automatically generate Julia percent format versions
- All computational content is executed during rendering
- Julia environment is managed through
Project.toml - Code execution is cached by Quarto for faster subsequent builds
- Fork the repository
- Create content following the established naming conventions
- Test your changes with
uv run quarto render - Submit a pull request
This project is licensed under the terms specified in the LICENSE file.
- Course Website: https://beyondsimulations.github.io/Applied-Optimization
- Source Repository: https://github.com/beyondsimulations/Applied-Optimization
- Quarto Documentation: https://quarto.org/
- Julia Language: https://julialang.org/