A model based approach to the control of diesel generators