Worldwide, the penetrations of photovoltaic (PV) and energy storage systems are increased in power systems. Due to the intermittent nature of PVs, these sustainable power systems require efficient managing and prediction techniques to ensure economic and secure operations. In this paper, a comprehensive dynamic economic dispatch (DED) framework is proposed that includes fuel-based generators, PV, and energy storage devices in sustainable power systems, considering various profiles of PV (clear and cloudy). The DED model aims at minimizing the total fuel cost of power generation stations while considering various constraints of generation stations, the power system, PV, and energy storage systems. An improved optimization algorithm is proposed to solve the DED optimization problem for a sustainable power system. In particular, a mutation mechanism is combined with a salp–swarm algorithm (SSA) to enhance the exploitation of the search space so that it provides a better population to get the optimal global solution. In addition, we propose a DED handling strategy that involves the use of PV power and load forecasting models based on deep learning techniques. The improved SSA algorithm is validated by ten benchmark problems and applied to the DED optimization problem for a hybrid power system that includes 40 thermal generators and PV and energy storage systems. The experimental results demonstrate the efficiency of the proposed framework with different penetrations of PV.