Patent claim: A computer program product for operating a power grid 100 having decentralized control elements 102 103 comprising a computer usable medium having a computer readable program wherein said computer readable program when executed on a computer causes the computer to perform the steps of the method according to claim 1.

Related passage: With respect to the diagnostics portion 78 this portion of the applicationspecific agent software 48 is in communication with the machines 12 that are beingcontrolled and monitored by the agent 50 by way of the control program software 46.The diagnostics portion 78 provides the capability of detecting equipment failures isolating failures from propagating and periodically or asynchronously proposing strategies to enhance system performance or avoid undesirable states.To allow it to evaluate the status or health of the machines 12 the diagnostics portion 78 includes one or more models of the machines for example modeling of the energy producers 2 and energy consumers 6.In certain embodiments the diagnostic portion 78 additionally includes a suite of data acquisition signal processing diagnostic and prognostic algorithms.These algorithms describe machinery and process health such as machinery fault detection degraded operation and failure prediction.Further in some embodiments the diagnostics portion 78 includes algorithms that facilitate a system recovery subsequent to a system failure.Also in certain embodiments the diagnostics portion 78 can receive diagnostic information from other agents or from outside the system e.g.from other smart machines or subsystems and use this information directly or combine this information with local diagnostic information.Further although not shown in FIG.6 in certain embodiments one or both of a prognostics portion and a simulation portion exist apart from the diagnostics portion 78 or exist as portions thereof.Such a prognostics portion enables the generation of predictiveprognostic information that in turn permits the taking of actions before a failure or fault occurs which in certain circumstances can make it possible to avoid damage to machinery or process disturbances.Similarly this mechanism can detect and alter configuration and control to avoid wear such as gear wear or insulation breakdown and avoid accelerated wear conditions and to prevent early machinery wear.As for the simulation portion such a portion enables the EMS to test or simulate how particular actions would affect the energyrelated system 1 before actually taking such actions.Dynamic optimization can also be employed.For example the agents 50 of the EMS can monitor whether the energyrelated system 1 operates as expected in response to system changes both in terms of the steady state response and dynamic reaction of the system.The techniques employed to perform such dynamic optimization can include a variety of techniques such as for example gradientsearching.Such techniques can be employed for example to achieve a specific optimum operating state or operation point or alternatively the agentderived control and configuration can be prescribed to optimize machinery operation over a specific operating horizon such as one month.