While hitherto the synchronous grid is dominated by the synchronous generators (SGs), recently the grid-following inverter-based power generation systems (IBPGS) are increasingly being connected to the power grid, resulting in a slowly decreasing system total inertia impacting the operation of the power systems, in areas such as potential failures in the operation of phase-locked loops (PLLs), increased rate of change of frequency, contingency frequency control required during islanding conditions and problems associated with the system restoration capability. Therefore, there is an urgent need to develop grid-forming IBPGSs to replace or support the grid-following IBPGSs. The grid-forming IBPGS works like an SG to maintain the voltage and frequency of the power system, while the grid-following IBPGS simply dispatches the requested active and reactive power based on the request signal. The paper presents a mathematical model of the SG and its associated controllers for use with the proposed grid forming IBPGS and proposes a strategy on how to use the time response from the simulation of the dynamics of the SG to control the switching of the power electronics switching devices in the proposed grid-forming IBPGS. The results of the simulation of the proposed grid-forming IBPGS when applied to changes in the power system demonstrate the effectiveness of the proposed method to help control the voltage and frequency of the power system with virtual inertia when compared with the simulation results from a grid-forming SG.