The operation of the power systems is based on the power flow analysis, while the optimization is based on the optimal power flow analysis. The purpose of the study is to determine the generation cost and the power losses based on the optimal power flow analysis. The optimal power flow analysis starts by calculating the power flow in order to ensure the safe operation of the system, then the actual optimal power flow is performed considering the mathematical model. These studies are performed for the modified IEEE 39 bus system for an entire year, considering the seasons (spring, summer, fall and winter), and the average load power demand for these seasons, respectively. In this system are connected three distributed generation sources and two storage units. The optimization (optimal power flow) performed is multi-objective, minimizing the generation cost and the power losses (active and reactive) for the considered seasons. The results give, for all seasons, that the generation cost is higher, while the power losses are lower when the distributed generation sources and storage units are connected to the analysed power system.