---
title: "Disciplined Convex Programming"
source: https://www.jemoka.com/posts/kbhdiciplined_convex_programming/
---

Specify objective as:
minimize scalar convex expression maximize scalar concave expression and constraints:
convex expr &lt;= concave expr concave expr &gt;= 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&rsquo;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}
f1 = cp.sqrt(1 + cp.square(x)) is not DCP (because we put convex into concave)
f1 = cp.norm2([1,x]) is DCP.
These are identical.
