Ambipolar diffusion, interstellar dust, and the formation of cloud cores and protostars. 2: Numerical method of solution | Synapse