  We give an explicit formula for the membrane potential of cells in terms of
the intracellular and extracellular ionic concentrations, and derive equations
for the ionic currents that flow through channels, exchangers and electrogenic
pumps. We demonstrate that the work done by the pumps equals the change in
potential energy of the cell, plus the energy lost in downhill ionic fluxes
through the channels and exchangers. The theory is illustrated in a simple
model of spontaneously active cells in the cardiac pacemaker. The model
predicts the experimentally observed intracellular ionic concentration of
potassium, calcium, and sodium. Likewise the shapes of the simulated action
potential and five membrane currents are in good agreement with experiments. We
do not see any drift in the values of the concentrations in a long time
simulation, and we obtain the same asymptotic values when starting from the
full equilibrium situation with equal intracellular and extracellular ionic
concentrations.
