// Interactive Reference Guide

Circuit Fundamentals

Master voltage, current, resistance, and reactive components — with live calculators, waveform visualizers, and GNU Octave code you can run immediately.

01

Fundamental Quantities

Every electric circuit can be described by three core quantities: Voltage, Current, and Resistance. Understanding what they represent physically is the foundation of all circuit analysis.

QuantitySymbolUnitPhysical MeaningWater Analogy
Voltage (EMF) V Volt (V) Electric potential difference — the "push" that drives charge Water pressure in a pipe
Current I Ampere (A) Flow rate of electric charge (1 A = 1 Coulomb/second) Volume of water flowing per second
Resistance R Ohm (Ω) Opposition to current flow; converts electrical energy to heat Pipe narrowness or friction
Charge Q Coulomb (C) Fundamental quantity — Q = I × t Total volume of water
Capacitance C Farad (F) Ability to store charge; Q = C × V Tank that stores water
Inductance L Henry (H) Opposition to change in current; stores energy in a magnetic field Flywheel / water hammer
// Water Pipe Analogy — Interactive
Pressure (Voltage) 5.0 V
Pipe Width (1/R) 4.0 → R=2.5 Ω
Current Flow2.00 A
Resistance2.50 Ω
// GNU Octave — Basic Quantities
% ── Basic Electrical Quantities in GNU Octave ──────────────────
% Run in Octave:  octave --persist basics.m

% Define basic quantities
V = 12;         % Voltage in Volts
I = 2;          % Current in Amperes
R = V / I;     % Resistance in Ohms (= 6 Ω)
Q = I * 60;    % Charge in Coulombs over 60 seconds

printf("Voltage:     %.2f V\n", V);
printf("Current:     %.2f A\n", I);
printf("Resistance:  %.2f Ohm\n", R);
printf("Charge (60s):%.2f C\n", Q);

% Plot V-I characteristic of a 6 Ω resistor
V_range = linspace(0, 24, 100);
I_range = V_range / R;

figure(1); clf;
plot(V_range, I_range, 'g-', 'LineWidth', 2);
xlabel('Voltage (V)'); ylabel('Current (A)');
title('V-I Characteristic: 6Ω Resistor');
grid on;
02

Ohm's Law

Ohm's Law is the most fundamental relationship in circuit analysis. It states that the voltage across a resistor is directly proportional to the current flowing through it, with resistance as the constant of proportionality.

VoltageV = I × R
CurrentI = V / R
ResistanceR = V / I
Memory trick: Use the VIR triangle. Cover the quantity you want to find — the remaining two show the operation (side-by-side = multiply, stacked = divide).
INTERACTIVE — OHM'S LAW SOLVER

Enter any TWO values — the third is calculated automatically.

Voltage (V) 12.0 V
Current (A) 2.00 A
Resistance (Ω) 6.0 Ω

The slope of the V-I line is always 1/R. A steeper slope means lower resistance (more current for the same voltage).

// GNU Octave — Ohm's Law Visualization
% ── Ohm's Law — V-I curves for multiple resistors ────────────────
R_vals = [10, 50, 100, 470, 1000];   % Ohms
V = linspace(0, 12, 200);              % 0–12 V
colors = {'g','c','y','m','r'};

figure(1); clf; hold on;
for k = 1:length(R_vals)
  I = V / R_vals(k);
  plot(V, I * 1000, colors{k}, 'LineWidth', 2);  % mA
end
legend(arrayfun(@(r) sprintf('%d Ω',r), R_vals, 'UniformOutput',false));
xlabel('Voltage (V)'); ylabel('Current (mA)');
title("Ohm's Law: V-I Characteristics"); grid on;

% Quick solve: unknown resistance
V_meas = 9.3;   % measured voltage
I_meas = 0.019; % measured current (19 mA)
R_unknown = V_meas / I_meas;
printf("Unknown R = %.1f Ω  (nearest std: 470 Ω)\n", R_unknown);
03

Series & Parallel Circuits

Resistors (and other components) can be connected in series, parallel, or combinations of both. Each configuration has distinct properties for current and voltage distribution.

// Series Circuit
R_total = R₁ + R₂ + … + Rₙ
  • Same current through all components
  • Voltages add up to supply voltage
  • Total R always greater than any single R
  • One break opens the whole circuit
// Parallel Circuit
1/R_total = 1/R₁ + 1/R₂ + …
  • Same voltage across all branches
  • Currents add up to total current
  • Total R always less than smallest R
  • One break doesn't kill other branches

SERIES CIRCUIT

+ - R1 R2 R3 → I Same current I everywhere V = V_R1 + V_R2 + V_R3

PARALLEL CIRCUIT

+ - R1 R2 R3 Same V across each R I = I1+I2+I3
INTERACTIVE — RESISTANCE CALCULATOR
R1 (Ω) 100 Ω
R2 (Ω) 220 Ω
R3 (Ω) 470 Ω
Supply (V) 12 V
R1 (Ω) 100 Ω
R2 (Ω) 220 Ω
R3 (Ω) 470 Ω
Supply (V) 12 V

A voltage divider uses two resistors to produce a fraction of the supply voltage: V_out = V_in × R2 / (R1+R2)

Vin (V) 12 V
R1 (Ω) 10000 Ω
R2 (Ω) 5600 Ω
// GNU Octave — Series & Parallel Analysis
% ── Series and Parallel Resistor Analysis ────────────────────────
R = [100, 220, 470];   % Resistor values in Ohms
Vs = 12;              % Supply voltage

%% Series combination
R_series = sum(R);
I_series = Vs / R_series;
V_drops  = I_series * R;     % voltage across each

printf("=== SERIES ===\n");
printf("R_total = %.1f Ω\n", R_series);
printf("Current = %.4f A = %.2f mA\n", I_series, I_series*1000);
for k = 1:length(R)
  printf("  V_R%d = %.2f V\n", k, V_drops(k));
end

%% Parallel combination
R_parallel = 1 / sum(1 ./ R);
I_total    = Vs / R_parallel;
I_branches = Vs ./ R;        % current through each branch

printf("\n=== PARALLEL ===\n");
printf("R_total = %.2f Ω\n", R_parallel);
printf("I_total = %.4f A = %.2f mA\n", I_total, I_total*1000);
for k = 1:length(R)
  printf("  I_R%d = %.2f mA\n", k, I_branches(k)*1000);
end

%% Voltage Divider
R1 = 10000; R2 = 5600;
Vout = Vs * R2 / (R1 + R2);
printf("\nVoltage Divider: Vout = %.3f V (%.1f%%)\n", Vout, Vout/Vs*100);
04

Kirchhoff's Laws

Kirchhoff's laws generalize Ohm's Law for complex multi-loop, multi-source circuits. They derive from conservation of energy (KVL) and conservation of charge (KCL).

// KCL — Current Law
Σ I_in = Σ I_out

At any junction (node), the sum of currents entering equals the sum leaving. Charge cannot accumulate at a node.

Node equation: Choose a reference node (ground). Write KCL for every other node to get a system of equations.
// KVL — Voltage Law
Σ V = 0 (around any loop)

The sum of all voltage rises and drops around any closed loop equals zero. Energy is conserved over a complete loop.

Sign convention: Going through a resistor in the direction of current = voltage drop (negative). Going through a battery from − to + = voltage rise (positive).
INTERACTIVE — KCL NODE ANALYZER

Adjust currents I1, I2 into a node. KCL forces I3 = I1 + I2 out.

I1 in (mA) 80 mA
I2 in (mA) 50 mA
// GNU Octave — Kirchhoff's Laws (Matrix Method)
% ── KVL via Matrix (Mesh Analysis) ───────────────────────────────
%
%  Two-mesh circuit:
%
%  +Vs1─R1──A──R3──B──R2─+Vs2
%            |            |
%           GND          GND
%
%  Mesh 1: I1 through R1, R3
%  Mesh 2: I2 through R2, R3 (shared, opposite direction)
%
%  KVL Mesh 1: Vs1 = R1*I1 + R3*(I1-I2)
%  KVL Mesh 2: Vs2 = R2*I2 + R3*(I2-I1)

Vs1 = 12;  Vs2 = 6;
R1  = 100; R2  = 200; R3 = 150;

% Matrix form: [A]{I} = {b}
A = [R1+R3,    -R3;
     -R3,    R2+R3];
b = [Vs1; Vs2];

I_mesh = A \ b;   % Solve system of linear equations
I1 = I_mesh(1);
I2 = I_mesh(2);
I_R3 = I1 - I2;   % current through shared resistor

printf("Mesh 1 current: %.4f A = %.2f mA\n", I1, I1*1000);
printf("Mesh 2 current: %.4f A = %.2f mA\n", I2, I2*1000);
printf("Current in R3:  %.4f A = %.2f mA\n", I_R3, I_R3*1000);

% Verify KVL for mesh 1
KVL1 = Vs1 - R1*I1 - R3*I_R3;
printf("KVL check (should be ~0): %.6f\n", KVL1);
05

Capacitors & RC Circuits

A capacitor stores electric charge and energy in an electric field between two conductive plates separated by an insulating material (dielectric). It opposes sudden changes in voltage — exactly dual to a resistor opposing current.

Charge StoredQ = C × V
Capacitor Currenti(t) = C × dV/dt
Energy StoredE = ½ C V²
Time Constantτ = R × C

When a capacitor charges through a resistor (RC circuit), the voltage follows an exponential curve defined by the time constant τ = RC. After 5τ, the capacitor is considered fully charged (99.3%).

TimeCharging V_CDischarging V_C
t = 00 VV₀
t = τ63.2% of Vs36.8% of V₀
t = 2τ86.5%13.5%
t = 3τ95.0%5.0%
t = 5τ99.3% (≈ full)0.7% (≈ zero)
INTERACTIVE — RC CHARGE / DISCHARGE CURVE
Resistance R (kΩ) 10 kΩ
Capacitance C (µF) 10 µF
Supply Voltage (V) 12 V
Mode
τ = RC100 ms
At 1τ (63.2%)7.58 V
5τ (full)500 ms
// GNU Octave — RC Circuit Response
% ── RC Charging and Discharging Curves ───────────────────────────
R  = 10e3;    % 10 kΩ
C  = 10e-6;   % 10 µF
Vs = 12;      % Supply voltage
V0 = 0;      % initial capacitor voltage

tau = R * C;  % time constant in seconds
t   = linspace(0, 5*tau, 500);

% Charging equation: V_C(t) = Vs * (1 - e^(-t/τ))
V_charge    = Vs * (1 - exp(-t / tau));

% Discharging from Vs: V_C(t) = Vs * e^(-t/τ)
V_discharge = Vs * exp(-t / tau);

% Capacitor current during charging: i = (Vs/R) * e^(-t/τ)
I_charge = (Vs / R) * exp(-t / tau);

figure(1); clf;
subplot(2,1,1);
plot(t*1000, V_charge,    'g-', 'LineWidth',2); hold on;
plot(t*1000, V_discharge, 'r--','LineWidth',2);
xline(tau*1000, '--y');  % mark τ
xlabel('Time (ms)'); ylabel('Voltage (V)');
legend('Charging','Discharging','\tau'); grid on;
title(sprintf('RC Circuit  τ = %.1f ms', tau*1000));

subplot(2,1,2);
plot(t*1000, I_charge*1000, 'c-','LineWidth',2);
xlabel('Time (ms)'); ylabel('Current (mA)');
title('Charging Current'); grid on;
06

Inductors & RL Circuits

An inductor stores energy in a magnetic field. It opposes changes in current (dual to a capacitor opposing changes in voltage). A coil of wire is the simplest inductor — its inductance depends on turns, geometry, and core material.

Inductor VoltageV = L × dI/dt
Energy StoredE = ½ L I²
RL Time Constantτ = L / R
Key difference from RC: For an RL circuit, τ = L/R (not L×R). A larger resistance actually makes τ smaller — current ramps up faster because R provides a tighter constraint.
INTERACTIVE — RL CIRCUIT CURRENT RISE
Inductance L (mH) 100 mH
Resistance R (Ω) 50 Ω
Supply Voltage (V) 12 V
τ = L/R2.0 ms
I_final (Vs/R)240 mA
At 1τ (63.2%)152 mA
// GNU Octave — RL Circuit Response
% ── RL Circuit — Current Rise and Fall ───────────────────────────
L  = 100e-3;   % 100 mH
R  = 50;       % 50 Ω
Vs = 12;       % volts

tau   = L / R;           % time constant
I_inf = Vs / R;          % steady-state current
t     = linspace(0, 5*tau, 500);

% Current rise: I(t) = I_inf * (1 - e^(-t/τ))
I_rise = I_inf * (1 - exp(-t / tau));

% Voltage across inductor: V_L = Vs * e^(-t/τ)
V_L = Vs * exp(-t / tau);

% Voltage across resistor: V_R = Vs * (1 - e^(-t/τ))
V_R = Vs * (1 - exp(-t / tau));

figure(1); clf;
subplot(2,1,1);
plot(t*1000, I_rise*1000, 'g-', 'LineWidth',2);
xlabel('Time (ms)'); ylabel('Current (mA)');
title(sprintf('RL Circuit — τ = %.3f ms', tau*1000)); grid on;

subplot(2,1,2);
plot(t*1000, V_L, 'm-', 'LineWidth',2); hold on;
plot(t*1000, V_R, 'c--','LineWidth',2);
legend('V_L', 'V_R'); grid on;
xlabel('Time (ms)'); ylabel('Voltage (V)');
07

AC Signals & Impedance

Alternating Current (AC) oscillates sinusoidally in time. Instead of resistance, AC circuits use impedance Z (complex-valued), which combines resistance with reactance — the frequency-dependent opposition from capacitors and inductors.

AC Voltagev(t) = Vpk · sin(2πft + φ)
RMS Voltage (sine)Vrms = Vpk / √2
Capacitive ReactanceXc = 1 / (2πfC)
Inductive ReactanceXL = 2πfL
ElementImpedance ZBehaviour at low fBehaviour at high f
Resistor RR (real, constant)SameSame
Capacitor C1 / (j·2πfC)Open circuit (blocks DC)Short circuit
Inductor Lj·2πfLShort circuit (wire)Open circuit
INTERACTIVE — AC WAVEFORM + PHASE
Frequency (Hz) 3 Hz
Peak Voltage (V) 10 V
Phase Shift (°) +45°
Show 2nd Signal
Vrms7.07 V
Period T333 ms
ω (rad/s)18.8
INTERACTIVE — RC LOW-PASS FILTER (BODE PLOT)

An RC low-pass filter passes low frequencies and attenuates high ones. The cutoff frequency is f_c = 1/(2πRC) where gain = −3 dB.

R (kΩ) 10 kΩ
C (nF) 100 nF
Cutoff Freq159 Hz
At 10×fc (−20dB)-20 dB
// GNU Octave — AC Signal & Frequency Response
% ── AC Analysis & RC Low-Pass Filter ─────────────────────────────
%% Generate a sine wave
f    = 60;     Vpk = 170;   % 60 Hz mains, 170 Vpk (≈120 Vrms)
Vrms = Vpk / sqrt(2);
t    = linspace(0, 3/60, 1000);   % 3 cycles
v    = Vpk * sin(2*pi*f*t);

printf("60 Hz: Vpk=%.0fV  Vrms=%.1fV  T=%.2fms\n",Vpk,Vrms,1/f*1000);

%% RC Low-Pass Filter Bode Plot
R  = 10e3;  C = 100e-9;
fc = 1 / (2*pi*R*C);            % cutoff frequency
f_sweep = logspace(log10(10), log10(1e6), 500);

% Transfer function H(jω) = 1 / (1 + jωRC)
H = 1 ./ (1 + 1j*2*pi*f_sweep*R*C);
gain_dB = 20*log10(abs(H));
phase_deg = angle(H) * 180/pi;

figure(2); clf;
subplot(2,1,1);
semilogx(f_sweep, gain_dB, 'g-', 'LineWidth',2); hold on;
xline(fc,'--y'); yline(-3,'--r');
xlabel('Frequency (Hz)'); ylabel('Gain (dB)');
title(sprintf('RC Low-Pass  fc=%.0f Hz',fc)); grid on;

subplot(2,1,2);
semilogx(f_sweep, phase_deg, 'm-', 'LineWidth',2);
xlabel('Frequency (Hz)'); ylabel('Phase (°)');
title('Phase Response'); grid on;
08

Electrical Power

Power is the rate of energy transfer. In electrical circuits, power can be dissipated (resistors → heat), stored (capacitors, inductors), or delivered (to a load).

Instantaneous PowerP = V × I
Using Ohm's LawP = I²R = V²/R
AC Real PowerP = Vrms × Irms × cosφ
Energy (Joules)E = P × t
QuantitySymbolUnitDescription
Real PowerPWatt (W)Actual power dissipated/consumed (cosφ component)
Reactive PowerQVARPower stored and returned by L & C (sinφ component)
Apparent PowerSVAS = V × I = √(P² + Q²)
Power FactorPF0–1PF = P/S = cosφ. PF=1 is ideal (pure resistive)
INTERACTIVE — POWER CALCULATOR & DISSIPATION
Voltage (V) 12 V
Current (A) 2.00 A
Power Factor (AC) 1.00
Time (hours) 8.0 h
Real Power P24.0 W
Apparent Power S24.0 VA
Energy (Wh)192.0 Wh
Resistance R6.0 Ω
// GNU Octave — Power Analysis & Power Triangle
% ── Power in DC and AC Circuits ───────────────────────────────────

%% DC Power
V_dc = 12;  I_dc = 2;  R_dc = V_dc / I_dc;
P_dc = V_dc * I_dc;
printf("DC:  P = %.1f W  (= I²R = %.1f W = V²/R = %.1f W)\n", ...
       P_dc, I_dc^2*R_dc, V_dc^2/R_dc);

%% AC Power with power factor
Vrms = 120;  Irms = 5;  phi = 30;  % degrees lag
PF = cos(phi * pi/180);

P_real     = Vrms * Irms * PF;        % Real power (W)
Q_reactive = Vrms * Irms * sin(phi*pi/180); % Reactive (VAR)
S_apparent = Vrms * Irms;             % Apparent (VA)

printf("\n=== AC Power (120 Vrms, 5 A, φ=30°) ===\n");
printf("Power Factor:    PF = %.3f\n", PF);
printf("Real Power:      P  = %.1f W\n",  P_real);
printf("Reactive Power:  Q  = %.1f VAR\n",Q_reactive);
printf("Apparent Power:  S  = %.1f VA\n", S_apparent);
printf("Check: sqrt(P²+Q²) = %.1f VA\n", sqrt(P_real^2+Q_reactive^2));

%% Power in a resistor over time
R = 100;  I_sweep = linspace(0, 1, 200);  % 0 to 1 A
P_sweep = I_sweep.^2 * R;             % P = I²R

figure(1); clf;
plot(I_sweep*1000, P_sweep, 'g-', 'LineWidth', 2);
xlabel('Current (mA)'); ylabel('Power (W)');
title('P = I²R — Quadratic Relationship'); grid on;

Quick Reference — Common Component Values:
Resistors (E24): 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 Ω (×10ⁿ)
Capacitors: 100 pF, 1 nF, 10 nF, 100 nF (0.1 µF), 1 µF, 10 µF, 100 µF
Inductors: 1 µH – 10 mH common in RF; 100 mH – 10 H in power supplies