Electrostatic calculations for an ion channel. I. Energy and potential profiles and interactions between ions.