In this study, we develop an efficient optimization method to conduct an optimization analysis to meet the energy needs of an urban center in Morocco. We compared two scenarios of power system layouts based on renewable energy and conventional energy sources. Different technologies are investigated including wind, solar and combined cycle’s power plants. System capacity factor is defined as the ability to satisfy consumer demand which is represented as a piecewise cumulative load curve. The system has a range of performance levels from perfect functioning to complete failure. The components of the system are characterized by their cost, capacity and capacity factor. To allow fast capacity factor estimation, a universal moment generating function technique (UMGF) method is applied. The proposed approach determines the minimal cost system configuration under global capacity factor constraints. An illustrative example is presented.