Rapid industrial development requires more energy to support all industrial processes. Using conventional energy is not environmentally friendly as it can destroy the environment. The conversion from using conventional energy to using renewable energy sources is increasingly being used around the world. However, the presence of renewable energy poses new challenges to the world of power systems. To generate renewable energy sources, components such as inverters must be connected to the power grid. Inverters are zero-inertia devices because they have no rotating bodies that generate inertia. In a system, frequency stability is highly dependent on the inertia and damping of the system itself. To overcome this problem, we study the impact of integrating renewable energy into the power system using a virtual inertial controller (VIC) based on energy storage systems. One of the energy storage systems used is Capacitor Energy Storage (CES). Optimizing the output power that can be generated by the capacitor energy store requires optimizing the values of the individual parameters. One of the methods available is the Particle Swarm Optimization (PSO) method. The focus of this study is to study the effect of installing a VIC in his CES optimized with a particle swarm optimization algorithm on system frequency oscillations induced by static loads.