Pick a charging method, then change C, R and V: watch charge pile onto the plates, current fall away, and exactly half of the supplied energy turn into heat when a capacitor is charged from a fixed voltage.
The science
A capacitor stores charge q = C·v and energy E = ½·C·v² = q²/2C. Through a series resistor R the voltage obeys R·dq/dt = V − q/C, giving v(t) = V(1 − e^(−t/τ)) with time constant τ = R·C (63.2 % charged at one τ, 99.8 % at six). Discharging into a load R gives v = V₀·e^(−t/τ). With a constant-current source the voltage first ramps linearly, v = I·t/C, until the source becomes voltage-limited, then relaxes exponentially.
Why half is lost. The source delivers ∫V·I dt = C·V² but the capacitor keeps only ½·C·V²; the other half is dissipated in R as ∫I²R dt, independent of the value of R (a small R just makes the spike shorter and taller). This is why fast, large-current charging of a capacitor bank wastes energy as heat and why current-limited or stepped charging is used.
The solver is a fourth-order Runge-Kutta integration of charge, source energy and heat together; the page compares it live with the closed-form solutions. Simplifications: ideal capacitor (no leakage, no extra equivalent series resistance beyond R, no voltage-dependent capacitance), ideal sources. The supercapacitor preset only reuses a larger C and a 2.7 V rating as an illustrative example, not data for a specific product. Playback runs in units of τ so any C and R animate at a watchable pace.