A single compartment model of calcium dynamics in dendrites and nerve terminals