Linear stability analysis of compact toroidal plasmas using particle simulation