Lab tutorials

Simulating RC and RL Circuit Transients

Learn how to simulate transient responses of RC and RL circuits using the ECExplain simulator. Observe charging, discharging, and current decay waveforms step by step.

Visual

InputsR, C / L valuesV sourceSwitchRC / RL CircuitSeries R-Cor R-L blocktau = RC or L/ROutputsV_C or I_Lwaveform plottau readout

Lab intro

RC and RL circuits do not respond to voltage or current changes instantaneously. When a step input is applied, the capacitor voltage or inductor current changes gradually according to an exponential curve. This tutorial walks you through simulating those transient responses in the ECExplain circuit simulator so you can observe the time constant, the final steady-state value, and how component values affect the shape of the waveform.

What you will learn

  • How to set up an RC circuit with a DC step input in the simulator
  • How to set up an RL circuit and observe current build-up through the inductor
  • What the time constant tau represents and how to read it from the waveform
  • How changing R, C, or L values shifts the transient curve
  • How to distinguish a charging curve from a discharging curve by shape

Prerequisites

  • Familiarity with Ohm's law and basic circuit elements
  • Understanding that a capacitor opposes sudden voltage change and an inductor opposes sudden current change
  • Basic knowledge of exponential functions

Step-by-step

  1. Step 1: Open the RC Transient lab
    Navigate to the Transients lab section and select 'RC Circuit'. The simulator canvas loads with a pre-placed resistor, capacitor, DC voltage source, and a switch. You will see a waveform panel on the right side of the screen.
    Tip: Do not modify the default wire connections at this stage. Confirm that the capacitor is in series with the resistor and the switch is open before starting.
  2. Step 2: Set component values
    Click the resistor on the canvas to open its property panel. Set R to 10 kOhm. Click the capacitor and set C to 10 uF. Set the DC source voltage to 5 V. These values give a time constant of 100 ms, which is easy to observe on the default time axis.
    Tip: The property panel accepts values with unit suffixes: type 10k for 10 kOhm and 10u for 10 uF. If you type a plain number without a suffix the simulator assumes base SI units, which may place the transient entirely off screen.
  3. Step 3: Close the switch and run
    Click the switch symbol on the canvas to close it. Press the green Run button at the top of the toolbar. The waveform panel will display V_C (capacitor voltage) on the y-axis and time on the x-axis. The curve should rise from 0 V toward 5 V.
    Tip: If the waveform panel remains blank, check that the output probe is placed across the capacitor terminals, not across the resistor.
  4. Step 4: Read the time constant from the waveform
    Hover your cursor over the waveform at the point where V_C equals approximately 3.16 V (63.2% of 5 V). The x-axis value at that point is the time constant tau. For R = 10 kOhm and C = 10 uF, tau should read 100 ms. Use the zoom controls to expand the x-axis if the point is hard to locate precisely.
    Tip: The simulator includes a crosshair tool in the toolbar. Click the crosshair icon, then click the waveform to read exact coordinates in the data panel below the plot.
  5. Step 5: Switch to the RL circuit
    Use the circuit selector dropdown at the top left to switch from 'RC Circuit' to 'RL Circuit'. The canvas updates to show a resistor and inductor in series with the DC source. Set R to 100 Ohm and L to 10 mH. The time constant tau = L/R = 0.1 ms. Click Run. The waveform now shows inductor current I_L rising from 0 toward V/R = 50 mA.
    Tip: RL time constants are often much smaller than RC time constants. If the waveform looks like a vertical line, reduce the x-axis range using the time scale slider below the plot.
  6. Step 6: Observe the discharge or decay curve
    For the RC circuit: open the switch after the capacitor has fully charged (after approximately 5 tau). The simulator will continue the simulation from the current state. V_C will now decay from 5 V back toward 0 V along an exponential decay curve. For the RL circuit: remove the source by setting V to 0 V and re-run. I_L will decay from its peak toward 0.
    Tip: Charging and discharging curves are mirror images only if the initial and final conditions are symmetric. If the capacitor starts at a non-zero voltage, the curve will shift vertically.
  7. Step 7: Vary component values and compare
    Increase R to 20 kOhm while keeping C at 10 uF. Re-run the RC simulation. Observe that the curve rises more slowly and tau doubles to 200 ms. Then restore R to 10 kOhm and increase C to 20 uF. Tau again doubles. Use the overlay mode (toggle the Overlay button in the toolbar) to display both waveforms on the same plot for direct comparison.
    Tip: Overlay mode adds a legend automatically. Each run is assigned a different color. If you run more than four overlays the oldest is removed.

Expected output

For the RC charging simulation with R = 10 kOhm and C = 10 uF and V_source = 5 V: the waveform is a smooth exponential curve starting at 0 V and asymptotically approaching 5 V. At t = 100 ms the curve crosses 3.16 V. At t = 500 ms (5 tau) the curve is within 1% of 5 V and appears flat. For the RL circuit with R = 100 Ohm and L = 10 mH: the current waveform rises from 0 and approaches 50 mA, crossing 31.6 mA at t = 0.1 ms.

Troubleshooting tips

  • Waveform is a flat horizontal line at 0 V: the switch is still open or the voltage source value was not saved. Click the source, verify the voltage field shows a non-zero value, then close the switch and re-run.
  • Waveform jumps instantly to the final value with no curve: the time axis range is too wide relative to tau. Reduce the simulation stop time in the simulation settings dialog so that the transient occupies at least 30% of the x-axis width.
  • Capacitor voltage exceeds the source voltage: the probe is placed across the resistor instead of the capacitor. V_R decays from V_source at t=0 toward 0, which can appear to spike if the axis autoscales on the initial value.
  • RL current shows oscillation: inductors in the simulator may default to an LC tank if a stray capacitance option is enabled. Open component settings for the inductor and set parasitic capacitance to 0.
  • Overlay mode shows identical curves despite changed R value: the component value was changed in the property panel but Run was not pressed again. Each overlay corresponds to a separate run, not a parameter sweep.