CVXPY is an open source Python-embedded modeling language for convex optimization problems. It lets you express your problem in a natural way that follows the math, rather than in the restrictive standard form required by solvers. This tutorial will cover the basics of convex optimization, and how to use CVXPY to specify and solve convex optimization problems, with an emphasis on real-world applications. No prior knowledge of convex optimization is assumed.
- Clone this repository.
- Install CVXPY following these instructions. We recommend Python 3.10 and CVXPY 1.3.
- Test your CVXPY installation by running
test.py
in the repository.
- Convex optimization overview
- Mathematical optimization
- Convex optimization
- Solvers & modeling languages
- CVXPY example
- Real-world applications
- Hello world
- Participants will install CVXPY and solve their first convex optimization problem. Participants will get experience with basic CVXPY syntax.
- Hello world exercise
- Extra exercise
- Constructive convex analysis
- Mathematically define convex, concave, and affine functions. Give many examples.
- Introduce the composition rule for convex, concave, and affine functions, which generates the grammar for CVXPY.
- Introduce Disciplined Convex Programming (DCP).
- Learn how to construct convex optimization problems using DCP in CVXPY.
- DCP exercises
- Participants will solve their first convex optimization problem with CVXPY, getting experience with basic CVXPY syntax.
- DCP exercise
- DCP site
- DCP quiz
- Applications of convex optimization
- Present applications in finance, machine learning, vehicle control, and risk analysis.
- For each application, the instructors will give a motivating overview, and participants will then code up and solve a problem arising in the application using CVXPY. Concretely, exercises will consist of notebooks with missing sections, which the participants need to fill in with code constructing and solving a CVXPY problem.
- Simple portfolio optimization
- Portfolio rebalancing
- Multiple risk models
- Risk budget allocation
- Energy storage
- Vehicle scheduling
- Flux balance analysis
- If extra time, survey of advanced features
- Quasiconvex programming.
- Log-log convex programming.
- Differentiation through problems.
- Code generation.
- Conclusion
- Recap.
- References for next steps in learning about and applying convex optimization.