home

Plate Capacitor

Creator: Izaak Neutelings (original)

Parallel-plate capacitor filled with a dielectric. The free charge ±QC\pm Q_\text{C} on the plates drives the field E\vec E, which lines the molecular dipoles up with it. Alignment leaves uncompensated bound charge Qsurf\mp Q_\text{surf} on the two faces of the dielectric, pointing against the free charge, so the net field is weaker and the capacitance higher than in vacuum.


Plate Capacitor

Download

PNG PNG (HD) PDF SVG

Code

plate-capacitor.typ (123 lines)

#import "@preview/cetz:0.5.2": canvas, draw
#import draw: anchor, content, group, line, rect

#set page(width: auto, height: auto, margin: 8pt, fill: none)

#let height = 5
#let width = 4
#let plate-width = 0.5
#let diel-width = 0.16 * width
#let n-field-lines = 7
#let n-charges = 7

#let e-color = rgb("#e67300")
#let plus-color = rgb("#cc2200").transparentize(20%)
#let minus-color = rgb("#0044cc").transparentize(20%)

#let plate(x, is-anode: true) = {
  let color = if is-anode { plus-color } else { minus-color }
  let fill-base = if is-anode { rgb("#f29797") } else { rgb("#9fc2f6") }
  let sign = if is-anode { $+$ } else { $-$ }

  rect(
    (x, 0),
    (x + plate-width, height),
    stroke: (paint: color, thickness: .7pt),
    fill: gradient.linear(
      fill-base.lighten(50%),
      fill-base,
      angle: 90deg,
    ),
  )
  content(
    (x + plate-width / 2, height + 0.1),
    text(fill: color)[$sign Q_"C"$],
    anchor: "south",
  )
  for ii in range(n-charges) {
    let y = ii * height / n-charges + 0.325
    content((x + plate-width / 2, y), text(fill: color)[$sign$])
  }
}

#let dipole(x, y, ..style) = group({
  let plus-grad = gradient.linear(
    angle: 90deg,
    minus-color.lighten(30%),
    minus-color.darken(30%),
  )
  let minus-grad = gradient.linear(
    angle: 90deg,
    plus-color.lighten(30%),
    plus-color.darken(30%),
  )
  rect(
    x,
    ((x, "|-", y), 50%, y),
    fill: plus-grad,
    radius: (west: .5),
    name: "minus",
    ..style,
  )
  rect(
    y,
    ((x, "-|", y), 50%, x),
    fill: minus-grad,
    radius: (east: .5),
    name: "plus",
    ..style,
  )
  // cetz centers the text line box rather than the glyph, which leaves both symbols
  // sitting ~10% of the capsule height low; -0.07em measures out within 0.1% of center
  let symbol(sign) = text(baseline: -0.07em, sign)
  content("plus", symbol[+])
  content("minus", symbol[--])
})

#canvas({
  // Dielectric slab
  rect(
    (diel-width, -0.03 * height),
    (width - diel-width, 1.08 * height),
    stroke: e-color,
    fill: rgb("#e1d8cb"), // muted orange
  )
  content((width / 2, 1.15 * height), text(fill: e-color)[$arrow(E)$])
  content(
    (width * 0.8, 1.09 * height),
    text(fill: minus-color)[$+Q_"surf"$],
    anchor: "south",
  )
  content(
    (1.3 * diel-width, 1.09 * height),
    text(fill: plus-color)[$-Q_"surf"$],
    anchor: "south",
  )

  // Electric field lines
  for ii in range(n-field-lines) {
    let y = (ii + 0.42) * height / n-field-lines
    line(
      (-plate-width, y),
      (width + plate-width, y),
      stroke: (paint: e-color, thickness: 1.2pt),
      mark: (pos: 0.5, end: "stealth", fill: e-color),
    )
  }

  plate(width, is-anode: false) // Left plate (cathode)
  plate(-plate-width, is-anode: true) // Right plate (anode)

  // Dipoles
  for x in (0.3, 0.5, 0.7) {
    for ii in range(n-field-lines) {
      let y = (ii + 0.94) * height / n-field-lines
      dipole(
        (x * width - 0.3, y - 0.12),
        (x * width + 0.3, y + 0.12),
        stroke: 0.5pt,
      )
    }
  }
})