A numerical study of MHD equilibrium and stability of the spheromak