Measure Real Power and Returned Energy in an RC Load

Build a resistor–capacitor (RC) load and measure the power crossing its two-terminal boundary. During part of each cycle, the capacitor can release enough stored energy to make that boundary power negative. Over a complete cycle, the resistor still dissipates positive average power. Two grounded scope channels and a known current shunt let you observe both statements in the same low-voltage circuit.

The experiment starts with a jumper bypassing the capacitor, then inserts the capacitor and finally restores the bypass. Keep the resistor, shunt, frequency, probes and scope settings fixed. Compare instantaneous power, average real power, apparent power and energy entering or leaving the defined load.

Before connecting any input or output cables, connect the RIGOL DHO804’s rear Ground Terminal to earth ground using the supplied ground cable, as required by the DHO800 User Guide. Its Type-C power input does not ground the instrument through the power cord. Use the supplied power adapter and keep the AFG1022’s protective earth connected. The G0 signal-return connections described below do not replace this separate chassis earth lead.

Define the load and its current direction

A load port is the pair of terminals through which a circuit receives electrical energy. Here the load contains a 1 kΩ resistor RL and a 100 nF capacitor C in series. A separate 1 kΩ resistor RS below the load is a current shunt, a known resistance whose voltage drop reveals current. Define positive current as entering the load from the source side.

Use the Tektronix AFG1022 generator’s channel 1 and a RIGOL DHO804 oscilloscope. The Bayonet Neill–Concelman (BNC) connector has a signal center and grounded outer shell. G0 is the common zero-volt reference joining the generator’s BNC shell, the shunt return and both scope probe ground springs. The BNC center is the signal conductor inside that grounded shell. Scope CH1 measures the source-side load terminal relative to G0. Scope CH2 measures the shunt’s upper terminal relative to G0.

vload(t) = CH1(t) − CH2(t)
i(t) = CH2(t) / RS
p(t) = vload(t) × i(t)

The two probe tips land on different nodes. Connect both probe returns only to G0. Keep the scope’s 1 MΩ inputs and the PVP2350 probes in 10× mode. The subtraction reconstructs voltage across the load without moving a grounded return onto either elevated terminal. RS lies outside the load boundary, so its own heating is excluded from the reported load power.

An AFG1022 feeds a 1-kilohm resistor, a 100-nanofarad capacitor and a separate 1-kilohm return shunt. Two scope tips measure the source and shunt nodes, with both returns at G0. Calculated resistor and RC power plots share one vertical scale and show negative RC boundary power.
The dashed boundary contains RL and C. J1 bypasses the capacitor when closed. Both probe returns connect to G0. The two plots use the same vertical scale and calculated 1 kHz, 4.00 Vpp actual source voltage. Power below zero represents energy leaving this load boundary. The drawing omits the DHO804 power adapter and separate chassis earth lead; connect them as described before adding any input or output cables. Full-size PNG · Editable SVG

Separate average power from apparent power

Instantaneous power p(t) is the simultaneous voltage-current product, measured in watts (W). Positive p means energy enters the load. Negative p means energy leaves it. The average of p over complete cycles is real power P. In the ideal series RC circuit, the capacitor’s stored energy returns to the same value after a cycle, leaving net average load power equal to resistor heating.

Root mean square (RMS) voltage is the square root of mean squared voltage. RMS current is defined the same way. Their product is apparent power S, measured in volt-amperes (VA). Power factor PF is the dimensionless ratio P/S. For these qualified sine waves, PF also equals the cosine of the phase angle between load voltage and current. Phase describes their relative position within a cycle, expressed here in degrees.

P = mean[vload(t) × i(t)]
S = Vload,rms × Irms
PF = P / S
PR = Irms² × RL

Also accumulate energy separately in each direction. Ein is the integral of positive p. Eout is the positive magnitude of the integral where p is negative. The net energy per period is Ein − Eout. Dividing by the period gives P. These boundary energies identify energy movement through the two terminals. Part of returned energy can be dissipated in the external shunt and source resistance. The measurement alone does not assign all returned energy to the generator’s internal circuitry.

Calculate the nominal result before measuring

For a 1 kHz sine, the 100 nF capacitor has reactance magnitude XC = 1/(2πfC) = 1591.55 Ω. Reactance describes the voltage-current relationship of an energy-storing element at a particular frequency. The series load impedance, its combined resistance and reactance, is 1000 − j1591.55 Ω, where j denotes a quarter-cycle rotation in the sinusoidal calculation. Current leads load voltage by about 57.86°.

PF = RL / √(RL² + XC²) = 0.5320
Irms = Vsource,rms / √((RL + RS)² + XC²)

The following predictions assume exactly 4.00 V peak-to-peak (Vpp) at scope CH1, after the generator’s source impedance. Its RMS value is 1.4142 V. The AFG1022 has a typical physical output resistance of 50 Ω. Its High Z setting adjusts the displayed amplitude convention. Use the actual CH1 waveform in the power calculation.

Calculated values for nominal components
QuantityC bypassedC inserted
RMS current0.7071 mA0.5533 mA
Real power0.5000 mW0.3061 mW
Apparent power0.5000 mVA0.5754 mVA
Power factor1.00000.5320
Energy entering per cycle500.000 nJ362.825 nJ
Energy returned per cycle056.688 nJ

For the RC case, about 15.6% of entering energy leaves again during the same cycle. Net energy is about 306.137 nJ per cycle. The capacitor’s tolerance changes these numbers. With nominal resistance and ±10% capacitance, power factor is approximately 0.492–0.569. Measure both actual resistors and keep their values in the calculation.

Build a low-voltage grounded fixture

Use two Vishay MRS25000C1001FCT00 resistors, the MRS25 1 kΩ ±1% part, and one Vishay MKT1820410015 capacitor. The exact capacitor is a nonpolar 100 nF ±10% polyester film part rated 100 V direct current (DC) and 63 V alternating current (AC), with 10 mm lead spacing. Its voltage ratings are well above this fixture’s approximately 2 V signal peaks. Each resistor’s calculated mean dissipation stays below about 0.6 mW over the accepted source and resistor limits, well below the MRS25’s documented 0.6 W rating at 70 °C under its mounting conditions.

The capacitor’s data sheet gives dissipation factor up to 0.008 at 1 kHz for this capacitance range under the manufacturer’s test conditions. A series-loss illustration gives Rloss ≈ 0.008 × 1591.55 = 12.73 Ω. Actual film and connection losses can add a little positive mean power. The checker therefore screens P/(Irms²RL) within 0.94–1.06. This broad balance check supports the intended circuit comparison.

  1. With the generator output off, measure RL and RS separately using a Fluke 87V MAX in resistance mode. Record stable unpowered values. The program accepts 980–1020 Ω for each.
  2. Connect generator center to RL, then C, then RS, then generator shell G0. Install a short removable J1 across C. Keep wiring short and keep all grounded returns on G0.
  3. Set generator CH1 to sine, 1.000 kHz, zero DC offset and High Z amplitude display. Start near 4 Vpp. With output enabled, adjust until actual scope CH1 is near 4.00 Vpp, within the program’s 3.8–4.2 Vpp screen. Preserve the resulting generator setting across the three acquisitions.
  4. Disable output before opening or closing J1. After each change, re-enable output and wait at least 100 ms for steady sine operation before capturing. Read the actual source amplitude again. The source impedance may make it change slightly when C is inserted.

Qualify the two-channel subtraction

Use two compensated PVP2350 probes in 10× mode. Set both scope channels to DC coupling, probe factor 10× and the same 20 MHz bandwidth limit. Begin around 1 V/div for CH1 and 500 mV/div for CH2, with zero vertical offset. Maintain these scales and settings throughout the three measurement captures.

Before the first capture, ground both tips at G0 and record the channel mean values. Use practical zero checks of ±3 mV for CH1 and ±2 mV for CH2. Correct the instrument setup or probe connection when either fails. Then place both tips on the source node, temporarily use about 2 Vpp actual source voltage and compare the channels. Require their measured sine amplitudes to agree within 1% and their relative phase within 0.5°. Repeat this control after the final restored capture. Preserve the actual settings and observations in the blank bench worksheet.

Return the source to the selected near-4 Vpp setting and move only the CH2 tip to the shunt node. Its expected RMS voltage is about 0.55–0.71 V, so it is a substantial measured signal. The two probes place approximately 10 MΩ and 10 pF each from their respective nodes to G0. At 1 kHz their loading is small relative to this 1 kΩ fixture. Residual gain, phase and DC-offset errors still affect subtraction and signed energy, especially near zero crossings. Keep the same probes and channels, retain the zero controls and report an unresolved result when these checks fail. Arbitrary spreadsheet offset correction would alter the measured power.

Save paired native samples from one acquisition

Use Normal acquisition with only CH1 and CH2 enabled. Set the horizontal memory depth explicitly to 10 kpts and begin around 1 ms/div. Trigger on the CH1 rising midpoint. Inspect the actual raw duration and sample interval. The program requires 6–18 complete rising-midpoint source periods, each 0.98–1.02 ms, and a maximum sample gap no larger than 0.5% of the measured period, about 5 μs. A roughly 10–12 ms native record with 10 kpts provides comfortable margin.

For each state, use the DHO804 Storage menu, Save tab, Choose, Save Wave, with Data Source Memory and file type CSV. Comma-separated values (CSV) store one row of text fields per sample. Preserve the original export. It includes the enabled channels from one simultaneous scope acquisition. Normalize a copy into exactly time_s,source_v,shunt_v, selecting its native time, CH1 and CH2 columns together.

Convert documented time units to seconds and voltage units to volts. With probe factor already applied in the exported volts, retain that scale once. Remove instrument heading rows, while preserving every retained native row, its order and the paired channel values. Keep the original time origin within ±1 s, or subtract one fixed recorded origin from all timestamps in that capture. Use one contiguous segment. The checker permits 1400–20000 rows and at most 1.8 MB per normalized file.

Capture resistive.csv with J1 closed, capacitive.csv with J1 open and restore.csv with J1 closed again. Make each acquisition separately. The program rejects identical parsed sample arrays, but the operator’s retained raw exports and settings establish acquisition provenance. Successful waveform checks qualify the entered records.

Integrate the signed waveform

The program finds rising crossings of the source midpoint and trims analysis to complete cycles from the first retained crossing to the last. It linearly interpolates both channels at those analysis boundaries. Original interior samples remain paired. RMS moments and the voltage-current product are integrated in time, so intervals with different duration receive the appropriate weight.

Between adjacent samples it models voltage and current as linear signals. Their product is quadratic, so the average product over an interval is (2v0i0 + v0i1 + v1i0 + 2v1i1)/6. It splits intervals wherever voltage or current crosses zero before accumulating positive and negative energy. This preserves the declared interpolation model around a sign change.

A separate unweighted least-squares sine fit checks each channel and reconstructed load voltage. Its RMS residual must stay below 2.5% of fitted peak amplitude. It also supplies the reported phase. The time-weighted energy and RMS calculations use the original sample intervals. Source DC component must be within ±10 mV and shunt DC component within ±5 mV.

For the RC capture, the screens require PF 0.47–0.60, load-voltage phase relative to current −65° through −50°, RMS current 0.45–0.67 mA and returned/entering energy 0.10–0.23. The bypassed captures require PF at least 0.985, phase within ±3°, RMS current 0.65–0.78 mA and returned/entering energy at most 0.005. All three must pass the I²R balance screen. The source amplitude may change by at most 2% across states. Restored RMS current and real power must return within 3% and 5% of their initial values.

Download the experiment archive for the program, tests, circuit, blank worksheet and three constructed example captures. Run with Python 3.10 or newer. Replace the example resistance values with your measured values for hardware data.

python3 rc_power.py resistive.csv capacitive.csv restore.csv --load-ohm 1000 --shunt-ohm 1000
python3 -m unittest -v test_rc_power.py
python3 rc_power.py synthetic/resistive.csv synthetic/capacitive.csv synthetic/restore.csv

Exit 0 qualifies all three entered captures. Exit 1 reports an unresolved waveform or physical screen. Exit 2 reports invalid input or command usage. All records are checked before results are printed. The synthetic example should give about 0.3061 mW real power and 0.5754 mVA apparent power for the RC load. Its energy values differ slightly from the continuous analytical table because the program integrates finite linear sample segments.

Full analyzer

"""Measure signed load-port power from grounded two-channel scope CSV files."""
import argparse
import csv
import hashlib
import math
from pathlib import Path

HEADER = ('time_s', 'source_v', 'shunt_v')
ROUNDING = 1e-9


class BadInput(ValueError):
    pass


class Unresolved(ValueError):
    pass


def bound(value, low, high, label):
    if not low - ROUNDING <= value <= high + ROUNDING:
        raise Unresolved(f'{label}: {value:.7g}, expected {low:g}–{high:g}')
    return value


def read_capture(path):
    try:
        if path.stat().st_size > 1800000:
            raise BadInput('capture exceeds 1800000 bytes')
        with path.open(encoding='utf-8-sig', newline='') as handle:
            reader = csv.reader(handle, strict=True)
            if tuple(next(reader, ())) != HEADER:
                raise BadInput('header must be time_s,source_v,shunt_v')
            rows = []
            for record in reader:
                if len(rows) >= 20000 or len(record) != 3:
                    raise BadInput('capture exceeds 20000 rows or has a wrong column count')
                row = tuple(float(value) for value in record)
                if not all(map(math.isfinite, row)):
                    raise BadInput('all samples must be finite')
                rows.append(row)
    except (OSError, UnicodeError, csv.Error, ValueError) as error:
        raise BadInput(str(error)) from error
    if len(rows) < 1400:
        raise BadInput('capture needs at least 1400 native rows')
    if any(b[0] <= a[0] for a, b in zip(rows, rows[1:])):
        raise BadInput('timestamps must increase strictly')
    if any(abs(t) > 1 or abs(v) > 3 or abs(s) > 1.5 for t, v, s in rows):
        raise Unresolved('timestamp or raw voltage exceeds fixture bounds')
    signature = hashlib.sha256(repr(rows).encode()).hexdigest()
    return rows, signature


def interpolate(a, b, instant):
    fraction = (instant - a[0]) / (b[0] - a[0])
    return (instant, *(a[k] + fraction * (b[k] - a[k]) for k in (1, 2)))


def full_cycles(rows):
    midpoint = (max(r[1] for r in rows) + min(r[1] for r in rows)) / 2
    edges = [interpolate(a, b, a[0] + (midpoint-a[1]) * (b[0]-a[0]) / (b[1]-a[1]))
             for a, b in zip(rows, rows[1:]) if a[1] < midpoint <= b[1]]
    if not 7 <= len(edges) <= 19:
        raise Unresolved('need 6–18 complete source cycles')
    periods = [b[0]-a[0] for a, b in zip(edges, edges[1:])]
    for period in periods:
        bound(period, .00098, .00102, 'source period (s)')
    frequency = (len(edges)-1) / (edges[-1][0]-edges[0][0])
    maximum_gap = max(b[0]-a[0] for a, b in zip(rows, rows[1:]))
    bound(maximum_gap * frequency, 0, .005, 'maximum sample gap / period')
    selected = [edges[0], *(r for r in rows if edges[0][0] < r[0] < edges[-1][0]), edges[-1]]
    return selected, frequency, len(periods)


def solve(matrix, values):
    augmented = [list(row) + [value] for row, value in zip(matrix, values)]
    for column in range(3):
        pivot = max(range(column, 3), key=lambda n: abs(augmented[n][column]))
        augmented[column], augmented[pivot] = augmented[pivot], augmented[column]
        if abs(augmented[column][column]) < 1e-12:
            raise Unresolved('sine fit is singular')
        divisor = augmented[column][column]
        augmented[column] = [v/divisor for v in augmented[column]]
        for row in range(3):
            if row != column:
                factor = augmented[row][column]
                augmented[row] = [a-factor*b for a, b in zip(augmented[row], augmented[column])]
    return tuple(row[-1] for row in augmented)


def sine_fit(times, values, frequency):
    basis = [(1, math.sin(2*math.pi*frequency*(t-times[0])),
              math.cos(2*math.pi*frequency*(t-times[0]))) for t in times]
    matrix = [[sum(row[a]*row[b] for row in basis) for b in range(3)] for a in range(3)]
    rhs = [sum(row[a]*v for row, v in zip(basis, values)) for a in range(3)]
    offset, sine, cosine = solve(matrix, rhs)
    amplitude = math.hypot(sine, cosine)
    if amplitude <= .02:
        raise Unresolved('sine amplitude is too small')
    residual = math.sqrt(sum((v-sum(a*b for a, b in zip(row, (offset, sine, cosine))))**2
                             for row, v in zip(basis, values)) / len(values)) / amplitude
    bound(residual, 0, .025, 'sine residual / peak')
    return offset, amplitude, math.atan2(cosine, sine)


def product_integral(v0, v1, i0, i1, dt):
    return dt * (2*v0*i0 + v0*i1 + v1*i0 + 2*v1*i1) / 6


def segment(v0, v1, i0, i1, dt):
    """Integrate two linear signals, splitting at each signal's zero."""
    cuts = {0.0, 1.0}
    for a, b in ((v0, v1), (i0, i1)):
        if a*b < 0:
            cuts.add(-a/(b-a))
    cuts = sorted(cuts)
    positive = negative = 0.0
    for left, right in zip(cuts, cuts[1:]):
        va, vb = (v0 + f*(v1-v0) for f in (left, right))
        ia, ib = (i0 + f*(i1-i0) for f in (left, right))
        energy = product_integral(va, vb, ia, ib, dt*(right-left))
        positive += max(energy, 0)
        negative += max(-energy, 0)
    return positive-negative, positive, negative


def analyze(rows, load_ohm, shunt_ohm, capacitive):
    rows, frequency, cycles = full_cycles(rows)
    times = [r[0] for r in rows]
    source = [r[1] for r in rows]
    shunt = [r[2] for r in rows]
    voltage = [v-s for v, s in zip(source, shunt)]
    source_fit = sine_fit(times, source, frequency)
    shunt_fit = sine_fit(times, shunt, frequency)
    load_fit = sine_fit(times, voltage, frequency)
    bound(source_fit[0], -.010, .010, 'source DC component (V)')
    bound(shunt_fit[0], -.005, .005, 'shunt DC component (V)')
    bound(2*source_fit[1], 3.8, 4.2, 'source sine amplitude (Vpp)')
    phase = math.degrees(math.atan2(math.sin(load_fit[2]-shunt_fit[2]),
                                  math.cos(load_fit[2]-shunt_fit[2])))
    current = [s/shunt_ohm for s in shunt]
    v2 = i2 = positive = negative = 0.0
    for index in range(len(rows)-1):
        dt = times[index+1]-times[index]
        va, vb = voltage[index:index+2]
        ia, ib = current[index:index+2]
        v2 += dt*(va*va+va*vb+vb*vb)/3
        i2 += dt*(ia*ia+ia*ib+ib*ib)/3
        _, ep, en = segment(va, vb, ia, ib, dt)
        positive += ep
        negative += en
    duration = times[-1]-times[0]
    vrms, irms = math.sqrt(v2/duration), math.sqrt(i2/duration)
    power = (positive-negative)/duration
    apparent = vrms*irms
    pf = power/apparent
    closure = power/(irms*irms*load_ohm)
    bound(closure, .94, 1.06, 'mean power / load resistor heating')
    returned_fraction = negative/positive
    if capacitive:
        bound(pf, .47, .60, 'capacitive power factor')
        bound(phase, -65, -50, 'load voltage minus current phase (deg)')
        bound(returned_fraction, .10, .23, 'returned / entering energy')
        bound(irms, .00045, .00067, 'capacitive RMS current (A)')
    else:
        bound(pf, .985, 1.001, 'resistive power factor')
        bound(phase, -3, 3, 'load voltage minus current phase (deg)')
        bound(returned_fraction, 0, .005, 'resistive returned / entering energy')
        bound(irms, .00065, .00078, 'resistive RMS current (A)')
    return dict(frequency=frequency, cycles=cycles, source_vpp=2*source_fit[1],
                vrms=vrms, irms=irms, power=power, apparent=apparent, pf=pf,
                phase=phase, entering_j=positive/cycles, returned_j=negative/cycles,
                closure=closure)


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('resistive', type=Path)
    parser.add_argument('capacitive', type=Path)
    parser.add_argument('restore', type=Path)
    parser.add_argument('--load-ohm', type=float, default=1000)
    parser.add_argument('--shunt-ohm', type=float, default=1000)
    args = parser.parse_args()
    if any(not math.isfinite(r) or not 980 <= r <= 1020 for r in (args.load_ohm, args.shunt_ohm)):
        parser.error('measured load and shunt resistances must be 980–1020 ohms')
    try:
        captures = [read_capture(path) for path in (args.resistive, args.capacitive, args.restore)]
        if len({signature for _, signature in captures}) != 3:
            raise BadInput('captures contain identical parsed sample arrays')
        results = [analyze(rows, args.load_ohm, args.shunt_ohm, index == 1)
                   for index, (rows, _) in enumerate(captures)]
        first, cap, final = results
        for metric, tolerance in (('source_vpp', .02), ('irms', .03), ('power', .05)):
            bound(abs(final[metric]/first[metric]-1), 0, tolerance, 'restore '+metric+' relative change')
        bound(cap['source_vpp']/first['source_vpp'], .98, 1.02, 'capacitive / initial source amplitude')
    except BadInput as error:
        parser.exit(2, f'INPUT: {error}\n')
    except Unresolved as error:
        parser.exit(1, f'UNRESOLVED: {error}\n')
    for name, result in zip(('resistive', 'capacitive', 'restore'), results):
        print(f"{name}: P={result['power']*1000:.4f} mW, S={result['apparent']*1000:.4f} mVA, "
              f"PF={result['pf']:.4f}, phase={result['phase']:.2f} deg, "
              f"I={result['irms']*1000:.4f} mA, "
              f"entering={result['entering_j']*1e9:.3f} nJ/cycle, "
              f"returned={result['returned_j']*1e9:.3f} nJ/cycle")
    print('PASS: the RC load returns part of its entering energy while its resistor dissipates positive mean power.')
    return 0


if __name__ == '__main__':
    raise SystemExit(main())

Exercise a known failure

In a copy of a synthetic resistive capture, reverse every shunt_v sign. The analyzer should return UNRESOLVED because the reconstructed port no longer satisfies positive resistor power balance. Replacing the capacitive capture with a fresh resistive trace should fail the RC screens. Altering only a returned-energy summary would leave the actual input waveform unchanged, so the analyzer always derives energy directly from the sample pairs.

The host tests use independent complex-impedance sine traces and known linear-segment integrals. They exercise power, signed energy, current reversal, absent capacitor, input offsets, missed samples, harmonics, duplicate data, malformed values, resistor entries and failed restoration. These are mathematical and command-line checks using constructed data. The bench worksheet remains empty for physical observations.

Challenge — scale the actual source voltage

If the measured source voltage becomes 2.00 Vpp while frequency and ideal components stay fixed, how do RC real power, returned energy per cycle and power factor change?

Answer. Voltage and current amplitudes each halve, so power and energy become one quarter of their former values. Real power becomes about 0.07653 mW and returned energy about 14.172 nJ per cycle. Power factor remains about 0.5320 because it is the ratio P/S. The analyzer’s near-4 Vpp fixture screen would require a separately reviewed procedure for this lower-amplitude experiment.

The series resistor–inductor–capacitor (RLC) experiment explores how resistance changes resonance and bandwidth. The AFG1022 amplitude-display experiment explains why a nominal 50 Ω source needs an explicit load convention. Those results help you keep source voltage and circuit boundaries clear while interpreting this power measurement.

Primary references