(An extension of Klein's and Mosher's answers)
From Quantum Field Theory III: Gauge Theory by Eberhard Zeidler (Springer, 4/2011):
A) Preface (pg. XII):
"It turns out that cohomology and homology have their roots in the rules for electrical circuits formulated by Kirchhoff in 1847."
B) Ch. 22. Electrical Circuits as a Paradigm in Homology and Cohomology :
"The study of electrical networks rests upon preliminary theory of graphs. ... My purpose here is to show that actually this theory is nothing else than the first chapter of classical algebraic topology theory and may be very advantageously treated as such by the well known methods of that science." -- Solomon Lefschetz (as quoted by Zeidler) from Applications of Algebraic Topology: Graphs and Networks, the Picard-Lefschetz Theory, and Feynman Algorithms (Springer, 1975) by Solomon Lefschetz.
(i) Electric currents $J$ are 1-cycles: $\partial J=0$.
(ii) Voltages $V$ are 1-coboundaries: $V=-dU$ (U is the electrostatic potential).
(iii) There exists a duality relation between electric currents and voltages: $<V|J>=0$.
(iv) If the electrical current is connected, then we get $\beta^0=1$ for the zeroth Betti number. In the general case, $\beta_0$ is equal to the number of connectivity components of the electrical circuit.
(v) If the electrical circuit has $s_0$ nodes and $s_1$ connections, then the Euler characteristic is given by $\chi=s_0-s_1$.
(vi) This yields the first Betti number $\beta_1=\beta_0-\chi$.
(vii) The space of electric currents is a linear space of dimension $\beta_1$.
- Homology describes the geometry of the electric circuit; in particular, the first Betti number is equal to the number of essential loops (also called 1-cycles).
- Cohomology describes the physics of the circuit (i.e., cohomology describes voltage and hence the electric currents, by Ohm's law).
- There exists a crucial duality relation between homology and cohomology which reflects the influence of the geometry of an electrical circuit on its physics (based on the duality relation (22.17) below).
$dU(J)=U(\partial J)$ for all 1-chains $J$. (22.17)
C) Ch. 23. The Electromagnetic Field and the de Rham Cohomology:
De Rham cohomology reformulates and generalizes the fundamental theorem of calculus due to Newton and Leibniz to differential forms on manifolds. In terms of physics, this describes the existence of potentials. The key role is played by Poincare's cohomology rule and the generalized Stokes integral theorem.