5. Storage and decay
When the circuit remembers
Section titled “When the circuit remembers”The divider reaches its algebraic answer without remembering a previous voltage. A charged capacitor is different: its stored charge is part of the initial condition. Connect it across a resistor and its voltage falls gradually while the resistor converts stored electrical energy into heat.
We will derive this discharge on paper and run its normalized scalar equation. The calculation uses one state, which makes the time scale and energy balance particularly easy to interpret.
Charge storage creates a derivative
Section titled “Charge storage creates a derivative”Let the capacitor voltage be positive at its upper terminal, and define both capacitor and resistor currents as entering their upper terminals. For a constant capacitance , stored charge is , so
The resistor carries . With no external source attached, upper-junction conservation is . Therefore
This ideal RC discharge is treated in OpenStax §10.5. The sign matters: positive resistor current means the capacitor’s into-terminal current is negative while discharging.
shared upper node ┌────────●────────┐ │ │ C, v(t) R, iR ↓ │ │ └────────●────────┘ reference nodeConceptual discharge circuit. The capacitor and resistor share their upper and lower nodes. The resistor current is supplied by decreasing stored charge.
Derive the time history before solving
Section titled “Derive the time history before solving”Set , with units of seconds. Dividing the ODE by and separating variables gives
For nonzero , define . Then
Choose kΩ and mF, so s and s⁻¹. The voltage falls to of its initial value after one second. The following table comes from the exponential formula, not a numerical run:
| Time / s | Remaining energy fraction | |
|---|---|---|
| 0 | 1 | 1 |
| 0.25 | 0.778801 | 0.606531 |
| 0.5 | 0.606531 | 0.367879 |
| 1 | 0.367879 | 0.135335 |
Run the normalized law
Section titled “Run the normalized law”This .eqi file states the normalized equation directly. The symbols R and
C have disappeared because they enter through the single rate .
// A minimal implicit ODE: x decays at the rate supplied by the user.model decay() { // `x` is dimensionless and starts at 1. `rate` has inverse-time units. state x: 1; initial { x = 1; } parameter rate: 1 / s = 1;
// Eqiora writes the evolution law as a residual equal to zero. relation flow { derivative(x) + rate * x = 0; }}Using the environment and checkout from Get started, run:
uv run --no-project --python .venv/bin/python python eqiora-source/examples/python/textbook_decay.py eqiora-source/examples/decay.eqiThe complete runner is:
"""Run the decay model shared by Get started and the ODE lesson."""
from __future__ import annotations
import argparsefrom pathlib import Path
import eqiora
OUTPUT_TIMES_S = (0.25, 0.5, 1.0)
def solve(source_path: Path) -> tuple[tuple[float, float], ...]: """Return the requested (time in seconds, dimensionless value) samples."""
model = eqiora.compile(path=source_path) field = model.field(model.field_ids[0]) plan = eqiora.resolve( model, temporal=eqiora.time.Tsitouras45( initial_step_s=0.01, relative_tolerance=1.0e-9, absolute_tolerances={field: 1.0e-11}, ), ) result = eqiora.run( plan, state=eqiora.State.initial(plan), until_s=OUTPUT_TIMES_S[-1], output_times_s=OUTPUT_TIMES_S, ) series = result.series(field) times = series.time.numpy() values = series.values.numpy() return tuple( (float(time_s), float(value)) for time_s, value in zip(times, values, strict=True) )
def main() -> None: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("model", nargs="?", type=Path, default=Path("decay.eqi")) args = parser.parse_args() for time_s, value in solve(args.model): print(f"t={time_s:.2f}, x={value:.10f}")
if __name__ == "__main__": main()It selects an adaptive Tsitouras 4/5 time method, then requests observations at 0.25, 0.5, and 1 s. Compare each numerical value with using an absolute difference of at most for these settings. The output times are observation requests; the method can take additional internal steps.
The initial equation fixes the physical state. A numerical tolerance tells the integrator how accurately to approximate that state’s evolution. Neither the initial step size nor an observation time is an extra component law. For that distinction in more depth, visit numerical simulation.
Recover volts and joules
Section titled “Recover volts and joules”For V, convert the dimensionless result back with V. At one second, this predicts about 4.41455 V.
The stored energy is . Differentiating and using the ODE gives
The resistor’s positive absorbed power exactly matches the decrease of stored energy. Here J. At one second, J, about 0.009744 J. About 0.062256 J has become heat. Checking voltage alone would miss a factor-of-two error in an energy formula.
Recognize the same structure elsewhere
Section titled “Recognize the same structure elsewhere”A lumped object cooling toward an environment temperature satisfies when its thermal capacity and heat-loss coefficient are constant. Its normalized excess temperature decays with rate . Compare this with : storage divided by a transport coefficient sets a time scale in both problems.
The heat-transfer path explains when uniform temperature is a reasonable approximation. The scalar trajectory here is the reduced equation we derived; interpreting it as a capacitor voltage requires the constant-, constant-, isolated-discharge assumptions stated above.
Change a sign, a scale, or the observation schedule
Section titled “Change a sign, a scale, or the observation schedule”Copy the model into your working folder and pass that copy’s path to the same
runner. Doubling rate halves the time constant. At one second, predict
before running.
Changing + rate * x to - rate * x instead predicts growth . The
units remain consistent, but the isolated discharge would create energy. The
energy argument reveals why this is the wrong physical sign.
Adding more output times changes how densely you observe the solution. It does not alter the initial condition or introduce a sampled controller. Compare against the same exponential at every added time.
Exercises
Section titled “Exercises”- Derive the half-voltage time and half-energy time. Which is shorter?
- Two RC combinations have the same product and the same initial voltage. Must their stored energies also agree?
- Show that solves the charging equation for a constant source.
- Explain why a state-space view using and one using describe the same discharge, and what conversion is needed to compare observations.
Answer sketches
- Voltage halves at ; energy halves at , because energy is proportional to squared voltage.
- No. The normalized trajectories agree, but depends on separately. For example, doubling and halving doubles initial energy.
- Differentiation gives , canceling . At zero time the expression equals .
- They are related by a constant nonzero scale. Multiply by to compare voltages, and by the appropriate energy formula to compare stored energy.
Reference
Section titled “Reference”Samuel J. Ling, William Moebs, and Jeff Sanny, University Physics Volume 2, OpenStax (2016), §10.5, RC Circuits.
Previous: Open the components · Book map · Continue with heat transfer