  We consider the problem of co-optimizing behind-the-meter (BTM) storage and
flexible demands with BTM stochastic renewable generation. Under a generalized
net energy metering (NEM) policy-NEM X, we show that the optimal
co-optimization policy schedules the flexible demands based on a load priority
list that defers less prioritized loads to times when the BTM generation is
abundant. This gives rise to the notion of a net-zero zone, which we quantify
under different distributed energy resources (DER) compositions. We highlight
the special case of inflexible demands that results in a storage policy that
minimizes the imports and exports from and to the grid. Comparative statics are
provided on the optimal co-optimization policy. Simulations using real
residential data show the surplus gains of various customers under different
DER compositions.
