Introduction to Capacitors

Electrons separate onto two plates, creating a voltage and storing energy in an electric field.

Abstract

A capacitor separates electric charge onto two plates. We follow electrons as it charges, holds its charge and discharges, connecting their redistribution to voltage and current. The circuit animation uses schematic electron dots. We then follow a presynaptic spike as it opens a synapse and triggers a neuron's ionic response.

Introduction

A capacitor has two metal plates separated by an insulator. Charging removes electrons from one plate and adds them to the other. The plates acquire equal and opposite net charges; electrons travel through the external wires, never across the insulating gap in this ideal model.[1]

Capacitance CC, measured in farads (F), relates the upper plate’s positive charge QQ, in coulombs (C), to the voltage difference VCV_C, in volts (V):

Q=CVC.(1)Q=C V_C. \tag{1}

A battery at voltage VbV_b charges the capacitor through resistance RR, measured in ohms (Ω). Conventional current II, in amperes (A), changes the voltage over time tt, in seconds (s):[2]

CdVCdt=I,I={(Vb−VC)/RCharge,0Hold,−VC/RDischarge.(2)\begin{aligned} C\frac{dV_C}{dt}&=I,\\ I&=\begin{cases} (V_b-V_C)/R & \text{Charge},\\ 0 & \text{Hold},\\ -V_C/R & \text{Discharge}. \end{cases} \end{aligned} \tag{2}

Charging slows as VCV_C approaches VbV_b. Hold disconnects the external path; Discharge joins the plates through the resistor. Electron drift runs opposite to conventional current. The time constant τ\tau, in seconds, sets the charging and discharging timescale:

τ=RC.(3)\tau=RC. \tag{3}

Choose a mode below, or adjust capacitance, resistance and battery voltage. Blue dots represent electrons. The dots exaggerate size and motion and represent groups of electrons. Changing a slider starts a fresh charge; switching modes preserves voltage. Restart returns to an uncharged capacitor. Pause freezes time. The model omits leakage and dielectric breakdown.

Figure 1. The plates start half filled. Charging removes electron dots from the top plate and adds them to empty cells below; discharge reverses this. The sliders change plate spacing, resistor width and battery size. The graphs show voltage and current calculated from the circuit equations. Each dot represents a group of electrons, and travel times are illustrative.

A biophysical neuron

A neuron’s membrane separates conducting fluids and acts as a capacitor. Here the moving charges are ions: sodium (Na+\mathrm{Na}^{+}) entering the cell can raise its voltage, while potassium (K+\mathrm{K}^{+}) leaving can lower it. Voltage-dependent channels control these flows. The animation uses the classic Hodgkin–Huxley squid-axon membrane model.[3] To receive presynaptic spikes, we add an excitatory synapse; this addition supplies the input current IsynI_{\mathrm{syn}} in the voltage equation below.

The membrane voltage VmV_m is the inside voltage relative to outside, in millivolts (mV). Membrane capacitance per area CmC_m is in μF/cm²; inward synaptic current density IsynI_{\mathrm{syn}} and ionic current densities INaI_{\mathrm{Na}}, IKI_{\mathrm{K}} and leak ILI_L are in μA/cm². Time tt is in milliseconds (ms):

CmdVmdt=Isyn−INa−IK−IL.(4)C_m\frac{dV_m}{dt}=I_{\mathrm{syn}}-I_{\mathrm{Na}}-I_{\mathrm{K}}-I_L. \tag{4}

For each pathway p∈{Na,K,L}p\in\{\mathrm{Na},\mathrm{K},L\}, conductance density gpg_p is in mS/cm² and reversal potential EpE_p is in mV:

Ip=gp(Vm−Ep).(5)I_p=g_p(V_m-E_p). \tag{5}

These ionic currents are positive outwards; the current plot reverses their signs so upward means positive charge entering. The reversal potentials are ENa=50E_{\mathrm{Na}}=50 mV, EK=−77E_{\mathrm{K}}=-77 mV and EL=−54.3E_L=-54.3 mV. Sodium activation mm, sodium availability hh and potassium activation nn are dimensionless gates between zero and one:

gNa=gˉNam3h,gK=gˉKn4.(6)\begin{aligned} g_{\mathrm{Na}}&=\bar g_{\mathrm{Na}}m^3h,\\ g_{\mathrm{K}}&=\bar g_{\mathrm{K}}n^4. \end{aligned} \tag{6}

The available maximum conductance densities are gˉNa=120fNa\bar g_{\mathrm{Na}}=120f_{\mathrm{Na}} and gˉK=36fK\bar g_{\mathrm{K}}=36f_{\mathrm{K}} mS/cm². The channel sliders set the fractions fNaf_{\mathrm{Na}} and fKf_{\mathrm{K}} from zero to one, both initially one. Leak conductance is fixed at gL=0.3g_L=0.3 mS/cm². Each gate x∈{m,h,n}x\in\{m,h,n\} evolves as:

dxdt=αx(Vm)(1−x)−βx(Vm)x.(7)\frac{dx}{dt}=\alpha_x(V_m)(1-x)-\beta_x(V_m)x. \tag{7}

The rates αx\alpha_x and βx\beta_x, in ms⁻¹, drive the gate towards one and zero, respectively. With u=Vm/(1 mV)u=V_m/(1\,\mathrm{mV}) the dimensionless numerical voltage, the animation uses the classical squid-axon rates at 6.3 °C in the inside-minus-outside voltage convention:[3, 4]

αm(Vm)=0.1(u+40)1−e−(u+40)/10  ms−1,βm(Vm)=4e−(u+65)/18  ms−1.(8)\begin{aligned} \alpha_m(V_m)&=\frac{0.1(u+40)}{1-e^{-(u+40)/10}}\;\mathrm{ms}^{-1},\\ \beta_m(V_m)&=4e^{-(u+65)/18}\;\mathrm{ms}^{-1}. \end{aligned} \tag{8} αh(Vm)=0.07e−(u+65)/20  ms−1,βh(Vm)=11+e−(u+35)/10  ms−1.(9)\begin{aligned} \alpha_h(V_m)&=0.07e^{-(u+65)/20}\;\mathrm{ms}^{-1},\\ \beta_h(V_m)&=\frac{1}{1+e^{-(u+35)/10}}\;\mathrm{ms}^{-1}. \end{aligned} \tag{9} αn(Vm)=0.01(u+55)1−e−(u+55)/10  ms−1,βn(Vm)=0.125e−(u+65)/80  ms−1.(10)\begin{aligned} \alpha_n(V_m)&=\frac{0.01(u+55)}{1-e^{-(u+55)/10}}\;\mathrm{ms}^{-1},\\ \beta_n(V_m)&=0.125e^{-(u+65)/80}\;\mathrm{ms}^{-1}. \end{aligned} \tag{10}

Here ee is the base of the natural exponential. The apparent divisions by zero have finite limits: αm=1\alpha_m=1 ms⁻¹ at −40 mV and αn=0.1\alpha_n=0.1 ms⁻¹ at −55 mV. Each fresh demonstration starts at −65 mV with x=αx/(αx+βx)x=\alpha_x/(\alpha_x+\beta_x), then runs for 200 ms without synaptic input before the displayed timeline begins. Membrane capacitance initially equals Cm=1C_m=1 μF/cm².

In a biological synapse, an arriving presynaptic spike causes transmitter release, opening synaptic channels. We add a standard conductance-based synapse with instantaneous opening and exponential decay, as described in Neuronal Dynamics, Section 3.1, Equations (3.1)–(3.2). This is an extension to the original Hodgkin–Huxley membrane model.[5] Its conductance density gsyng_{\mathrm{syn}} is in mS/cm², and we write its current as inward-positive (the opposite sign convention to that reference):

Isyn=gsyn(Esyn−Vm).(11)I_{\mathrm{syn}}=g_{\mathrm{syn}}(E_{\mathrm{syn}}-V_m). \tag{11}

The synaptic reversal potential is Esyn=0E_{\mathrm{syn}}=0 mV. Each arrival adds the selected weight ww, in mS/cm², to this conductance; between arrivals it decays:

dgsyndt=−gsynτsyn+w∑jδ(t−tj).(12)\frac{dg_{\mathrm{syn}}}{dt} =-\frac{g_{\mathrm{syn}}}{\tau_{\mathrm{syn}}} +w\sum_j\delta(t-t_j). \tag{12}

We choose a decay time τsyn=2\tau_{\mathrm{syn}}=2 ms and default weight w=0.2w=0.2 mS/cm² for this demonstration. The Dirac impulse δ\delta has unit area and units of ms⁻¹, so each arrival increases conductance by ww; this is equivalent to the exponential conductance in the cited model. Arrival times are tj=(5+40j)t_j=(5+40j) ms for j=0,1,2,…j=0,1,2,\ldots, following a schematic 4 ms journey from a source with prescribed spikes. These timings are also demonstration choices; transmitter release and the presynaptic neuron’s dynamics are not simulated.

Voltage and the three gates are integrated with fourth-order Runge–Kutta steps of 0.01 ms. Synaptic conductance decays exponentially, evaluated at each step’s start, midpoint and end. Action potentials emerge from the channel dynamics, without a firing threshold or voltage reset. Adjust capacitance, synaptic strength or the available channels to explore the response.

Figure 2. A presynaptic spike arrives and opens the amber synaptic channel. Its current can trigger sodium entry, followed by potassium exit, producing an action potential. The graphs show voltage and synaptic, sodium and potassium currents. Faint amber lines mark spike arrivals. Channel opening and ion motion are schematic; transmitter release, leak pathways and concentration changes are omitted.

Network diagram

Illustrative presynaptic source P drives Hodgkin–Huxley membrane N through one excitatory synaptic weight W_NP.
Figure A1. PP denotes the prescribed presynaptic spike source and NN the Hodgkin–Huxley membrane. WN,PW_{N,P} is the synaptic conductance-density increment, in mS/cm², with target first and source second. Sodium, potassium and leak dynamics remain inside the membrane. This schematic describes the browser illustration; it is not a saved simulation. The separate capacitor demonstration has electrical components rather than synaptic weights.

Parameters

ParameterIllustrative setting
Ideal capacitor circuit
Governing relationCharge equals capacitance times voltage
Charge / discharge updateExact exponential towards battery voltage / zero
HoldDisconnected ideal capacitor; constant voltage
Time constant (derived)Resistance multiplied by capacitance
Hodgkin–Huxley membrane
Initial capacitance density1 μF/cm²
Maximum sodium / potassium conductance densities120 / 36 mS/cm² before channel-fraction scaling
Leak conductance density0.3 mS/cm²
Sodium / potassium / leak reversals50 / -77 / -54.3 mV
Rate conventionClassical squid axon at 6.3 °C; inside-minus-outside voltage
Initial voltage / preparation−65 mV; gates at their voltage-dependent steady state, then 200 ms without input
Added synapse and integration
Initial weight / reversal0.2 mS/cm² / 0 mV
Conductance decay time2 ms
Prescribed first arrival / subsequent interval5 / 40 ms
Schematic travel time4 ms
Integrator / timestepFourth-order Runge–Kutta / 0.01 ms
Conductance within each stepExponential values at the start, midpoint and end
Table A1.

The membrane equations and temperature convention follow the cited classical model; the added synapse, timings and slider settings are demonstration choices. Timing and reversal constants are imported from the animation script. These interactive examples do not depend on a scientific run or saved snapshots.

References

  1. Samuel J. Ling, Jeff Sanny and William Moebs. University Physics, Volume 2. OpenStax, 2016. Section 8.1, “Capacitors and Capacitance”. Online section.

  2. Samuel J. Ling, Jeff Sanny and William Moebs. University Physics, Volume 2. OpenStax, 2016. Section 10.5, “RC Circuits”. Online section.

  3. Alan L. Hodgkin and Andrew F. Huxley. “A quantitative description of membrane current and its application to conduction and excitation in nerve.” The Journal of Physiology 117(4), 500–544, 1952. Paper.

  4. NEURON Project. Squid sodium, potassium and leak channel model (hh). Maintained NEURON model implementation, accessed 14 October 2026. Source.

  5. Wulfram Gerstner, Werner M. Kistler, Richard Naud and Liam Paninski. Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Cambridge University Press, 2014. Chapter 3.1, “Synapses”.