CVXPY
Last edited: January 1, 2026CVXPY allows us to cast convex optimization tasks into OOP code.
\begin{align} \min \mid Ax - b \mid^{2}_{2} \end{align}
object to:
\(x \geq 0\)
import cvxpy as cp
A,b = ...
x = cp.Variable(n)
obj = cp.norm2(A@x - b)**2
constraints = [x >= 0]
prob = cp.Problem(cp.Minimize(obj), constraints)
prob.solve()
How it works
- starts with the optimization problem \(P_{1}\)
- applies a series of problem transformation \(P_{2} … P_{N}\)
- final problem \(P_{N}\) should be one of Linear Program, Quadratic Program, SOCP, SDP
- calls a specialized solver on \(P_{N}\)
- retrieves the solution of the original problem by reversing transformations
Disciplined Convex Programming
Last edited: January 1, 2026Specify objective as:
- minimize scalar convex expression
- maximize scalar concave expression
and constraints:
- convex expr <= concave expr
- concave expr >= convex expr
- affine expr = affine expr
curvatures of all expressions are DCP certified. We do this because then you can just subtract the expressions and you’ll have a good time.
you certify DCP based on general composition rule that preserve convexity
DCP is sufficient, not necessary
Consider:
\begin{equation} f\qty(x) = \sqrt{1+x^{2}} \end{equation}
geometric programming
Last edited: January 1, 2026A geometric program:
\begin{align} \min_{x}\quad & f_{0}\qty(x) \\ \textrm{s.t.} \quad & f_{i}\qty(x) \leq 1, i= 1\dots m \\ & h_{i}\qty(x) = 1, i = 1 \dots p \end{align}
where \(f_{i}\) is posynomial, and \(h_{i}\) monomial. Notice that taking a log of this thing transforms the monomial into an affine function in \(\log \qty(x)\), and into a logsumexp for posynomials. This also implies that solving for optimal \(\log \qty(x)\), which is same as solving for \(x\) for positive \(x\), is convex problem.
Lagrangian Mechanics
Last edited: January 1, 2026Want mechanics? No. You get energy.
First, recall the stationary-action principle. To define a system in Lagrangian Mechanics, we define a smooth function \(L\), called the “Lagrangian”, and some configuration space (axis) \(M\).
By convention, \(L=T-V\). \(T\) is the kinetic energy in the system, and \(V\) is the potential energy in the system.
By the stationary-action principle, then, we require \(L\) to remain at a critical point (max, min, saddle.) This fact allows us to calculate the equations of motion by hold \(L\) at such a point, and evolving the \((T,V)\) pair to remain at that point.
multicriterion optimization
Last edited: January 1, 2026multicriterion optimization
\begin{align} \min_{x}\quad & f_{0}\qty(x) = \qty(F_{1}\qty(x), \dots, F_{q}\qty(x)) \\ \textrm{s.t.} \quad & f_{i}\qty(x) \leq 0, i = 1 \dots m, Ax = b \end{align}
objective is the vector \(f_{0}\qty(x) \in \mathbb{R}^{q}\), essentially brings together \(q\) different objectives \(F_{i}, …, F_{q}\).
models of optimality
for the set of achievable points:
\begin{equation} O = \qty {f_{0}\qty(x) \mid x \text{ feasible}} \end{equation}
- feasible \(x\) is optimal if \(f_{0}\qty(x)\) is the minimum value of \(O\)
- feasible \(x\) is Pareto optimal if \(f_{0}\qty(x)\) is a minimal value of \(O\)
non-competing optimality
\(x^{*}\) optimal means \(f_{0}\qty(x^{*}) \preceq f_{0} \qty(y^{* })\) for all feasible \(y^{*}\). \(x^{*}\) simultaneously minimizes each \(F_{i}\), which means the objectives are non-competing.
