Design of an electrostatic end-plugged plasma-confinement device