  An extended quadratic function is a quadratic function plus the indicator
function of an affine set, that is, a quadratic function with embedded linear
equality constraints. We show that, under some technical conditions, random
convex extended quadratic functions are closed under addition, composition with
an affine function, expectation, and partial minimization, that is, minimizing
over some of its arguments. These properties imply that dynamic programming can
be tractably carried out for stochastic control problems with random affine
dynamics and extended quadratic cost functions. While the equations for the
dynamic programming iterations are much more complicated than for traditional
linear quadratic control, they are well suited to an object-oriented
implementation, which we describe. We also describe a number of known and new
applications.
