In order to expand the simulation scale of the real-time digital solver based on FPGA (FRTDS, FPGA: field-programmable gate array), the power system modeling process is optimized. The multi-valued parameter method is used to represent the external characteristics of the equipment. The methods of addressing the equivalent admittance and voltage coefficient of the interval unit are discussed in detail. The serial degree of the simulation script is effectively reduced. The disadvantageous effects of asymmetric elements and nonlinear elements on node elimination are analyzed. The elimination order of nodes is determined according to the minimum estimate of the execution time of the simulation script. According to the proposed method to reduce the serial degree and calculation time of the simulation script, software for generating an electromagnetic transient simulation script for power systems is developed. The effectiveness of the software is verified by an example.