Heat lost in ideal capacitor charging

The problem with these theoretical examples lies in the fact the current is assumed infinite for 0 seconds. Crudely substituting this in the conservation law:

$$ \frac {\partial \rho }{\partial t} +\nabla \cdot \mathbf {J} = 0 $$

$$ \frac { \rho }{ 0 }+ \infty \neq 0 $$

Since charge is conserved, the assumption of infinite current in zero time is wrong.

How much power is dissipated \$P_{diss}=VI\$ cannot be defined, since the definition of the current is false.

So, the answer is: cannot be defined

EDIT
Note that the dissipation neither is 0 W because R = 0 \$ \Omega\$. For the same reason as above: \$ P = I^2R = \infty^2 \cdot 0 \$, which is not defined.


When masses collide in an inelastic manner, momentum is conserved but energy has to be lost. It's the same with the two-capacitor paradox; charge is always conserved but, energy is lost in heat and EM waves. Our schematic model of the simple circuit isn't sufficient to show the subtler mechanisms at play such as interconnection resistance.

An elastic collision can be said to be equivalent to adding series inductors in the wires. Somewhere between the two is reality - the connections are composed of resistors and inductors; the fact that our schematic may not show them is just a weakness of our imagination.


What's the mechanism by which heat is lost in this case?

Normally, the wires and the switches have some resistance. Because current flows through the wires, heat is produced.

I noticed that the energy lost equals that stored in the "equivalent" series capacitance if it was charged to V0. Is there any reasoning why it is so?

If you charge an "ideal" capacitor where charge and voltage are proportional, 50% of the energy will be converted to heat.

However, if you have "real" capacitors where charge and voltage are not exactly proportional (as far as I know this is the case for DLCs) the percentage of energy which is converted to heat is NOT exactly 50%.

This means that the key to your observation lies in the equation of the capacitors (q ~ v) and there is no "intuitive" explanation that is independent of that equation.

(If there was an explanation that is independent of the equation, the percentage would also be 50% for "real" capacitors.)