Figure 1:
Cost function of generator.