NOVELTY - The optimization method involves optimizing a stored volume of hydrogen, in which the stored volume of hydrogen is created from utility-provided energy sources or renewable energy sources and optimized using a first formula. The respective amounts of power obtained from the utility provided energy source, produced by the renewable energy source and produced by converting hydrogen in the stored volume of hydrogen to energy are also optimized. The respective amounts of power are optimized according to a second formula that is dependent on the first formula.    USE - Simultaneous optimization of distributed generation and hydrogen production. Can be used in a building or a vehicle.    ADVANTAGE - Provides an intelligent distributed generation system for optimizing utility-supplied electricity, natural gas and hydrogen production and storage to minimize a total energy cost. Provides an improved method for optimizing utility-supplied and alternative energy sources in order to minimize total energy costs while at the same time accounting for transportation fuel needs. Ensures low rates in the summer, making it economical to convert natural gas to hydrogen to provide both electricity to reduce requirements from the grid and fuel for a hydrogen car in the peak driving season. Provides an inexpensive method of producing electricity or thermal energy at any given moment, whether it is from a renewable source, the grid, the gas pipeline, or stored hydrogen, and which can be assessed real-time to provide significant resultant savings to the consumer. Provides an energy supply and management system that optimally provides electricity, thermal energy, transportation fueling needs, and backup or standby energy stores for one or more buildings and hydrogen-powered vehicles. Provides fuel for vehicles through a mechanism based upon the same source fuels that are used to provide power to the building.    DETAILED DESCRIPTION - The first formula includes parameters accounting for energy requirements of a building, energy requirements of at least one hydrogen-powered vehicle and user-configurable optimization criteria. A specified volume of hydrogen is produced as rapidly as possible while minimizing a total cost for producing the specified volume of hydrogen. INDEPENDENT CLAIMS are also included for the following:    (1) Computer readable medium for storing instructions for causing a processor to execute simultaneous optimization of distributed generation and hydrogen production;    (2) Energy management system;    (3) Optimization of energy costs for networked group d of buildings; and    (4) Optimization of energy production and usage in a group of networked buildings.    DESCRIPTION OF DRAWING(S) - The drawing shows the high-level overview of a preferred energy consuming installation depicting the selected components for use in energy optimization.    Hydrogen electrolyzer (108)    Hydrogen storage (110)    Heat, cool and hot water equipment (114)    Hydrogen reformer (120)    Hydrogen fuel cell (128)