Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Switching time 6
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the sixth flip, later than the fifth; blank for none.
- Switching time 7
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the seventh flip, later than the sixth; blank for none.
- Switching time 5
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the fifth flip, later than the fourth; blank for none.
- Switching time 3
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the third flip, later than the second; blank for none.
- Switching time 4
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the fourth flip, later than the third; blank for none.
- Your prediction: the 90% time
-
When omitted Blank
Unit s Default Not set Range 0 to 5
About this input
Challenge 2 only: your prediction of when the capacitor reaches 90% of its final voltage, in seconds. Drag the dashed line on the time axis; the curve appears once you predict.
- Time per division (required)
-
Unit s Default 0.5 Range 1E-06 to 2
About this input
The scope's time per division, one of its 1-2-5 settings from 1 microsecond to 2 s; the window is 10 divisions. Drag the time axis or use its + and - buttons.
- Switch position at the start (required)
-
Default Charge Allowed Charge, Rest
About this input
Where the switch blade is at the start: Charge (to the battery) or Rest. Tap the blade to flip it.
- Switching time 8
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample of the eighth flip, later than the seventh; blank for none.
- Rest contact connects to (required)
-
Default Ground Allowed Ground, Open
About this input
What the switch's rest contact connects to: Ground (the capacitor discharges through R1) or Open (nothing, so only R2 can drain it). Used only while the rest position is used.
- Switching time 2
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample where the switch flips the second time, later than the first; blank for none.
- Step size of the step-by-step method (required)
-
Unit time constants Default 0.5 Range 0.1 to 3
About this input
The step size of the step-by-step methods as a share of the time constant: 0.1, 0.5, 1, 1.5, 2, 2.5 or 3. Chosen with the chips on the step-by-step chart.
- Your prediction: the heat in R1 (required)
-
Default Not yet chosen Allowed Not yet chosen, Less heat with a small R1, Less heat with a large R1, The same: half of the battery's energy
About this input
Challenge 5 only: your prediction of how much of the battery's energy becomes heat in R1. Choose one of the three answers.
- Challenge number (required)
-
Default 0 Range 0 to 5
About this input
0 for free play, or 1 to 5 to load a challenge.
- Capacitor C (required)
-
Unit F Default 0.0001 Range 1E-09 to 0.001
About this input
The capacitor C in farads, from 1 nF to 1,000 microfarads. Drag the capacitor's badge; it steps through the standard E24 values.
- Starting capacitor voltage (required)
-
Unit V Default 0 Range -24 to 24
About this input
The capacitor's voltage at the start, from -24 to 24 V. Drag the capacitor's second badge.
- Battery voltage E (required)
-
Unit V Default 10 Range -24 to 24
About this input
The battery voltage E, from -24 to 24 V. Drag the battery's value badge up or down.
- Switching time 1
-
When omitted Blank
Unit sample Default Not set Range 1 to 239
About this input
The sample (1 to 239) where the switch flips the first time; leave blank for no flip. Tap the scope's time axis to add a flip.
- Load resistance R2 (required)
-
Unit ohm Default 100000 Range 10 to 1000000
About this input
The load resistor R2, from 10 ohm to 1 Mohm; used only while the load resistor is On.
- Load resistor R2 (required)
-
Default Off Allowed Off, On
About this input
Whether the load resistor R2 is connected across the capacitor: Off or On. Tap the small switch above R2.
- Resistor R1 (required)
-
Unit ohm Default 10000 Range 10 to 1000000
About this input
The series resistor R1, from 10 ohm to 1 Mohm. Drag R1's badge; it steps through the standard E24 values.
Outputs
- Segments between switchings: start time, switch position, time constant, voltages and energies
-
No unit declared
About this output
One row per stretch between switch flips: start time, switch position, time constant, final value, start and end voltages, and the battery energy and the heat in R1 and R2 in the energy unit.
- Scope trace: time, capacitor voltage, the three currents, the switch position and the charge level at 241 samples
-
No unit declared
About this output
The scope at 241 samples: time in the time unit, the capacitor voltage, the capacitor, R1 and R2 currents in the current unit, the switch position (1 at charge) and the charge level (the voltage over the larger of the battery and starting voltages).
- Scope time axis end
-
No unit declared
About this output
The end of the scope's time axis in the time unit.
- Energy from the battery
-
Unit J
About this output
The energy the battery delivers over the window, in joules.
- Change in stored energy
-
Unit J
About this output
The change in the energy stored in the capacitor, one half C v squared at the end minus at the start, in joules; negative when it loses energy.
- Battery voltage used
-
Unit V
About this output
The battery voltage used, in volts (a challenge may fix it).
- Energy from the battery (text)
-
No unit declared
About this output
The battery's energy written with an SI prefix and four significant figures.
- Resistor R1 used
-
Unit ohm
About this output
The resistor R1 used, in ohms.
- Formula module versions
-
No unit declared
About this output
The versions of the formula modules the model is built from.
- Model version
-
No unit declared
About this output
The version of the model.
- Load resistance R2 used
-
Unit ohm
About this output
The load resistor R2 used, in ohms; blank while the load is off.
- Scope advice
-
No unit declared
About this output
A tip when the time constant is too short or too long for the chosen time per division; blank otherwise.
- Voltage when the rest begins
-
Unit V
About this output
The capacitor voltage when the first rest after a charge begins, in volts; blank when there is no such rest.
- Voltage lost during the rest
-
Unit %
About this output
How much of that voltage is lost by the end of the first rest, as a percentage.
- Change in stored energy (text)
-
No unit declared
About this output
The change in stored energy written with an SI prefix and four significant figures.
- Time constant at rest (text)
-
No unit declared
About this output
The rest time constant written with an SI prefix and four significant figures.
- Time constant at rest
-
Unit s
About this output
The time constant at rest, in seconds: R1 times C to ground, or R2 times C with the rest contact open and the load on. Blank when the rest position is not used or the capacitor simply holds its charge.
- Time constant while charging (text)
-
No unit declared
About this output
The charging time constant written with an SI prefix and four significant figures, for example 103.4 ms.
- Time per division used
-
Unit s
About this output
The time per division used, in seconds.
- Voltage axis lower bound
-
Unit V
About this output
The lower end of the scope's voltage axis, in volts.
- Voltage axis upper bound
-
Unit V
About this output
The upper end of the scope's voltage axis, in volts.
- Time unit
-
No unit declared
About this output
The unit of the scope's time column: microseconds, ms or s, from the time per division.
- Switch position at the start used
-
No unit declared
About this output
Where the switch started: Charge or Rest.
- Rest contact used
-
No unit declared
About this output
What the rest contact connected to: Ground or Open; blank when the rest position is not used.
- Switching times used
-
No unit declared
About this output
The switching samples used, in order, for example 24, 48, 72; blank when the switch never flips.
- Challenge 1 target dots
-
No unit declared
About this output
Challenge 1 only: the 13 target dots of the hidden circuit to match, time in the time unit and voltage.
- Time constant while charging
-
Unit s
About this output
The time constant while charging, R1 times C (R1 in parallel with R2 times C while the load is on), in seconds.
- Time to 90% while charging (text)
-
No unit declared
About this output
The 90% time written with an SI prefix and four significant figures.
- Time to 90% while charging
-
Unit s
About this output
The time to cover 90% of the way to the charging final value: the time constant times ln 10, about 2.3 time constants, in seconds.
- Model Status
-
No unit declared
About this output
OK, a CHECK note on the step-by-step method, or NOT VALID with the input to fix.
- Current unit
-
No unit declared
About this output
The unit of the scope's current columns: A, mA or microamperes, from the largest current shown.
- Current axis lower bound
-
No unit declared
About this output
The lower end of the scope's current axis, in the current unit.
- Current axis upper bound
-
No unit declared
About this output
The upper end of the scope's current axis, in the current unit.
- Energy unit
-
No unit declared
About this output
The unit of the segment table's energy columns: J, mJ, microjoules or nJ.
- Step size used
-
Unit time constants
About this output
The step size of the step-by-step methods used, in time constants.
- Step chart lower bound
-
Unit V
About this output
The lower end of the step-by-step chart's axis, in volts; a growing explicit answer is clipped to it.
- Step chart upper bound
-
Unit V
About this output
The upper end of the step-by-step chart's axis, in volts.
- Challenge feedback
-
No unit declared
About this output
A hint while the challenge is not met, the reason it works once it is, or the prompt to predict first.
- Starting capacitor voltage used
-
Unit V
About this output
The starting capacitor voltage used, in volts.
- Capacitor C used
-
Unit F
About this output
The capacitor C used, in farads.
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks you to do.
- Challenge result
-
No unit declared
About this output
No challenge selected, MET or NOT MET.
- Challenge score
-
No unit declared
About this output
100 when the challenge is met, else 0.
- Challenge: the value scored
-
No unit declared
About this output
The value the challenge scores, shown once it can no longer give the answer away: the time constant's gap from the target or the prediction's gap from the 90% time (percent), the droop (percent) or the ripple (volts).
- Step-by-step methods against the exact curve for the first segment
-
No unit declared
About this output
For the first stretch, 41 steps: time in time constants, the exact voltage, the explicit and implicit step-by-step answers, and the explicit answer clipped to the chart.
- Share of the battery energy turned to heat in R1
-
Unit %
About this output
The heat in R1 as a percentage of the battery's energy; blank when the battery delivers no energy.
- Heat in R2 (text)
-
No unit declared
About this output
The heat in R2 written with an SI prefix and four significant figures.
- Heat in R2
-
Unit J
About this output
The energy turned into heat in R2 over the window, in joules (0 while the load is off).
- Implicit step factor
-
No unit declared
About this output
The factor 1/(1 + r) that the implicit (backward Euler) method multiplies the remaining gap by at each step.
- Load resistor R2 used
-
No unit declared
About this output
Whether the load resistor R2 was used: Off or On.
- Ripple over the last cycle
-
Unit V
About this output
With at least three evenly spaced flips: how far the voltage swings over the last full cycle, in volts.
- Average over the last cycle
-
Unit V
About this output
With at least three evenly spaced flips: the average voltage over the last full cycle, in volts.
- Explicit step factor
-
No unit declared
About this output
The factor 1 - r that the explicit (forward Euler) method multiplies the remaining gap by at each step.
- Largest explicit step error
-
Unit %
About this output
The largest gap between the explicit method and the exact curve over the 40 steps, as a percentage of the starting gap.
- Step chart time axis end
-
Unit time constants
About this output
The end of the step-by-step chart's axis, in time constants (40 steps).
- Final voltage while charging
-
Unit V
About this output
The voltage the capacitor heads for while charging: the battery voltage, or the divider voltage E R2/(R1 + R2) with the load on, in volts.
- Heat in R1 (text)
-
No unit declared
About this output
The heat in R1 written with an SI prefix and four significant figures.
- Heat in R1
-
Unit J
About this output
The energy turned into heat in R1 over the window, in joules.
- Capacitor voltage at the end
-
Unit V
About this output
The capacitor voltage at the end of the scope window, in volts.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab charges and discharges a capacitor C through a resistor R1. A battery E, a two-way switch S, R1 in series, C to ground, and an optional load resistor R2 across C behind its own on/off switch S2 make up a fixed circuit. The switch starts at its Charge contact (to the battery) or its Rest contact, and flips at up to eight times you place on the scope's time axis. The Rest contact connects either to ground or to nothing (open). Every stretch between two flips is a first-order circuit with an exact solution, so the whole run is computed in closed form.
The model returns the scope at 241 samples (the capacitor voltage, the capacitor, R1 and R2 currents, the switch position and the charge level), a table of the stretches between flips, the charging and rest time constants, the time to cover 90% of the way while charging, the final and end voltages, the droop during the first rest, the ripple and average of a regular square wave, the energy the battery delivers, the heat in R1 and R2 and the change in stored energy from exact integrals, and a comparison of the exact curve with the explicit and implicit step-by-step methods. Five challenges are scored by the model.
It is a lab for learning how a time constant shapes charging, discharging and smoothing: why only the product R1·C sets how fast a capacitor charges, why the curve covers the same share of the remaining way in every time constant, how a load or an open contact changes how a charged capacitor holds its voltage, and why a step-by-step method that takes too long a step swings or grows. It is not a tool for designing power supplies, timing circuits or filters. Real resistors and capacitors have tolerances, leakage and ratings that the lab does not model.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the flow dots in each branch, the switch blade, the capacitor's fill, the scope curves and their axes, the switching markers, the target dots, the stretch table and the step-by-step chart. The page computes no voltage, current, time constant or energy itself.
Inputs and units
Voltages are in volts (V), resistances in ohms (Ω), capacitance in farads (F) and times in seconds (s). The scope's time axis and the current columns come back in a display unit the model chooses (µs, ms or s; A, mA or µA), and the stretch table's energies in J, mJ, µJ or nJ. A switching time is a sample number: the scope window is 10 divisions long and holds 241 samples, numbered 0 to 240.
| Input | Meaning and unit |
|---|---|
| Battery voltage E | -24 to 24 V (default 10): the battery's voltage, positive or negative. |
| Starting capacitor voltage | -24 to 24 V (default 0): the capacitor's voltage at time 0. |
| Resistor R1 | 10 to 1,000,000 Ω (default 10,000): the series resistor. |
| Capacitor C | 1×10⁻⁹ to 0.001 F, that is 1 nF to 1,000 µF (default 0.0001, 100 µF). |
| Load resistor R2 | Off (default) or On: whether R2 is connected across the capacitor. |
| Load resistance R2 | 10 to 1,000,000 Ω (default 100,000). Used only while the load is On. |
| Switch position at the start | Charge (default) or Rest: where the switch blade is at time 0. |
| Rest contact connects to | Ground (default) or Open. Ground lets the capacitor discharge through R1; Open leaves only R2 to drain it. Used only while the rest position is used: the switch starts at Rest, or flips at least once. |
| Switching time 1 to 8 | Blank (default) or a whole sample number from 1 to 239: the samples where the switch flips, in increasing order and filled from the first. Each flip moves the blade to the other contact. |
| Time per division | One of the scope's 20 settings on the 1-2-5 sequence from 1 µs to 2 s (default 0.5 s). The window is 10 divisions. |
| Step size of the step-by-step method | 0.1, 0.5, 1, 1.5, 2, 2.5 or 3 time constants (default 0.5): the step h as a share of the first stretch's time constant. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Your prediction: the 90% time | Blank, or 0 to 5 s: your answer for challenge 2. Blank means not yet predicted; 0 is a real prediction. |
| Your prediction: the heat in R1 | Not yet chosen (the start), Less heat with a small R1, Less heat with a large R1, or The same: half of the battery's energy: your answer for challenge 5. |
Where each input is set:
- On the canvas only: every input of the circuit. Dragging a value badge sets the battery voltage (in 0.5 V steps), the capacitor's starting voltage (its second badge, in 0.1 V steps), R1, C and R2 (through the standard E24 values, with the drawn part growing with its value). A value can also be typed in the badge's popover; a typed resistance or capacitance is put on the nearest E24 value. Tapping the blade flips the start position, tapping the Rest contact switches it between ground and open, and tapping S2 connects or removes R2. Tapping the scope's time axis adds a switching time at the nearest sample; a marker can be dragged along the axis, or dragged off it to remove it. Dragging the time axis sideways, or its + and - buttons, sets the time per division. The step size is a row of chips (0.1τ to 3τ) on the step-by-step chart. The 90% prediction is a dashed line on the time axis, shown only in challenge 2, and the heat prediction is a row of chips shown only in challenge 5.
- In the input panel: the challenge picker only.
The load switch, R2 and the Rest contact choice appear from the Experiment level; the step-by-step chart and its chips at the Advanced level. A level changes only what the page shows, never a calculation.
Governing relationships
One stretch is a first-order circuit. Between two flips the circuit seen from the capacitor is a source behind one resistance (its Thevenin equivalent), with resistance R_th and open-circuit voltage v∞. The capacitor voltage moves exponentially from its start value toward v∞:
v(t) = v∞ + (v_s - v∞)·e^(-(t - t_s)/τ), with τ = R_th·C,
where t_s is the stretch's start time and v_s its start voltage. Each stretch starts exactly where the one before it ended.
The four kinds of stretch. With R_p = R1·R2/(R1 + R2), the two resistors in parallel:
- Charge (the blade on the battery): R_th = R1, or R_p with the load on; v∞ = E, or the divider voltage E·R2/(R1 + R2) with the load on.
- Rest: ground: R_th = R1, or R_p with the load on; v∞ = 0.
- Rest: open with the load on: R_th = R2; v∞ = 0.
- Hold (rest open with the load off): nothing can carry current, so the capacitor keeps its voltage.
The time base. The window is T = 10 × the time per division, and sample n (0 to 240) sits at t_n = n·T/240. A switching time is a sample number, so every stretch begins and ends on a sample.
The currents. The capacitor current is i_C = C·dv/dt = (v∞ - v)/R_th, written in closed form rather than as a difference. The R1 current is (E - v)/R1 while charging, -v/R1 at a grounded rest, and 0 otherwise; the R2 current is v/R2 while the load is on. Kirchhoff's current law holds at every sample: i_C = i_R1 - i_R2. The charge level drawn in the capacitor is v divided by the voltage scale V = the largest of |E|, |v0| and 1 V.
The time constants and the 90% time. The charging time constant is R1·C (R_p·C with the load on). The rest time constant is R1·C or R_p·C at a grounded rest and R2·C at an open rest with the load on. After one time constant a stretch has covered 1 - e^(-1), about 63.2%, of the way to its final value, and each further time constant closes the same share of what is left. The time to cover 90% of the way is
t90 = τ·ln 10, about 2.3 time constants.
Energies, as exact integrals. For each stretch of length D, with u = D/τ and x = v_s - v∞, the model integrates the closed-form voltage and currents exactly:
- the battery's energy, ∫E·i_R1 dt over the Charge stretches;
- the heat in R1, ∫i_R1²·R1 dt, by its direct integral;
- the heat in R2, ∫v²/R2 dt while the load is on;
- the change in stored energy, ½·C·(v_end² - v_s²).
The integrals use 1 - e^(-u) and 1 - e^(-2u). When u is below 0.001 the model uses the four-term series u - u²/2 + u³/6 - u⁴/24 instead, which keeps a very short stretch from losing digits. Over every stretch the battery's energy equals the stored change plus the heat in R1 and R2.
The step-by-step methods. For the first stretch, with r the step size in time constants and x its starting gap, the model writes 41 steps (j = 0 to 40) as closed powers rather than a running sum:
- exact: v∞ + x·e^(-j·r);
- explicit (forward Euler): v∞ + x·(1 - r)^j;
- implicit (backward Euler): v∞ + x/(1 + r)^j.
Each explicit step multiplies the remaining gap by 1 - r and each implicit step by 1/(1 + r). The explicit answer swings past the final value once r passes 1 and grows once r passes 2; at r = 2 it keeps its size. The implicit answer always settles. For the chart the explicit column is also clipped to a band two starting gaps beyond the curve's range, so a growing answer stays on the chart.
The droop during a rest. For the first Rest stretch that follows a Charge stretch, the droop is 100·(v_s - v_end)/v_s percent of the voltage the rest begins with.
A regular square wave. When there are at least three flips and every gap between them is the same, the switching is regular. The last full cycle is the last two stretches. Each stretch moves one way only, so its extremes sit at its ends, and the ripple is the largest minus the smallest of those end values, exact rather than read from samples. The average is the integral of v over the two stretches divided by their length.
The share of the battery's energy that heats R1 is 100 × the heat in R1 over the battery's energy.
Scope advice. With dt = T/240 the sample spacing and τ_min the shortest time constant of the run, the model advises a shorter time per division when τ_min is below 2·dt (the curve looks like a jump) and a longer one when τ_min is above 50·T (the curve hardly moves).
Display units and text. The time unit is µs below 0.0001 s per division, ms below 0.1 s per division, and s otherwise. The current unit is A, mA or µA, chosen by the largest current over all 241 samples. The energy unit of the stretch table is chosen from ½·C·V². The time constants, the 90% time and the four energies are written with an SI prefix and four significant figures, with a true minus sign for a negative value.
Guards. Every exponent is taken as no smaller than -700, so a stretch more than 700 time constants long gives a tiny normal number rather than an underflow.
Calculation sequence
- Check the inputs that apply, in the order of the list under Errors and warnings.
- In a challenge, replace the inputs the challenge fixes with its own values; your free inputs and predictions keep the values you entered.
- Build the window and the sample times, and split the run into up to nine stretches at the switching times. The blade alternates between the two contacts from its start position.
- For each stretch, set its kind, R_th, τ and v∞, take its start voltage from the end of the stretch before, and compute its end voltage and its exact energy integrals.
- Compute the voltage, the three currents and the charge level at each of the 241 samples; at a stretch's first sample the voltage is its start value exactly.
- Read the time constants, the 90% time, the final and end voltages, the droop, the ripple and average, the energy totals and the heat share; choose the display units, write the text values and set the plot bounds and the scope advice.
- Write the step-by-step table for the first stretch and, in challenge 1, the target dots.
- Set the status and, in a challenge, score it and hold back what the challenge withholds.
Outputs and interpretation
- Time constant while charging, time constant at rest and time to 90% while charging: as above, in seconds. The rest time constant is blank when the rest position is not used or is a hold.
- Final voltage while charging (the v∞ of a charge) and capacitor voltage at the end of the window, in volts.
- Voltage when the rest begins and voltage lost during the rest: for the first rest after a charge, its start voltage (V) and the droop over the whole rest (%). Blank when there is no such rest.
- Ripple over the last cycle and average over the last cycle: with at least three evenly spaced flips, the swing and the mean voltage over the last full cycle, in volts.
- Energy from the battery, heat in R1, heat in R2, change in stored energy: totals over the window, written with an SI prefix and four figures. The stored change is negative when the capacitor loses energy.
- Share of the battery energy turned to heat in R1: a percentage.
- Explicit step factor (1 - r), implicit step factor (1/(1 + r)) and largest explicit step error: the largest gap between the explicit answer and the exact curve over the 40 steps, as a percentage of the starting gap.
- Scope advice: a tip when the time constant is too short or too long for the time per division; otherwise nothing.
- Settings used: the battery voltage, starting voltage, R1, C, load, R2, start position, rest contact, switching times, time per division and step size in effect (a challenge may fix them). An input that does not apply is left blank.
- The scope trace: 241 rows, each with the time in the time unit, the capacitor voltage, the capacitor, R1 and R2 currents in the current unit, the switch position (1 at Charge) and the charge level.
- The stretch table: one row per stretch, with its start time, the switch position (Charge, Rest: ground, Rest: open or Hold), its time constant, final value, start and end voltages, and the battery energy and the heat in R1 and R2 in the energy unit.
- The step-by-step table: the 41 steps above, with the clipped explicit answer drawn on the chart.
Reading the canvas: the circuit shows flow dots in R1, C and R2 from the returned currents, the blade on its contact and the capacitor filling with its charge level, all at the play head's sample. The scope draws the capacitor voltage (left axis) and the capacitor current (right axis, dashed) against time, with the switching markers on the time axis and the final value as a dotted line; the player steps through the 241 samples. The Experiment level adds the load, the rest contact choice, the energies and the stretch table; the Advanced level adds the step-by-step chart, with the exact curve, the explicit answer and the implicit answer (dashed), and the settings used.
What to take from the lab: only the product R1·C sets how fast the capacitor charges, so many pairs of values give the same curve; every time constant closes about 63% of the remaining way, so 90% takes about 2.3 time constants whatever the battery voltage; with nothing to discharge through, a capacitor keeps its charge, and a large load only lets it leak slowly; a time constant long against the switching time smooths a square wave, but too long a one keeps the average from reaching the middle in time; and the explicit step-by-step method swings once its step passes one time constant and grows once it passes two, while the implicit method always settles.
Challenges
Each challenge fixes its own circuit and switching and leaves only some inputs to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. Every challenge is met by gestures on the canvas.
- Match the time constant. Change R1 and C until your charging curve follows the target dots of a hidden circuit. Met when your charging time constant is within 2% of the target's. The value scored is the gap from the target, in percent.
- Predict the 90% time. The capacitor charges from 0 V toward 10 V. Drag the line on the time axis to when it gets 90% of the way there. Met when your prediction is within 5% of the 90% time. The value scored is your prediction's gap from it, in percent.
- Hold the charge. The capacitor charges from a 12 V battery for 1 s, then the switch moves to rest for 2 s. Using the rest contact and the load, keep at least 9 V on it and lose no more than 5% of that during the rest. Met when the voltage at the start of the rest is at least 9 V and the droop is at most 5%. The value scored is the droop.
- Smooth the square wave. A 5 V battery is switched every 10 ms. Choose R1 and C so the voltage swings by no more than 1.25 V over the last full cycle while its average stays within 0.25 V of 2.5 V. Met when both hold. The value scored is the ripple.
- Where does the energy go? The battery charges an empty 1 µF capacitor through R1. Predict how much of the battery's energy ends up as heat in R1, then try other values of R1. Met when your prediction is the right one of the three.
Challenges 2 and 5 hold back the answer until you predict. In challenge 2, while the prediction is blank, the scope shows only its axes, the time-0 sample and the 10 V final value; the time constants, the 90% time, the end voltage, the rest, ripple and energy results, the step-by-step table, the current unit and the stretch table's time constant, end voltage and energy columns are blank, and the challenge reads NOT MET with the prompt to predict first. In challenge 5, while the prediction reads Not yet chosen, the four energies, the heat share and the stretch table's energy columns are blank; the trace and the time constants stay. Once you predict, every result appears and the challenge is scored, MET or not.
Challenges 1, 3 and 4 hold back the result that names the answer while they are not met: challenge 1 the time constants, the 90% time and the stretch table's time constant column (the target dots are the tool); challenge 3 the droop; challenge 4 the ripple, the average and the stretch table's start and end voltages. The scope trace stays, so you can see the effect of every change. The value scored stays blank until challenge 1, 3 or 4 is met, or until you predict in challenge 2; challenge 5 scores your choice and shows no value.
Validation and status logic
The status reads the first match in the list under Errors and warnings. An input is checked only when it applies: R2 only while the load is On, the rest contact only while the rest position is used, the 90% prediction only in challenge 2 and the heat prediction only in challenge 5. An input that does not apply is not read; the model uses its default. In a challenge, the inputs it fixes take its own values and are always valid; your free inputs are checked on the values you entered. Values and list choices are checked exactly as entered: a list choice must match one listed text exactly, and the time per division and the step size must be exactly one of their listed values. The CHECK applies only when the first stretch is not a hold; every challenge uses a step of 0.5 time constants, so it never appears inside a challenge.
Assumptions and limitations
- A fixed circuit: one battery, one two-way switch, R1, C and an optional load R2. The parts are ideal: no tolerance, leakage or rating limit.
- At most eight flips, so at most nine stretches. The scope samples 241 points over 10 divisions; switching happens on samples, so a flip time is a whole multiple of 1/240 of the window.
- Values are exact at the samples; the curve between samples is drawn as straight segments. The ripple and average of a regular wave are exact, not read from samples.
- The step-by-step methods are shown for the first stretch only, over 40 steps, and do not affect the exact curve.
- Times and energies are written to four significant figures; a value that rounds to 1000 stays in its prefix ("1000 ms").
- The current unit is chosen over all 241 samples.
- A computed value within about 1×10⁻⁹ (relative) of a threshold, such as a unit or prefix change, an advice limit or a challenge band, may fall either side of it.
Restrictions and non-computing states
Under NOT VALID every result, every row of the scope trace and of the two tables, and every setting used is blank, except the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and not-met hint of a selected challenge.
Some results are blank by construction, as described under Outputs: the droop also when the rest begins at 0 V, the heat share when no stretch charges or the battery delivers no energy, the largest explicit step error when the first stretch starts at its final value, and the step-by-step table when the first stretch is a hold.
In a challenge, the results described under Challenges are held back until the challenge allows them.
Errors and warnings
The status messages, first match wins:
- NOT VALID: the battery voltage must be a number no larger than 24 V in size, positive or negative
- NOT VALID: the starting capacitor voltage must be a number no larger than 24 V in size, positive or negative
- NOT VALID: resistor R1 must be a number from 10 Ω to 1 MΩ
- NOT VALID: the capacitor must be a number from 1 nF to 1,000 µF
- NOT VALID: choose whether the load resistor R2 is on or off from the list
- NOT VALID: resistor R2 must be a number from 10 Ω to 1 MΩ: checked only while the load is On.
- NOT VALID: choose where the switch starts from the list
- NOT VALID: choose what the switch's rest contact connects to from the list: checked only while the rest position is used.
- NOT VALID: each switching time must be a whole sample number from 1 to 239
- NOT VALID: the switching times must be in increasing order with no gaps; fill them from the first one on
- NOT VALID: the time per division must be one of the scope's settings, from 1 µs to 2 s
- NOT VALID: the step size of the step-by-step method must be 0.1, 0.5, 1, 1.5, 2, 2.5 or 3 time constants
- NOT VALID: the challenge number must be a whole number from 0 to 5
- NOT VALID: the 90% time prediction must be blank or a number from 0 to 5 s: challenge 2 only.
- NOT VALID: choose your energy prediction from the list: challenge 5 only.
- CHECK: the step-by-step method's step is longer than twice the time constant, so its answer swings and grows; the exact curve is not affected: the step size is above 2 time constants and the first stretch is not a hold. Every result is still computed.
- OK
The scope advice is a separate tip, not a status: The time constant is shorter than two samples, so the curve looks like a jump; choose a shorter time per division. or The time constant is more than 50 times the window, so the curve hardly moves; choose a longer time per division.
References
This laboratory is an educational model of an ideal capacitor charged and discharged through a resistor R1, with an optional load resistor R2, as a two-way switch flips at up to eight times. Between two switchings the circuit seen from the capacitor is a source behind one resistance (its Thevenin equivalent), so the capacitor voltage follows an exact exponential toward its final value with time constant RC, each stretch starting where the one before it ended. The currents follow from the same curve, and the energy from the battery, the heat in each resistor and the change in stored energy are exact integrals over each stretch. The lab also compares the exact curve with the explicit and implicit Euler step-by-step methods: the explicit method swings past the final value once the step passes one time constant and grows once it passes two, while the implicit method always settles.
Sources and further reading
- The source-free and step responses of an RC circuit: C. K. Alexander and M. N. O. Sadiku, Fundamentals of Electric Circuits, 7th edition, 2026 release, McGraw Hill, chapter 7, First-Order Circuits. McGraw Hill
- Charging and discharging a capacitor through a resistor, and the time constant RC, at an introductory level: S. J. Ling, J. Sanny and W. Moebs, University Physics Volume 2, OpenStax, 2016, section 10.5, RC Circuits. OpenStax
- The series of preferred values that the resistor and capacitor value badges step through: IEC 60063:2015, Preferred number series for resistors and capacitors, edition 3.0, IEC, 2015. IEC Webstore
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; real resistors and capacitors have tolerances, leakage and ratings that it does not model, and it is not a tool for designing power supplies, timing circuits or filters.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.