RC charging and discharging: experiment bench
RC charging and discharging
A resistor fills (or empties) a capacitor. After one time constant τ = RC it has gone about 63 % of the way.
- 1. Ask
- 2. Hypothesise
- 3. Set up
- 4. Run
- 5. Record
- 6. Change one variable
- 7. Compare
- 8. Interpret
- 9. Limitations & save
If I change …, then … will …, because …
3 · Set up the parameters
The voltage the capacitor charges towards (or starts from, when discharging).
More resistance slows the current, so charging takes longer.
A bigger capacitor holds more charge, so it takes longer to fill.
1 starts the capacitor full and lets it empty through the resistor.
How many time constants to simulate.
The seed fixes any random noise. Same parameters + same seed = exactly the same result, every time, on every computer.
6 · Change one variable
Your first run is the baseline. After it, change one thing at a time.
7 · Compare on a graph
5 · Run log
No runs yet.
Equations
τ = R × C. Charging: v(t) = V (1 − e^(−t/τ)). Discharging: v(t) = V e^(−t/τ). At t = τ: 63.2 % of the way.
Assumptions (always true in this model)
- Ideal battery with no internal resistance
- Ideal capacitor: no leakage, no series resistance
- Backward Euler with 200 steps per time constant (slight numerical lag, under 0.2 %)
- Switching happens instantly at t = 0
Text description of what the chart shows
A line chart of capacitor voltage against time. When charging it rises steeply from 0 and curves over towards the battery voltage; when discharging it falls steeply and flattens towards 0. The current line starts at its largest value, V divided by R, and decays towards zero.
Did the result support your hypothesis? Use the numbers from the comparison table and link them to an equation.
Which assumptions could change your answer in the real world?
Export and save
Exports use the ticked runs (or every run if none are ticked). Your draft saves automatically in this browser only. The Journal is private to you.
Valid parameter ranges
| Parameter | Range | Default |
|---|---|---|
| Battery voltage | 1 to 12 V | 9 |
| Resistance | 100 to 100000 Ω | 1000 |
| Capacitance | 1 to 2200 µF | 1000 |
| Discharge instead of charge (0 or 1) | 0 to 1 | 0 |
| Run length | 1 to 10 τ | 5 |
Independent reference checks
Charge 9 V through 1 kΩ into 1000 µF
Closed form v(t) = V(1 − e^(−t/RC)); t90 = RC·ln 10
Discharge 5 V through 10 kΩ from 100 µF
Closed form v(t) = V e^(−t/RC)
Checked automatically on every change to the code. Educational model, not engineering-grade.