RCLAB MA226B

MA226B / ODE EXHIBITION

The RC Lab.

How fast does a capacitor respond when you flip a switch? Follow one differential equation from the circuit to the curve.

Tau times d y over d t plus y equals x of t.

Illustration of a cylindrical capacitor mounted on a circuit board
ENERGY SYSTEMS & BATTERIES5–10 MIN LAB

Introduction

How fast does voltage settle?

A switch changes the input voltage in an instant. The voltage across a capacitor takes time to catch up. How can an engineer predict that delay, and which component values give the response they want?

One circuit, two directions

A resistor limits how quickly charge moves onto or off a capacitor. Connect a source above the capacitor’s initial voltage to charge it. Switch to a closed path through the resistor to discharge it. The same first-order linear equation describes both responses.

A building block for battery models

Battery models use RC branches to approximate the voltage that gradually relaxes after a change in current. The lab isolates the mathematics of one exponential transient in a simple circuit.

Introduction by Names pending

INTERACTIVE EXPERIMENT

Charge. Discharge. Repeat.

Change the components, then see what moves the curve and what sets its final voltage.

VOLTAGE RESPONSE

Capacitor voltage VC(t)

Charging Active equilibrium τ

Charging from 0 V toward 5 V. Time constant 2 seconds. Use the time cursor or voltage samples to inspect the graph.

2.00 s
VC at cursor
3.16 V
Equilibrium
5.00 V
VC at τ
3.16 V

What the curve is telling you

At τ = 2.00 s, the capacitor closes 63.2% of its original gap to 5 V.

V₍C₎(t) = 5 − 5 e^(−t / 2.00) V

Try it with a fixed time axis

Reset, then double R from 4 to 8 kΩ. The 63.2% point moves from 2 s to 4 s, and the 5 V equilibrium stays put. Turn on comparison to see both modes close the same fraction of their own gap in one τ. Each mode remembers its initial voltage; the dashed curve uses the other mode’s settings.

View voltage samples
Analytic voltage by time
Time (s)Charging (V)

Experiment, simulator & graph · Names pending

Mathematical model

From a circuit to an ODE

Take current I to be positive into the capacitor’s positive terminal. In this series circuit, the same signed current passes through the resistor and capacitor.

Apply the circuit laws

Series RC circuit A voltage source at left, a resistor along the top, and a capacitor at right form a closed loop. The reference direction for current is clockwise. The top capacitor terminal is positive. Vin RI C +−
Positive current is defined clockwise, into the upper plate.

Kirchhoff’s voltage law and Ohm’s law give the loop equation.

Vin(t) − RI − VC = 0

Since charge q = CVC and capacitance is constant, I = dq/dt = C dVC/dt. Substitute this current and rearrange.

RC dVC/dt + VC = Vin(t)

In the form τ dy/dt + y = x(t), the output y is capacitor voltage, the input x is applied voltage, and the time constant τ = RC is measured in seconds.

Variables and assumptions

t, VC(t), I(t)
Time (s), capacitor voltage (V), and signed current (A).
R > 0, C > 0
Constant resistance (Ω) and capacitance (F). A kilohm times a microfarad is one millisecond.
Vin(t), V0
Applied voltage and initial capacitor voltage, with VC(0) = V0.

The resistor, capacitor, source, and switch are ideal. Wires add no resistance, the capacitor has no leakage, and each run uses one constant input. The discharging switch removes the source and closes the resistor path, which sets the loop input to 0 V.

Mathematical model and circuit diagram by Names pending

Analysis

The gap shrinks exponentially

For a fixed input V*, set dVC/dt = 0 to find the equilibrium voltage VC = V*. Measure the response by how far it is from that equilibrium.

Solve the initial-value problem

Write u = VC − V*. The ODE becomes u′ = −u/τ. Multiply by the integrating factor et/τ to get (et/τu)′ = 0. Using u(0) = V0 − V* gives

VC(t) = V* + (V0 − V*)e−t/τ.

Because τ > 0, the gap tends to zero for every initial voltage. The equilibrium is globally exponentially stable. Below it, the slope is positive. Above it, the slope is negative. At equilibrium the trace is flat.

Compare rising and falling

Charging from 0 V with a 5 V source reaches 5(1 − e−1) ≈ 3.16 V after one τ.

Discharging from 5 V reaches 5e−1 ≈ 1.84 V after one τ.

In either case, 36.8% of the original voltage gap remains after one τ. After three τ, about 5% remains. Compare the curves by measuring the fraction of the gap remaining, |u(t)|/|u(0)|, against elapsed time in units of τ.

Separate speed from current

Try 4 kΩ with 500 µF, then 2 kΩ with 1000 µF. Both give τ = 2 s, so the voltage curves coincide for the same input and initial voltage. With a 5 V step from 0 V, the initial currents are 1.25 mA and 2.50 mA, respectively, by I(0) = (5 V − V0)/R. A nonconstant voltage trace identifies the product RC.

Analysis by Names pending

DESIGN CHALLENGE

Hit the 4.60 s mark.

Design a circuit that reaches 4.50 V after 4.60 seconds from an initial 0 V and a 5 V source. Choose a resistor and capacitor, then check your prediction.

Show a mathematical hint

At 90% of the rise, one tenth of the original gap remains. Set e−t/τ = 0.10, so t90 = RC ln(10). Search for two component pairs that give the same product.

Challenge · Names pending

Choose your components

Match 4.60 s within ±0.10 s. Then try a second design.

Conclusion

What the model can predict

The constant input sets the endpoint, the initial voltage sets the starting gap, and RC sets how quickly that gap closes. That makes the equation a way to choose components for a desired settling time.

Voltage, stored energy, and SOC

An ideal capacitor stores energy E = ½CVC2. During discharge through a resistor, its voltage decays as e−t/τ and its stored energy decays as e−2t/τ.

A lithium-ion cell stores energy electrochemically. Its state of charge (SOC) is a fraction of charge capacity. For ideal coulomb counting, dz/dt = −Iout/Q, where z is SOC, Iout is discharge current, and Q is capacity in coulombs. In a battery equivalent circuit, an RC branch represents a transient voltage alongside a separate SOC model.

What the load and charger control

A 10 W load receives 60 J in 6 s. In an ideal lossless energy balance, stored energy decreases linearly while that load remains on. Battery current is P/Vterm, so a falling terminal voltage increases the current needed to sustain the same power. The SOC trajectory follows that current and battery capacity.

A typical lithium-ion charge starts with constant current. Once the terminal voltage reaches its set limit, the charger holds the voltage steady and the current tapers.

Test with cell data

After a measured current pulse, fit one exponential to a cell’s rest-voltage trace. Compare the residuals against a fit with two time constants. Repeat at different SOC and temperatures to test when a single RC branch gives a useful approximation.

OpenStax on RC circuits · Experimental study of lithium-ion equivalent circuits · NASA on lithium-ion charging

Conclusion by Names pending

MA226B ODE EXHIBITION

Project credits

Group members
Names pending

Individual contributors appear beside their work. The group can update every name in credits.js.

Site design & implementation · Names pending

AI assistance · Drafting, implementation, and hero illustration.

Blackboard post