Analysis of the performance of a multistage railgun