224 a and optimization routine 224 b errors detected are then used to generate control actions that are then transmitted as outputs 225 to final control elements in the process 221 set points for the regulatory system 223 are derived either from operator input 224 a or from outputs of the optimization routine 224 b note that the optimizer 226 operates directly upon the model 227 in arriving at its optimal set point slate 224 b also note that the model 227 is updated by means of a special routine 228 just prior to use by the optimizer 227 the feedback update feature ensures adequate mathematical process description in spite of minor instrumentation errors and in addition will compensate for discrepancies arising from simplifying assumptions incorporated in the model 227 in this case the controlled variable may be for example compressor speed alone or in addition to refrigerant charge level the input variables are in this case similar to those in example 2 including refrigerant charge level optionally system power consumption kwatt hours as well as thermodynamic parameters including condenser and evaporator water temperature in and out condenser and evaporator water flow rates and pressure in and out compressor rpm suction and discharge.