Code for simulating the fast-beam ion instability