Fantastic blog post. I love constrained optimization, it's always pretty to throw a solver at a well-defined problem