
Two capacitor paradox - rathel
https://en.wikipedia.org/wiki/Two_capacitor_paradox
======
barbegal
Its easier to think about this using the water pressure analogy. Imagine a
large barrel full of water connected to another identical barrel. The first
barrel is filled to the top whilst the second is empty. A valve is opened
between the two barrels and they equalise with half of the water in each.

The initial energy is mgh and the final energy is 2 * (m/2 * g * h/2) = mgh/2
so half of then energy has disappeared. It is clear that work could have been
done by the water moving between the two barrels (like in a hydro-electric
power station).

~~~
bobbylarrybobby
And the resolutions are the same as in the capacitor example: either friction
in the pipes damps the oscillation, or the inertia of the water keeps it
oscillating between the two barrels indefinitely and half the energy is
kinetic.

~~~
Yajirobe
So how do we capture this 'resolution' in actual equations? Why aren't the
equations revealing this to us?

~~~
LeifCarrotson
The actual equations do capture it. It's just the simplified minimal equations
that result in 'paradox'.

A full model is complicated by the fact that your capacitors have an internal
series resistance and leakage resistance, and that the leads and circuit board
traces have resistance and inductance. Just like the pipes and valve has some
resistance to flow, and some water might leak out or evaporate, and the water
has inertia and nonzero viscosity, and turbulence will turn some of the motion
to heat, and depending on the phase of the moon, the time of day, and the
compass orientation of the barrels, the water may be pulled into a picometers-
higher tide in one barrel. When you say "they equalize with half the water in
each" you don't typically mention that the phase of the moon may be a factor.

~~~
logicallee
Still, picometers are very different from "half the energy in the system".

We do store energy in water towers for example, so it is pretty surprising and
unintuitive that if you put two large water tanks, one full and one empty,
_right next to each other_ , open a valve between them allowing their levels
to equalize, then assuming there is no distance and you used teflon coated
valves you lose... half of the energy as they equalize!

I certainly wouldn't have thought so. I'd have thought you keep 70%-95+% of
the energy.

Actually the oscillation explanation didn't match my intuition at all, because
I would have thought the water flows from high to low until the point of
equalization and then stops flowing, without oscillation.

I get that this doesn't happen, but I would have thought it would!

~~~
saagarjha
In normal situations, you would not lose half the energy, or hydropower would
be totally bunk (actually maybe not, considering the efficiency of burning
fossil fuels…) But in this degenerate case, you cannot ignore the losses.

~~~
logicallee
Are you sure? I was going to add that the intuition comes from demonstrations
we might have seen, where in a series of tubes, regardless of shape, water
will be at one level. As in this picture:

[https://www.physics.purdue.edu/demos/display_page.php?item=2...](https://www.physics.purdue.edu/demos/display_page.php?item=2B-03)

So is it not accurate to say that water does this by oscillating and throwing
away energy as parasitic losses, until it equalizes?

Are you saying in general does a system of connected tubes NOT throw off lots
of energy as it gets into the equalized state shown?

If it does, I think this fact should also be mentioned when teaching the
"water seeks its own level" demonstrated above. (Called Pascal's vases.)

~~~
saagarjha
Here's a video showing water oscillating:
[https://www.youtube.com/watch?v=cVEbh_COcRY](https://www.youtube.com/watch?v=cVEbh_COcRY)

~~~
logicallee
Cool! Thanks :)

------
hellofunk
I once got this question on an interview, and they didn’t know I’d heard it
before. So I pretended to figure it out during the interview. I gave him a
correct answer after just a few minutes, and they cut the interview short and
had me directly proceed to the HR office to proceed with onboarding. Two years
later I told them how I already knew the question. I’ve been with the company
for 6 years now.

~~~
lalaland1125
Isn't that quite unethical? You are knowingly misleading a potential employer
when you play games like that.

~~~
gottareply2020
I once interviewed fresh out of college for a tech job at a big shop. When the
interviewer got to the puzzle questions, they prefaced with ‘And be honest if
you’ve heard it before. We want to get one you haven’t heard.’

Seven puzzles later of me saying, “yes, I’ve heard that one” and giving an
short description indicating that I understood the solution, the interviewer
became visibly upset/annoyed.

And so when they asked the 8th question I suddenly ‘didn’t know this one.’ The
interviewer was delighted. Of course I did know it already but pretended to
work my way through it.

Got the offer, didn’t take it because that interviewer would’ve been my boss’
boss.

~~~
VeniVidiVici42
Similar story: I had an interview for an internship at a trading firm, in
which they asked me several questions _that I wrote_ (for a math competition
at my school). I took the honest route and explained that I had authored all
these problems, leading to the interviewer getting so annoyed that they just
cut the interview early.

Unsurprisingly, did not get an offer.

~~~
rasz
How about being interviewed using your own book, but the interviewer didnt
notice authors name on the cover, doesnt understand the questions and butchers
the problems? ;-) Happened to Elecia White (of
[https://embedded.fm/](https://embedded.fm/))

------
brummm
I don't think this should be called a paradox. It's just a case where the
limitations of the model (ideal everything) is clear and leads to inconsistent
results. Adjusting the model and making it more realistic, quickly clears up
the "paradox". To me this seems like something one would use as an example in
a physics lecture to show when certain assumptions are necessary and when they
aren't.

~~~
techslave
the birthday paradox is also not a paradox. the namers of such things just
like to use the word ‘paradox’ for some reason. it probably sounds more
puzzling to initiates.

~~~
cuspycode
Good point. A paradox is something that produces an unexpected contradiction.
It must be unexpected, otherwise any trivial false statement such as 2+2=5
would also be a paradox. Russell's paradox is a good example since no one
expected a contradiction. The birthday paradox on the other hand does not
produce any contradiction, so it's just a case of sloppy labeling.

~~~
Izkata
By that description, the birthday paradox is a paradox for anyone who doesn't
already know it. The instinctive answer is generally 1/2 the total.

~~~
ordu
_> the birthday paradox is a paradox for anyone who doesn't already know it_

It is a fate of any solved paradox. A paradox is a confusing paradox only to a
point when you learn where the contradiction comes from, and how it does it,
and how to avoid it.

------
vegetablepotpie
This example violates one of the core assumptions of circuit theory, which is
that you cannot have a node with two voltages. As soon as the switch closes,
is the voltage at the switch Vi or 0v? It would be both, which is impossible.
If you had some kind of component between the two then there would be a
voltage drop across it, and you would get realistic results.

~~~
aliceryhl
I mean, that is a simplification, and in the real world it really follows some
sort of differential equation that just happens to be very fast. And the
description on Wikipedia does seem to use an explanation based on this
differential equation, e.g. see "When a steady state is reached".

~~~
jackhalford
The differential equation is still a model and not what's happening in "the
real world", remember, all models are false.

------
Animats
It's simpler than that. When you short a capacitor, where does the energy go?
An ideal capacitor has an infinite current in that situation. Inductors have a
comparable situation - when you open-circuit an ideal inductor, you get an
infinite voltage.

In practice, you can get hundreds or even thousands of volts from inductors
that way, which is how auto ignitions and boost-type switching power supplies
work.

Similar problems come up in the idealized physics of impulse/constraint
physics engines. Getting rid of the energy in collisions requires hacks to
prevent things from flying off into space, a problem with early physics
engines.

~~~
pps43
That's one way to solve it. More generally, thinking of edge cases or
simplifying the problem is a good problem-solving strategy.

------
mdturnerphys
Adding the second capacitor is equivalent doubling the area of a single
capacitor. If you had a plate capacitor where the plates were extendable you
could charge it and decrease the energy by extending the plates, which tells
you that there's a force that is pushing to extend the plates. Of course there
is--the charges on one plate repel each other and "want" to increase their
spacing. If you do extend the plates there is a force times a distance, which
equals work done by the charges, decreasing the capacitive energy.

~~~
compumike
This is a beautiful explanation, thank you!

It's also compatible with barbegal's hydraulic pressure analogy elsewhere in
the discussion. A liquid- or gas-filled tank feels pressure (i.e. force per
area) on the walls as the fluid "wants" to either (1) flow to a lower
gravitational potential energy location, for a liquid tank in a gravitational
field, or (2) expand in volume, in the case of a pressurized gas tank.

------
n-gauge
Here's another one - put an oscilloscope across a capacitor and turn off the
circuit it's connected too. Quickly short the capacitor with something, and
watch the voltage on the oscilloscope as the capacitor discharges, remove the
short and watch it start recharging slightly.

Where does this charge come from?

~~~
analog31
It's a non ideal behavior of a cap, and some dielectric types have it worse
than others. I once made a sample-and-hold for a data acquisition system, and
must have tried every type of cap in the bin until I found one that resulted
in the least amount of correlation between subsequent readings. I think it was
a polypropylene type. Mica was the worst. I don't think I tested an
electrolytic.

------
cushychicken
FYI - this is a popular intro level interview question at semiconductor
companies. This mechanism is the whole basis of how DRAM works, as well as the
foundation of some cap sense technologies. Likely plenty of applications I
don't know about, either!

------
TheOtherHobbes
Explained here:

[http://hyperphysics.phy-
astr.gsu.edu/hbase/electric/capeng2....](http://hyperphysics.phy-
astr.gsu.edu/hbase/electric/capeng2.html#c4)

For an infinitely small resistor the energy is effectively a spark pulse
coupled directly to free space, and half is radiated away in EM waves.

~~~
dvt
Not an electrical engineer, but I wish this was higher. Seeing the integral
completely reframes the problem and the paradox vanishes. The intuition is
that charge transfer is a linear system (half goes here, half goes there), but
seeing the integral form shows otherwise.

Thanks for the great source!

------
mindslight
In the true EE parts reduction fashion, you don't even need two capacitors.
One capacitor plus a switch works out similarly - in fact it's an equivalent
circuit. Everyone has an intuition for shorting a capacitor (zap!). When there
are very few components defining a system, the parasitic components must be
significant.

~~~
klyrs
The spring/mass model works really well here, too. Connect two identical
springs together between a pair of fixed walls. Pull on it so that one spring
is stretched and the other is at its natural length....

~~~
dguest
Or release a ball bearing on one side of a U-shaped track. The ball ends up on
the bottom of the track, where did all the potential energy go?

------
rzimmerman
This is effectively the same paradox some friends and I discussed in college.
Another way of looking at it is:

If you connect an ideal voltage source through a resistor R to a capacitor C,
the amount of energy required to charge the capacitor is CV^2 while the amount
of energy that winds up in the charged capacitor is 1/2 CV^2. The other 1/2
CV^s is dissipated across R. This is unaffected by the value of R, even as R
-> 0\. The only thing that changes is the charge time.

R = 0 is impossible for real circuits, but no matter how close you get you
still lose half of that energy in the resistor.

------
pholos
Hearing about this problem while I was taking a stats mech course (online from
Leo Susskind) this reminded me more of energy / entropy relationship than a
paradox. For example if we have hot and cold reservoirs separated by a divider
in a bath, when we remove the divider entropy of the system increases when it
reaches equilibrium. After reaching equilibrium, moving the divider back will
not cause the two reservoirs to return to the initial hot cold state.

The system with 2 capacitors seems like a good analogy to a heat bath; when
the switch is flipped the charge is divided equally between the capacitors
when it reaches equilibrium. The entropy of the system has increased, and the
potential to do work has decreased. The number of possible states the system
can be identified in has decreased by half (it is not possible to know which
side had the initial charge after the switch has been flipped). Flipping the
switch back will not bring the charge back to only one side. While this line
of thinking doesn't explain the physics of what is happening, there is clearly
a (statistically) irreversible change going on which seems like the natural
language is energy, entropy, and temperature.

------
moultano
Does anyone have a sense of how much the idealization of circuit design limits
people's imagination when designing real circuits? Are there fruitful
possibilities that could be explored but aren't because the abstraction
doesn't contain them?

~~~
pps43
This question tests understanding of limitations of idealized circuits. Anyone
with hands-on experience of shorting a capacitor knows about sparks and arcing
that accompanies it.

~~~
fdavison
"While in theory there is no difference between theory and practice, in
practice there is."

------
dheera
I wouldn't really consider this a paradox. It is a failure mode of the
idealization you made in saying that wires and capacitors have zero resistance
and inductance.

Even if you work by your idealization, saying wires have zero resistance means
that every piece of connected conductor in the circuit is at the same
potential (in the absence of a magnetic field) so saying you have two
connected capacitors charged to different potentials is already violating your
assumption.

You can find similar edge cases in almost every situation and field of study
where you try to simplify things with an approximation, and most of them
aren't called paradoxes.

------
CoffeeDregs
Got this question in an interview at National Semiconductor (out of MSEE
school). I didn't think it was too paradox-y: we didn't work the math through
fully but my answer of "start with the circuit with a resistor with value R
and the energy will burn up in R; now recalculate as R→0 and the energy will
still burn up in R (even though R is zero-y...". That seemed to satisfy the
interviewer (who had not heard that answer before).

~~~
gnramires
I think an interesting question following it up is, how do you transfer energy
between capacitors then, without losing so much energy? (someone else asked if
this is a fundamental limitation)

There are many alternatives. A good start is noting that the inefficiency is
actually lower the lower the starting voltage difference:

V1 = V, V2 = V-dV

V' = (V + (V-dV))/2 = V+dV/2

We can define efficiency as the ratio of energy lost by the first to energy
transferred to the other.

dU1 = U1-U1' = CV^2/2-CV'^2/2 = C/2 (V dV-dV^2/4)

dU2 = U2'-U2 = CV'^2/2-C(V-dV)^2/2 = C/2 (-V dV+dV^2/4+2VdV-dV^2) = C/2 (V dV
- 3dV^2/4 )

n = (dU2/dU1) = ( V - 3dV/4 ) / ( V - dV/4) ~ 1 - 3/4 dV/V (for small dV)

as dV → 0, n → 1. You lose 3/4 of the fractional difference in efficiency, so
for 10% difference your efficiency is ~92.5%, pretty great.

Now, there are indeed devices that change voltages without energy losses!
(transformers, for example). So if you plug in a variable transformer that
keeps the voltage close to the target, your (dis)charging efficiency can be
arbitrarily high.

Of course, if your second voltage is 0, the efficiency must start at 1/3 no
matter what (which can seem to imply this cannot be changed) -- but as soon as
you have a small voltage you can start tracking it and keep efficiency high.

Challenge to the reader: Use quantum mechanics and thermodynamics to derive a
fundamental limit of efficiency (which must be less than 1 at positive
temperatures) :)

~~~
mindslight
Inductor in series with a diode. The voltage differential stores energy in the
inductor's magnetic field, which comes back out when the destination capacitor
is at a higher voltage than the source capacitor. The diode keeps the process
from repeating in reverse (oscillation).

~~~
gnramires
Cool, but what if you want the voltages to be exactly equal (while keeping no
losses)? :)

~~~
mindslight
Dump the charge into a third capacitor, connect the two you want equal, and
dump the charge back.

------
dekhn
I remember explaining how an NMR machine works to an EE person. They simply
refused to believe me that you could inject current into a supercooled
superconductive magnet and have it circulate for months at a time. The only
way I could convince him it worked was to point out that slowly the system did
loose energy and you had to go back and add more current.

------
aj7
Try it in Spice with realistic small resistances and inductance. Every
electrical engineer is taught, in basic theory: The voltage on a capacitor
cannot change instantaneously. The current in an inductor cannot change
instantaneously. These become much clearer when you write down the INTEGRAL
form of the V-I relations.

------
amelius
The problem with this is that once you close the switch, you get an infinite
current (aka short circuit). Bad idea!

~~~
kees99
Yeah, with substantial amount of energy in that capacitor, that is exactly how
you weld the contacts in that switch shut.

------
Stierlitz
@surewhynat

Why did someone mod you down dead?

\- quote - It's an exponential function on the W=CV^2

let's say initially:

C = 1

V = 16

W = 1 * 16^2

    
    
      = 256
    

When the Voltage is split between the two capacitors, the voltage drops in
half from 16 to 8, but because there are two capacitors you count them twice:

W = CV^2 + CV^2

C = 1

V = 8

W = (1 * 8^2) + (1 * 8^2)

    
    
      = 128
    

Where did half the energy go? People are saying it's loss in magnetic
radiation during the transfer. But on paper it still seems counter intuitive,
so it's called a, "paradox," instead of just how an exponential function
works. Something in the universe makes the energy levels exponentially higher
as voltage increases. More electric pressure (V) = exponentially more energy.
Cool! \- unquote -

~~~
gnramires
Correction: It's not exponential, it's a quadratic (or polynomial).

(I think the difficult part isn't to accept that some of the energy vanished
from the system, it just contradicts our expectation from having supposedly no
dissipation elements)

------
ummonk
Without reading the solution: wouldn’t this impossible zero resistance zero
inductance ideal setup result in infinite frequency infinite magnitude
oscillations? Add in some resistance and the missing energy goes into heat
generated by the resistance on the way to equilibrium.

Edit: also when I think about it there is a little bit of additional energy in
the open switch which is itself a capacitor.

Edit 2: for this circuit to stay the way it is in the initial state, wouldn’t
the open switch need to have equal capacitance to the capacitors? Or some kind
of voltage generating field applied across it that is removed when the switch
is closed?

~~~
pps43
If inductance is zero, there would be no oscillations.

~~~
ummonk
That would be true if resistance were non-zero.

~~~
pps43
To get oscillations, you need to shift the phase by 180 degrees. Capacitance
alone (without some inductance) can only do 90.

------
leni536
A somewhat analogous effect/paradox in thermodynamics is the Joule expansion:

[https://en.wikipedia.org/wiki/Joule_expansion](https://en.wikipedia.org/wiki/Joule_expansion)

------
userbinator
This is another instance of those situations where "the abstraction is leaky".
Relatedly, I've seen (unfortunately) a few textbooks which attempt to teach
basics of computing and digital logic by assuming that gates have no
propagation delay, or at least that's what their timing diagrams seem to show.
It's very puzzling because a lot of sequential circuit elements rely on that
in order to work.

------
pps43
A real-world analogy is a brick standing upright on the table. If you topple
it and it falls, some of the potential energy is gone.

------
irrational
I knew nothing about electricity until I started studying for my technicians
license recently. It was actually very interesting and I learned enough that I
could actually understand this wiki article. It made me interested in studying
for the general and extra licenses since they have more advanced electrical
knowledge required.

------
kees99
Funny thing is - this is exactly what happens many millions times every single
clock cycle inside pretty much any modern(-ish) digital CMOS CPU/ASIC, with
the right-hand-side capacitor being parasitic gate capacitance in the driven
gate.

~~~
jacquesm
Which in turn is why your CPU needs a heatsink.

And why reversible computing can be done without using energy ;)

------
phendrenad2
This is an easy one. The assumptions are flawed. W = (0.5) x(C)x(V) is a back-
of-the-envelope shorthand for a whole realm of formulas in the study of
capacitors, and it doesn't work in edge cases like this.

------
ars
I learned that this is also why you should never connect batteries in parallel
- the power will oscillate in much the same manner, draining away the energy
and wearing out the batteries.

------
simonblack
The 'paradox' in this experiment lies in believing that you can have a voltage
across one of the capacitors and zero volts across the other before you hit
the switch. In other words, you can't have two connected locations resting at
different voltages.

    
    
      --------| |---------------|  |----------
         --- +6 -6 ------------ 0  0 -----
    
                 ^^^^^^^^^^^^^^^^ NOT POSSIBLE!
    

Two capacitors in series are equivalent to one (combined) capacitor, just like
a bunch of batteries can be considered to be one (combined) battery.

~~~
Dylan16807
You can definitely have a charged capacitor in series with an uncharged
capacitor. They only act as an evenly-split combined capacitor if they _start_
at the same charge.

Your diagram is wrong. Let's mark out some contact points:

    
    
      ---| |-------| |---
        A   B     C   D
    

Voltages only exist _between_ points. To measure against ground, part of the
circuit has to be connected to ground. Ground is a point like any other.

So when you measure A at 12 volts above B, it doesn't mean B is at any
absolute voltage. If only one capacitor is charged, then A can be 12 volts
above B while B=C=D. It works out fine.

If you attach ground to B or C, then A is 12 volts relative to ground, and B
and C and D are all 0 volts relative to ground.

If you attach ground to A, then A is 0 volts relative to ground, B and C and D
are all -12 volts relative to ground.

If you somehow attach ground to the midpoint of A and B, then A is 6 volts
relative to ground, and B and C and D are all -6 volts relative to ground.

None of these are impossible. Nothing goes wrong until you try to close the
switch.

------
wolfgke
What experiments were done to settle the question which property of the "non-
idealized" models is the dominant one?

------
Stierlitz
My brain hurts, is there a simpler version?

~~~
Dylan16807
Yes there is, and it's listed at the end.

You have an ideal capacitor, charged to some voltage. You connect both ends,
which empties it.

Where did all the energy go?

The answer is that there's no such thing as an ideal capacitor or an ideal
wire. There are a few effects you can't avoid, but most importantly there are
tiny bits of internal resistance that usually go ignored. In a short circuit,
they become important, and will turn all the energy into heat.

