Electromagnetism

AC vs DC

Alternating current oscillates direction; direct current flows steadily — different uses, different physics

Direct current (DC) flows in one direction continuously — batteries, USB, electronics. Alternating current (AC) reverses periodically (60 Hz US, 50 Hz EU) — power grids, household outlets. Each has trade-offs — AC is easy to step up/down via transformers (essential for transmission); DC is what most modern electronics need internally. Modern grids use both — HVDC for long distance, AC for distribution.

  • DCConstant direction; sources include batteries, solar
  • ACReverses periodically; sinusoidal V(t) = V_peak·sin(ωt)
  • Frequency60 Hz (Americas, parts of Asia), 50 Hz (Europe, most of world)
  • RMS valuesV_RMS = V_peak/√2; standard outlet 120 V_RMS = 170 V peak
  • Power transmissionAC easier to step up; HVDC for long distance and undersea
  • Edison vs Westinghouse1880s "war of currents" — AC won (transformers)

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

AC vs DC at a glance

PropertyDCAC
DirectionConstantReverses periodically
V vs tV = V_constantV = V_peak·sin(ωt)
SourcesBatteries, solar, fuel cellsGenerators, power grid
Voltage transformationHard (DC-DC converter)Easy (transformer)
Long-distance transmissionHVDC (high voltage DC)HVAC
StorageEasy (batteries)Indirect (rectify, then store)
PowerP = VIP = V_RMS·I_RMS·cos(φ)
Inductors and capacitorsOpen/short at steady stateFrequency-dependent impedance

RMS, peak, and average

For sinusoidal AC: V(t) = V_peak·sin(ωt).

QuantityDefinitionRelation
Peak (V_max or V_p)Maximum value
Peak-to-peak (V_pp)From peak positive to peak negativeV_pp = 2·V_peak
RMSRoot-mean-square; equivalent DC for powerV_RMS = V_peak/√2 ≈ 0.707·V_peak
Average (rectified)Average of |V|V_avg = (2/π)·V_peak ≈ 0.637
Average (raw)Time-averaged0 for symmetric AC

Common AC values

SystemRMSPeakFrequency
US household120 V170 V60 Hz
EU household230 V325 V50 Hz
3-phase residential US240 V340 V60 Hz
Industrial 3-phase480 V (US)60 Hz
Transmission110 kV - 1.2 MV50/60 Hz

JavaScript — AC/DC calculations

// RMS conversions
function peakToRMS(V_peak) { return V_peak / Math.sqrt(2); }
function rmsToPeak(V_RMS) { return V_RMS * Math.sqrt(2); }

// 120V outlet
console.log(`120V RMS = ${rmsToPeak(120).toFixed(0)} V peak = ${(2 * rmsToPeak(120)).toFixed(0)} V_pp`);

// AC power for resistive load
function acPowerResistor(V_RMS, R) {
  return V_RMS * V_RMS / R;
}

// 120 V outlet on 100 W bulb (R = 144 Ω)
console.log(`120V on 144Ω: ${acPowerResistor(120, 144).toFixed(0)} W`);

// AC current at given V_RMS through R
function acCurrent(V_RMS, R) {
  return V_RMS / R;
}

// Power factor in AC
function realPower(V_RMS, I_RMS, powerFactor) {
  return V_RMS * I_RMS * powerFactor;
}

// Apparent power vs real
function apparentPower(V_RMS, I_RMS) { return V_RMS * I_RMS; }

// Bridge rectifier output voltage (after diodes drop)
function bridgeRectifierDC(V_AC_peak, diode_drop = 1.4) {
  // Two diodes in path → 1.4 V drop per cycle
  return V_AC_peak - diode_drop;  // approximate
}

console.log(`120V AC peak (170V): rectified = ${bridgeRectifierDC(170).toFixed(0)} V DC`);

// HVDC vs HVAC efficiency comparison
function transmissionEfficiency(P_load, V_line, R_line, X_line = 0) {
  // For DC: only R matters
  // For AC: X (reactance) matters too, plus skin effect, etc.
  const I = P_load / V_line;
  const lossDC = I * I * R_line;
  return {
    dcLoss: lossDC,
    dcEff: 1 - lossDC / P_load
  };
}

// 1 GW over 1000 km at 800 kV
console.log(transmissionEfficiency(1e9, 800e3, 50));
// HVDC excellent for long distance

// Inductor in DC vs AC
function inductorImpedance(L, frequency_Hz) {
  return 2 * Math.PI * frequency_Hz * L;  // Ω
}

console.log(`100mH at 0 Hz (DC): ${inductorImpedance(0.1, 0)} Ω`);     // 0 (short circuit)
console.log(`100mH at 60 Hz: ${inductorImpedance(0.1, 60).toFixed(2)} Ω`);  // 37.7
console.log(`100mH at 1 MHz: ${inductorImpedance(0.1, 1e6).toFixed(0)} Ω`); // 628,318

// Capacitor in DC vs AC
function capacitorImpedance(C, frequency_Hz) {
  if (frequency_Hz === 0) return Infinity;
  return 1 / (2 * Math.PI * frequency_Hz * C);
}

console.log(`1µF at 0 Hz: ${capacitorImpedance(1e-6, 0)} Ω`);  // ∞ (open)
console.log(`1µF at 60 Hz: ${capacitorImpedance(1e-6, 60).toFixed(0)} Ω`);
console.log(`1µF at 1 MHz: ${capacitorImpedance(1e-6, 1e6).toFixed(2)} Ω`);

Where each shines

  • AC dominates. Power transmission and distribution; large motors; appliances drawing AC directly.
  • DC dominates. Electronics (inside computers, phones), batteries, solar, EVs.
  • HVDC. Long-distance transmission (China, Europe interconnects), undersea cables, large solar farms.
  • Mixed. Most modern systems convert between AC and DC. Phone charger: AC in → AC step-down → rectified to DC.
  • Audio. Audio is AC (analog signals); digital audio is encoded data but speakers driven by analog AC.
  • Industrial 3-phase. Three-phase AC for motors, large heating elements, factory power.
  • EVs and renewables. Solar, batteries are DC; needs inverter to feed AC grid.

Common mistakes

  • Confusing RMS and peak. 120 V is RMS; peak is 170 V. Most equipment ratings are RMS.
  • Forgetting frequency dependence. Inductors and capacitors behave very differently at DC vs different AC frequencies.
  • Treating AC as just "rotating DC". AC waveform matters — sinusoidal vs square, harmonic content, power factor — all affect circuit behavior.
  • Mixing AC and DC analysis. Use phasors for AC analysis; vectors for DC. Different mathematical frameworks.
  • Ignoring polarity for DC, phase for AC. DC has +/-. AC has phase relationships between V and I (for reactive loads).
  • Using DC formulas for power factor < 1. Real power ≠ V_RMS·I_RMS for reactive AC loads. Power factor must be included.

Frequently asked questions

Why do power grids use AC instead of DC?

Transformers. AC easily steps up to high voltage for transmission (low I²R losses) and down for distribution and end use. DC requires more complex equipment (DC-DC converters) for voltage transformation. Edison initially advocated DC, but Tesla and Westinghouse won the "war of currents" because AC was more practical at the time.

What's RMS voltage?

Root-mean-square. For sinusoidal AC, V_RMS = V_peak/√2 ≈ 0.707·V_peak. RMS values give the equivalent DC value that produces same power dissipation in resistors. 120 V outlet is RMS — peak voltage is 170 V. P = V_RMS²/R for any waveform.

Why is the frequency 60 Hz in US, 50 Hz elsewhere?

Historical accident. Tesla initially considered various frequencies; 60 Hz selected for US standardization. Europe and most of world standardized on 50 Hz. Higher frequency = smaller transformers and motors but more reactive losses; trade-off was made early. Both work fine; cross-region equipment needs adaptation.

When is HVDC used instead of HVAC?

Long-distance transmission (&gt; 800 km), undersea cables, asynchronous grid interconnection. HVDC has lower losses for long distance (no skin effect, no reactive losses) but requires expensive converter stations at each end. Examples: 6500 km Pacific DC Intertie (US west coast), undersea cables to Norway/UK.

How is AC converted to DC?

Rectifier — diodes that pass current in one direction. Simple half-wave rectifier just blocks negative half — output is rough pulses. Bridge rectifier (4 diodes) flips negative half to positive — smoother. Capacitor smooths to nearly constant DC. Modern switch-mode supplies do this efficiently with high-frequency switching.

Is AC more dangerous than DC?

AC is generally more dangerous at the same voltage. Mainly because AC at 50-60 Hz happens to be optimal for triggering ventricular fibrillation (when heart fibers contract chaotically). DC tends to cause one strong contraction, which might throw you off the source — easier to recover from. Both are dangerous at high voltage.

What about three-phase AC?

Three sinusoidal voltages 120° out of phase. Used industrially because it provides constant total power (easier on motors), allows compact wiring (3 wires + neutral instead of 6 separate phases), and is naturally produced by generators. Most large motors are 3-phase.