A general model framework is developed which describes regional and mu
nicipal energy systems in terms of data-flow networks. It provides a h
ighly flexible tool for dynamic and stochastic minimization of primary
energy demand, emissions of pollutants, and monetary cost. Included a
re conventional energy-supply techniques, rational use of energy via h
eat-exchanger networks, heat pumps and cogeneration, demand-side measu
res such as insulation of dwellings, and utilization of renewable ener
gy sources.