🦖 Bellaziraptor

Interactive Laboratories

Physics II: Electricity & Magnetism

One lab per unit, from charges to resonance

Fields you can probe, surfaces you can drag, circuits you can scope. Each lab pairs with a unit of the Physics II course.

Unit 1 lab

Fields of continuous charge

Chop a charged rod, ring or disk into pieces, watch each piece’s \(d\mathbf{E}\) add up at a probe, and compare with the exact formula.

SuperpositionRod, ring, disk
Unit 2 lab

Gauss’s law: flux through any surface

Drag charges and a Gaussian sphere or cube; the flux, integrated over the whole closed surface, always equals \(Q_{\text{enc}}/\varepsilon_0\).

Electric fluxSphere vs cube
Unit 3 lab

The potential landscape

Orbit a 3-D surface of \(V(x,y)\) beside its contour map and see \(\mathbf{E} = -\nabla V\) point downhill, across the equipotentials.

3-D surfaceE = −∇V
Unit 4 lab

Dielectrics & energy density

Slide a dielectric slab into a capacitor, connected or isolated, and follow charge, field, energy density and the pull on the slab.

DielectricsEnergy density
Unit 5 lab

RC circuit on an oscilloscope

Drive an RC circuit with a square or sine wave and read \(V_C\) and \(V_R\) off a scope — a low-pass and a high-pass filter in one.

OscilloscopeRC filter
Unit 6 lab

Charged particles in magnetic fields

Fire an electron, proton or alpha into \(\mathbf{B}\) (and \(\mathbf{E}\)) in 3-D: circles, helices, \(\mathbf{E}\times\mathbf{B}\) drift and a velocity selector.

Lorentz forceCyclotron motion
Unit 7 lab

Magnetic fields of currents

Wires, loops and solenoids with the field summed piece by piece (Biot–Savart), a probe, and an Ampère loop that checks \(\oint\mathbf{B}\cdot d\mathbf{l} = \mu_0 I_{\text{enc}}\).

Biot–SavartAmpère’s law
Unit 8 lab

Faraday’s law: generators & moving magnets

A magnet through a coil, a rotating-coil generator and a rod on rails, with flux and EMF plotted live and Lenz’s law shown.

Lenz’s lawAC generator
Unit 9 lab

Series RLC: resonance & phasors

Rotating phasors, time traces and a resonance curve with \(f_0\), the half-power band and the live operating point.

ResonancePhasors
All labs
Unit 1 · Electric Charge & Electric Fields

Fields of continuous charge

A charged rod, ring or disk is not a handful of point charges — its charge is smeared smoothly over it. The trick for finding its field is to chop it into \(n\) small pieces, treat each piece as a point charge \(dq\), and add the little fields \(d\vec E = k\,dq\,\hat r/r^2\) as vectors. That sum is exactly what the integral \(\vec E = \int k\,dq\,\hat r/r^2\) means: more and more, smaller and smaller pieces. Below, the computer does the chopping and adding, and on the symmetry axis you can check its answer against the exact formula from the lesson.

Shape
Show

 

Total charge Q +5.0 nC
Radius R 8.0 cm
Pieces n 12
Probe x 10.0 cm
Probe y 0.0 cm
|E| (sum of n pieces)—
(Ex, Ey)—
E direction—
|E| exact (on axis)—
Error of the sum—
λ = Q/L—

The probe snaps onto the dashed axis when you drag close to it. Directions are counter-clockwise from +x.

Things worth trying
  • Ring, probe on the axis, \(n = 1\): the whole ring is lumped into one point charge at the top and the sum is 80 % off. Now try \(n = 2\): exact! On the axis every piece is the same distance away and opposite pieces cancel each other’s sideways pull, so only the along-axis parts survive. Move the probe off the axis and watch the faint arrows stop pairing up.
  • Rod on its bisector, \(L = 16\) cm, probe at \(y = 8\) cm: the error is 41 % with one piece, about 1 % with two, 0.09 % with twelve. That shrinking error is the integral being approached.
  • Put the probe at the centre of the ring (x = 0, y = 0). Every faint arrow has a partner pointing the other way, and \(E = 0\). Now slide along the axis: \(|E|\) rises, peaks at \(x = R/\sqrt2\), then falls off like \(kQ/x^2\).
  • Rod on its bisector: drag the probe far away (\(y \gg L\)) and \(|E| \approx kQ/y^2\), a point charge. Make the rod long and come close (\(y \ll L\)) and \(|E| \approx 2k\lambda/y\), the infinite-line result.
  • Disk: bring the probe very close to the face on the axis. \(|E|\) barely changes as you move — it approaches \(\sigma/2\varepsilon_0\), the field of an infinite sheet.
  • Turn on tip-to-tail sum and press Build the sum: the small \(d\vec E\)’s are laid end to end, and the chain ends exactly at the tip of the bold \(\vec E\).

Theory for this lab: Unit 1 lesson · Continuous charge distributions →

Unit 2 · Gauss’s Law

Gauss’s law: flux through any surface

Electric flux \(\Phi_E = \oint \vec E\cdot d\vec A\) counts how much field pokes out of a closed surface, minus how much pokes in. Gauss’s law says the answer is always \(Q_{\text{enc}}/\varepsilon_0\): only the charge inside matters, whatever the surface’s shape or size, and charges outside add nothing. Here the computer really does the surface integral — it tiles the whole closed 3-D surface with tens of thousands of small patches and adds \(\vec E\cdot\hat n\,dA\) for each — so you can test the law yourself.

Gaussian surface
Charges

You are looking at a slice through the middle of a 3-D sphere or cube (green outline). Drag a charge, drag inside the surface to move it, or drag the green handle on its right edge to resize it. Arrows on the outline show E there: orange where field leaves (positive flux), blue where it enters. The map is 60 cm wide.

Charge q₁ +2.0 nC
Charge q₂ −1.0 nC
Charge q₃ +3.0 nC
Sphere radius 9.0 cm
Net flux ∮E·dA (numerical)—
Q enclosed—
Qenc/ε₀—
Difference—
Flux from q₁—
Flux from q₂—
Flux from q₃—

Flux is in N·m²/C. The charges and the surface centre all lie in the plane of the slice; the integral covers the full closed surface in 3-D.

Things worth trying
  • Drag the surface around q₁ without letting it cross any charge, then grow and shrink it. The net flux does not move — and switching sphere ↔ cube changes nothing either.
  • Drag q₃ (outside) right up against the surface. The arrows near it change a lot, but its own flux reading stays at zero: every field line it sends in on one side comes out on the other.
  • Shrink the surface until a charge pops outside. The net flux jumps by exactly that charge divided by \(\varepsilon_0\) — nothing in between.
  • Set the enclosed charges equal and opposite (+2 and −2). The net flux is zero even though plenty of field crosses the surface. Zero flux does not mean zero field.
  • Park a charge almost on the outline. The numerical sum gets unreliable there: a charge exactly on the surface is neither in nor out, and Gauss’s law is only stated for surfaces that avoid charges.

Theory for this lab: Unit 2 lesson · Electric flux & Gauss’s law →

Unit 3 · Electric Potential

The potential landscape

Draw the potential \(V(x, y)\) of some point charges as a height above the floor and you get a landscape: positive charges make peaks, negative charges make pits. The electric field is the downhill slope, \(\vec E = -\nabla V\): it points the way a ball would roll, its size is how steep the ground is, and it always crosses the contour lines (equipotentials) at right angles. Orbit the surface on the left; drag the probe on the contour map on the right.

Charges

Drag to orbit. Height is V (orange high, blue low), clipped near the charges where it shoots off to ±∞. The green arrow runs downhill along the surface: that is the direction of E.

Drag the probe. Orange contours are positive V, blue negative, dashed V = 0; the bold one passes through the probe. Grey arrows show E = −∇V. Axes in cm.

Charge q₁ +2.0 nC
Charge q₂ −2.0 nC
Contour spacing 100 V
Show
V at probe—
|E| = steepest slope—
E direction—
(Ex, Ey)—
dV/ds along E—
dV/ds along contour—

Slopes are measured numerically, comparing V a hundredth of a millimetre either side of the probe. Walking along E, V falls at exactly |E| volts per metre; walking along the contour it does not change at all.

Things worth trying
  • Single +: move the probe out from the charge. Double the distance and \(V\) halves but \(|E|\) drops to a quarter — the hill flattens faster than it gets lower.
  • Dipole: put the probe on the dashed \(V = 0\) line between the charges. \(V\) is zero, yet the ground there is steep and \(|E|\) is large. Zero potential does not mean zero field.
  • Two like: the midpoint is a saddle (a mountain pass). The ground is flat there, so \(\vec E = 0\), but \(V\) is far from zero.
  • Quadrupole: two peaks and two pits. The \(V = 0\) contours are two straight lines through the centre; orbit the 3-D view to see the surface cross the floor level along them.
  • Drag the probe along the bold contour. \(V\) stays put, the slope along the contour reads zero, and the field arrow keeps turning so that it stays perpendicular to the contour.

Theory for this lab: Unit 3 lesson · Equipotentials & E = −∇V →

Unit 4 · Capacitance & Dielectrics

Dielectrics & energy density

Slide an insulating slab into a parallel-plate capacitor. The part of the gap that holds the slab and the part that is still empty sit side by side between the same two plates, so they behave like two capacitors in parallel: \( C = \dfrac{\varepsilon_0 A}{d}\big[(1-f) + \kappa f\big] \), where \(f\) is the fraction of the plate area covered by the slab and \(\kappa\) (kappa) is its dielectric constant. Both parts feel the same voltage, so the field \(E = \Delta V/d\) is the same in both — but the slab part stores \(\kappa\) times more energy per cubic metre, \(u = \tfrac12\kappa\varepsilon_0E^2\). Drag the slab, or use the slider.

Slab

 

Slab inserted f 40%
Plate area A 100 cm²
Gap d 1.0 mm
Battery ΔV 12.0 V
Capacitance C—
Free charge Q—
ΔV—
E, empty part—
E, slab part—
Free σ, empty / slab—
Bound σ (slab faces)—
Total energy U—
Energy density u, empty—
Energy density u, slab—
Pull on slab—
Energy bookkeeping—

The green readout is the quantity held fixed. Plates are square (side \(\sqrt{A}\)); the gap is drawn on a stretched scale so 1 mm stays visible. Field-line spacing is inversely proportional to \(E\); charge marks get denser with surface charge density σ and merge into a solid bar once they would overlap. Fringe fields at the plate edges are ignored, except that they are what pulls the slab in.

Things worth trying
  • Isolated, paper slab: slide it from 0% to 100%. \(C\) rises 3.7×, so with \(Q\) stuck \(\Delta V\), \(E\) and \(U = Q^2/2C\) all drop — the lost energy is the work the field did pulling the slab in.
  • Connected, same move: now \(U = \tfrac12 C\,\Delta V^2\) rises. Read the bookkeeping line: the battery supplied exactly twice the increase in \(U\); the other half went into pulling the slab in. The slab is pulled in either way.
  • Look at the two \(E\) readouts. They always agree — the slab region does not have a weaker field here. What differs is the free charge: the plate piles up \(\kappa\) times more charge over the slab, and the slab’s bound charge cancels the extra.
  • Pick the high-κ ceramic at 50%. Almost all of the charge and energy now lives in the slab half: \(u\) there is 1200× larger. That is why ceramic capacitors pack microfarads into a few cubic millimetres.

Theory for this lab: Unit 4 lesson · Capacitance & dielectrics →

Unit 5 · Current, Resistance & DC Circuits

RC circuit on an oscilloscope

A function generator drives a resistor and capacitor in series, and a two-channel oscilloscope watches the input (CH1) and the capacitor voltage (CH2); the resistor voltage is their difference, \(V_R = V_{in} - V_C\). Everything is governed by the time constant \(\tau = RC\). Compare it with the period of the input: when the input changes slowly the capacitor keeps up, when it changes fast the capacitor cannot. The traces are the exact steady-state solution — what you see after the generator has been running for a while.

Waveform
Channels
CH1 Vin CH2 VC (low-pass output) VR (high-pass output)

Triggered on the rising edge (square) or upward zero crossing (sine) of CH1, at the small triangle one division in from the left, so the picture stands still. Time/div is picked automatically to show 2–5 periods; all channels share one V/div.

Frequency f 1.0 kHz
Amplitude 5.0 V
Resistance R 1.0 kΩ
Capacitance C 100 nF
Time constant τ = RC—
Cutoff fc = 1/2πRC—
Input f—
f · τ—
VC peak—
VR peak—
Phase—
Scope—
What the filter is doing—
Things worth trying
  • Square wave at \(f\tau = 0.01\) (slow input): \(V_C\) is a square wave with rounded corners and \(V_R\) is a row of sharp spikes — each one an exponential lasting a few \(\tau\). The resistor output is a differentiator.
  • Raise \(f\) until \(f\tau \approx 2\): \(V_C\) shrinks to a small triangle (the capacitor is an integrator) and \(V_R\) looks almost like the input. Low-pass blocks, high-pass passes.
  • Switch to sine and set \(f = f_c\) (that is \(f\tau = 1/2\pi \approx 0.16\)). \(V_C\) and \(V_R\) have equal amplitude \(V_{in}/\sqrt2\), lag and lead by 45°, and still add up to \(V_{in}\) at every instant.
  • Double \(R\) or double \(C\): the picture is identical either way, because only the product \(RC\) appears in the solution.

Theory for this lab: Unit 5 lesson · RC circuits →

Unit 6 · Magnetic Fields & Forces

Charged particles in magnetic fields

A magnetic field pushes a moving charge sideways: \(\vec F = q\vec v\times\vec B\). The push is always perpendicular to the velocity, so it bends the path without changing the speed. Moving straight across \(\vec B\) the particle circles with radius \(r = mv_\perp/|q|B\); with some velocity along \(\vec B\) as well it spirals in a helix. Add an electric field across \(\vec B\) and the circles slide sideways at the drift speed \(E/B\). Here \(\vec B\) points along \(+z\). Drag the view to orbit.

Particle
Presets
B (along +z) E velocity v force F path (+ charge) path (− charge)

 

View
E direction
Field B 10 mT
Speed v 1.0×10⁶ m/s
Angle v to B 90°
Field E off
Radius r = mv⊥/|q|B—
Period T = 2πm/|q|B—
Cyclotron f = 1/T—
Angular ω = |q|B/m—
Helix pitch v∥T—
Drift E/B—
Sense (seen from +z)—
Net force at start—

The path is the exact solution of \(m\,d\vec v/dt = q(\vec E + \vec v\times\vec B)\) (non-relativistic; the fastest setting is 3% of the speed of light). The picture is rescaled to fit, with equal scale on all three axes; the true size is in the readouts. The start velocity lies in the xz-plane. Alpha mass \(6.64\times10^{-27}\) kg.

Things worth trying
  • Swap electron for proton with nothing else changed. The proton circles the other way (clockwise seen from \(+z\)) and its radius and period are 1830× larger — same charge size, much more mass.
  • Change the speed and watch \(T\): it does not move. Faster particles go round bigger circles in exactly the same time — the fact a cyclotron is built on.
  • Tilt the angle to 60°. The motion along \(\vec B\) is untouched by the magnetic force, so the circle stretches into a helix with pitch \(v\cos\theta\cdot T\).
  • Press Velocity selector: \(\vec E\) is set to exactly \(vB\) along \(+y\) and the particle goes straight. Then nudge the speed slider — slower or faster particles curl away. Switching to an electron does not break the balance: both forces flip together.

Theory for this lab: Unit 6 lesson · Magnetic forces →

Unit 7 · Sources of Magnetic Field

Magnetic fields of currents

The Biot–Savart law says that every short piece of wire \(d\vec{\ell}\) carrying a current \(I\) adds a small field \(d\vec{B} = \dfrac{\mu_0}{4\pi}\dfrac{I\,d\vec{\ell}\times\hat{r}}{r^2}\), and the total field is the sum of all the pieces. This lab really does that sum: every wire is chopped into hundreds of short pieces and their fields are added at each point you see. You are looking at a flat slice through the wires: ⊙ is current coming out of the screen toward you, ⊗ is current going into it. The dashed Ampère loop checks the other big law of this unit, \(\oint \vec{B}\cdot d\vec{\ell} = \mu_0 I_{\text{enc}}\).

Current
Show
Loop shape

Drag the green probe (or tap empty space to drop it there); drag the dashed Ampère loop by its centre square or its edge. Straight wires are 10 m long; the loop and every solenoid turn are circles in planes perpendicular to the screen, cut by the slice at a ⊙ and a ⊗. The solenoid is 16 cm long. The view is 24 cm wide.

Current I 10.0 A
Ampère loop size 3.0 cm
|B| at probe (sum)—
B direction—
Formula—
Sum vs formula—
∮B·dl (sum)—
μ₀Ienc—
——
——

—

Things worth trying
  • With the long straight wire, drag the probe away from the wire: the summed field and \(\mu_0 I/2\pi r\) agree, and doubling \(r\) halves \(B\). The field circles the wire counter-clockwise for current out of the screen (right-hand rule).
  • Make the Ampère circle bigger or smaller, or drag it off-centre: \(\oint \vec{B}\cdot d\vec{\ell}\) does not change as long as the wire stays inside. Drag the wire out of the loop and it drops to zero.
  • Two parallel wires: currents in the same direction attract, opposite currents repel. Put the Ampère loop around both: with opposite currents \(I_{\text{enc}} = 0\) even though \(B\) on the path is not zero.
  • Circular loop: the probe starts at the centre, where the sum matches \(\mu_0 I/2R\). The loop’s field looks like a bar magnet’s. Ampère’s law still holds here, but the field is not symmetric, so it cannot be used to find \(B\).
  • Solenoid: inside, the lines are nearly straight and evenly spaced and \(B \approx \mu_0 n I\); outside it is weak. Slide the rectangle along the winding: \(\oint\) counts exactly the turns it encloses. Shrink \(R\) and the centre field gets closer to the ideal \(\mu_0 nI\).

Theory for this lab: Unit 7 lesson · Biot–Savart & Ampère’s law →

Unit 8 · Induction & Inductance

Faraday’s law: generators & moving magnets

A changing magnetic flux through a loop drives a current around it. Faraday’s law gives the size, \(\mathcal{E} = -\dfrac{d\Phi_B}{dt}\) for one turn (times \(N\) for a coil of \(N\) turns), and the minus sign is Lenz’s law: the induced current always flows the way that fights the change in flux. Three ways to change the flux are below: move a magnet, spin a coil, or slide a rod so the loop’s area grows.

Experiment
Controls

—

Last 5 s. Positive flux points along the coil’s chosen normal; positive emf drives current counter-clockwise as seen looking back along that normal. Notice the emf curve is the negative slope of the flux curve.

Magnet moment m 2.0 A·m²
Coil turns N 200
Auto-move rate 0.5 Hz
Magnet position—
Velocity—
Flux linkage NΦ—
emf—
Current (R = 10 Ω)—
Coil face toward magnet—
Things worth trying
  • Magnet & coil: drag the magnet in slowly, then quickly. Same flux change, but the fast push gives a bigger emf for a shorter time. Hold it still inside the coil: lots of flux, zero emf.
  • Watch the face of the coil nearest the magnet: it becomes the same pole as the approaching end (repelling it) and the opposite pole as the magnet leaves (pulling it back). That is Lenz’s law; press Flip magnet and every current reverses.
  • AC generator: the emf is largest when the flux is zero (coil edge-on to the flux, i.e. its plane parallel to B) and zero when the flux is largest. Doubling ω doubles both the frequency and the peak emf.
  • Sliding rod: compare the two power readouts. The work you do pushing the rod against the magnetic drag is exactly the heat in the resistor. Double v and the power goes up 4×.
  • Drag the rod back and forth by hand: the current flips each time the rod reverses, because growing and shrinking flux need opposite opposition.

Theory for this lab: Unit 8 lesson · Faraday’s & Lenz’s laws →

Unit 9 · AC Circuits & Electromagnetic Waves

Series RLC: resonance & phasors

A resistor, an inductor and a capacitor in series, driven by a sine-wave source \(v(t) = V_0 \sin \omega t\). The same current flows through all three, but the voltages are out of step: \(v_R\) is in phase with the current, \(v_L\) leads it by \(90^\circ\), \(v_C\) lags it by \(90^\circ\). Phasors turn this into geometry: rotating arrows whose vertical shadows are the instantaneous voltages. The impedance is \(Z = \sqrt{R^2 + (X_L - X_C)^2}\) with \(X_L = \omega L\) and \(X_C = 1/\omega C\), and the current peaks at resonance, \(f_0 = 1/(2\pi\sqrt{LC})\), where \(X_L = X_C\).

Phasors

Phasor rotation is slowed to one turn every 4 s whatever the real frequency. The vertical component of each arrow is that voltage right now; the cursor on the right marks the same instant. Dashed: \(\vec{V}_L + \vec{V}_C\) placed tip-to-tail on \(\vec{V}_R\), which adds up to the source phasor.

Plot
Resistance R 50.0 Ω
Inductance L 100 mH
Capacitance C 10.0 µF
Frequency f 100 Hz
Amplitude V₀ 10.0 V
XL = ωL—
XC = 1/ωC—
|Z|—
Phase φ—
Irms—
Pavg = Irms²R—
Power factor cos φ—
f₀ = 1/2π√LC—
Q = (1/R)√(L/C)—
Bandwidth R/2πL—
VR / VL / VC (rms)—

—

Things worth trying
  • Press Tune to f₀. \(\vec{V}_L\) and \(\vec{V}_C\) become equal and opposite and cancel, \(|Z| = R\), \(\phi = 0\), the power factor is 1 and the current is as large as it can be.
  • At resonance, raise L and lower C together (keeping f₀ near the same value) or shrink R: Q grows, the peak sharpens, and VL and VC can each be many times the source voltage. That is how a radio tuner picks one station.
  • Go below f₀: the circuit is capacitive (\(X_C > X_L\), \(\phi < 0\), current leads). Above f₀ it is inductive (\(\phi > 0\), current lags).
  • Set f to an edge of the shaded band: Irms is \(1/\sqrt{2}\) of its peak, the power is half of the peak power, and \(|\phi| = 45^\circ\).

Theory for this lab: Unit 9 lesson · Series RLC & resonance →