The railgun, as a novel kinetic energy weapon, is being taken seriously by each country military. The pulse power source and railgun barrel, directly related to the performance of the total system, are important parts of the railgun system. The compensation pulse alternator, with its high energy storage density and power density, becomes one of the most potential pulse powers. The simulation of the pulse generator powered railgun system is researched in this paper. In order to accurately simulate the characteristic of the railgun system, the time-varying characteristic of the parameters and the kinetic resistance are taken into account in the process of building the raigun model. The railgun model is completed through the Matlab/simulink. The generator model is set up in FLUX. The coupling module between the two softwares is utilized to realize the co-simulation of the railgun system. The simulation results show that the optimum length (the displacement of the projectile exiting the muzzle while the current exactly reduces to zero) of the barrel has the relation with trigger moment of alternator. The velocity of the projectile will decrease when the trigger moment is delayed or the distance between the breech and the armature becomes further.