Photoelectric Effect

No preview image

1 collaborator

Default-person Omar Ibrahim (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 7.0.4 • Viewed 249 times • Downloaded 4 times • Run 0 times
Download the 'Photoelectric Effect' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model simulates the photoelectric effect: electrons are ejected from a metal surface when light shines on it. It shows why light must behave as discrete packets (photons) rather than a continuous wave, the insight that won Einstein the 1921 Nobel Prize.

The classical wave theory of light predicted that brighter light should always eject electrons, and that dimmer light would just take longer. Experiments showed the opposite: only the color (frequency) of the light matters, not the brightness. This model lets you explore that result hands-on.

HOW IT WORKS

Each tick the light source on the left releases INTENSITY photons. Every photon carries energy equal to its FREQUENCY (shown by its color). When a photon reaches the metal cathode it is compared with the metal's WORK-FUNCTION (the energy needed to free an electron):

  • If photon energy >= work function, one electron escapes with kinetic energy KE = hf - phi and travels toward the anode. If it has enough energy to overcome the potential difference VOLTAGE, it reaches the collector and registers as current.
  • If photon energy < work function, the photon is absorbed and no electron escapes, no matter how bright the light is.

Electron speed scales with the square root of kinetic energy, so faster electrons visibly outrun slower ones. The voltage creates a uniform electric field between the cathode and anode that drains kinetic energy as electrons cross the gap. Electrons that lose all their kinetic energy before reaching the anode stall out and are recaptured.

HOW TO USE IT

Click SETUP to build the vacuum tube, then GO to fire the beam.

FREQUENCY controls the energy and color of each photon. Low values produce red light; high values produce violet.

INTENSITY controls how many photons are released per tick. This is the brightness of the light source.

WORK-FUNCTION sets the metal's electron-binding threshold. Photons with energy below this value will never eject electrons.

VOLTAGE applies a potential between the cathode and anode. Increasing the voltage makes it harder for electrons to reach the collector, even if they have been ejected.

The monitors show the smoothed luminance (photons in flight), smoothed current (electrons reaching the anode per tick), and total counts of ejected and collected electrons.

THINGS TO NOTICE

Raising INTENSITY increases the number of photons and therefore the number of ejected electrons, but it does not change how much energy each electron carries. The current grows, but the speed of each electron stays the same.

Raising FREQUENCY increases the energy each photon delivers. Above the threshold, electrons come out faster and with more kinetic energy. Below the threshold, nothing happens at all regardless of intensity.

When VOLTAGE is nonzero, compare TOTAL-EJECTED to TOTAL-COLLECTED. The gap between them shows how many electrons were turned back by the field.

At a certain voltage the current drops to zero. This is the stopping voltage, and it depends only on FREQUENCY and WORK-FUNCTION, never on INTENSITY. That independence is one of the key experimental signatures of the photoelectric effect.

THINGS TO TRY

Set FREQUENCY just below WORK-FUNCTION and raise INTENSITY to maximum. Notice that no current flows. Then nudge FREQUENCY above the threshold: current appears instantly, even at low intensity. That sharp cutoff is the signature of the photoelectric effect.

Find the stopping voltage for a given frequency. Set VOLTAGE to zero, pick a frequency above the work function, and let current flow. Now slowly increase VOLTAGE until the current drops to zero. Record that stopping voltage. Repeat for a higher frequency. You should find a linear relationship between frequency and stopping voltage.

Try setting FREQUENCY very high and INTENSITY to 1. Even a single photon per tick can eject electrons. Then set FREQUENCY very low and INTENSITY to 10. No electrons appear. This is the result that classical wave theory could not explain.

EXTENDING THE MODEL

Add a second metal with a different work function so students can compare threshold frequencies side by side.

Replace the single voltage with a variable potential that the user can sweep automatically, producing a current-vs-voltage curve in a plot. The x-intercept of that curve is the stopping voltage.

Add a temperature parameter that gives electrons in the metal a small random thermal energy, blurring the sharp threshold slightly, as happens in real experiments.

Introduce a quantum efficiency parameter so that not every photon above threshold ejects an electron, reflecting the probabilistic nature of the interaction in real metals.

NETLOGO FEATURES

The model uses hatch to create an electron from a photon at the moment of absorption, which naturally transfers context (position, heading) from the parent photon to the child electron before overriding the relevant properties.

Photon color is computed from a piecewise-linear interpolation across six RGB stops, producing a smooth visible-light spectrum without relying on NetLogo's built-in color space.

Electron speed is derived from kinetic energy using a square-root scaling, clamped to a visible range so that both fast and slow electrons remain legible on screen.

RELATED MODELS

  • Diffusion on a Directed Network (network-based quantity flow)
  • Virus on a Network (agent-based dynamics on a graph)
  • Wave Machine (mechanical wave behavior on a lattice)

CREDITS AND REFERENCES

Einstein, A. (1905). "On a Heuristic Point of View Concerning the Production and Transformation of Light." Annalen der Physik, 17(6), 132-148.

Millikan, R. A. (1916). "A Direct Photoelectric Determination of Planck's 'h'." Physical Review, 7(3), 355-388.

For background on the photoelectric effect, see HyperPhysics: http://hyperphysics.phy-astr.gsu.edu/hbase/mod2.html

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;; Demonstrates Einstein's photoelectric equation:  KE_max = hf - φ

breed [ photons photon ]
breed [ electrons electron ]

photons-own  [ energy ]       ;; energy this photon carries (= h·f)
electrons-own [ ke ]          ;; kinetic energy of an ejected electron

globals [
  lamp-x            ;; x of the light source (far left)
  metal-x           ;; x of the metal cathode (far right)
  collector-x       ;; x of the collector / anode (left of cathode)
  plate-gap         ;; distance between cathode and anode (for field calc)
  current           ;; electrons reaching the anode this tick
  total-ejected     ;; running count of electrons freed from the metal
  total-collected   ;; running count of electrons reaching the anode
  lum-avg           ;; smoothed luminance  (photons in flight)
  cur-avg           ;; smoothed photoelectric current
]

to setup
  clear-all
  set lamp-x      min-pxcor + 1
  set collector-x min-pxcor + 8       ;; anode – left side of the tube
  set metal-x     max-pxcor - 3       ;; cathode – right side of the tube
  set plate-gap   metal-x - collector-x
  paint-chamber
  set current 0
  set total-ejected 0
  set total-collected 0
  set lum-avg 0
  set cur-avg 0
  reset-ticks
end 

to paint-chamber
  ask patches [ set pcolor black ]
  recolor-lamp
  ask patches with [ pxcor >= metal-x ]     [ set pcolor gray ]
  ask patches with [ pxcor = collector-x ]   [ set pcolor 36  ]
  label-part lamp-x      "light"
  label-part collector-x "anode"
  label-part metal-x     "cathode"
end 

to label-part [ x txt ]
  ask patch x max-pycor [ set plabel txt  set plabel-color white ]
end 

to go
  set current 0
  recolor-lamp
  emit-photons
  move-photons
  move-electrons
  update-averages
  tick
end 

;; Emission rate is controlled purely by the intensity slider (0–10 scale),
;; independent of world geometry.

to emit-photons
  let whole floor intensity
  let frac  intensity - whole
  let n     whole + ifelse-value (random-float 1 < frac) [1] [0]
  create-photons n [
    setxy (lamp-x + 1) random-ycor
    set heading 90
    set energy frequency
    set color frequency-to-color frequency
    set shape "circle"
    set size 0.6
  ]
end 

to move-photons
  ask photons [
    fd 1
    if pxcor >= metal-x [ hit-plate ]
  ]
end 

;; Einstein's condition: an electron escapes only if hf ≥ phi.
;; Surplus energy becomes kinetic energy. The photon is absorbed either way.
;; Intensity plays no role here: that's the whole point of the model.

to hit-plate  ;; breed photon
  if energy >= work-function [
    let surplus energy - work-function
    hatch-electrons 1 [
      set ke      surplus
      set heading 270 + (random 41 - 20)     ;; recoil leftward with spread
      set xcor    metal-x - 1                ;; step off the metal surface
      set color   cyan
      set size    0.8
    ]
    set total-ejected total-ejected + 1
  ]
  die
end 

;; The voltage slider creates a uniform electric field between anode and
;; cathode that opposes the electron's motion. Each patch of travel costs
;; the electron  (voltage / plate-gap)  units of kinetic energy.
;; If KE drops to zero the electron stalls and is recaptured, it never
;; reaches the anode. This demonstrates stopping voltage.
;;
;; Speed scales with sqrt(KE) so faster electrons visibly outrun slower ones.

to move-electrons
  ask electrons [
    ;; speed: sqrt scaling, clamped to [0.3, 1.5] patches/tick for visibility
    let spd clamp 0.3 1.5 (0.5 * sqrt (max list ke 0))

    fd spd

    ;; energy lost to the retarding field this step
    let energy-cost (voltage / plate-gap) * spd
    set ke ke - energy-cost

    ;; stalled, recaptured by cathode
    if ke <= 0 and voltage > 0 [
      die
    ]

    ;; reached the anode
    if pxcor <= collector-x [
      set current         current + 1
      set total-collected  total-collected + 1
      die
    ]

    ;; wandered off-world (angular spread) — clean up
    if not can-move? 1 [ die ]
  ]
end 

to-report clamp [ lo hi val ]
  report max (list lo (min (list hi val)))
end 

to recolor-lamp
  ask patches with [ pxcor <= lamp-x ] [
    set pcolor frequency-to-color frequency
  ]
end 

to update-averages
  let alpha 0.1
  set lum-avg lum-avg + alpha * (count photons - lum-avg)
  set cur-avg cur-avg + alpha * (current   - cur-avg)
end 

;; Map frequency (1–12) to an approximate visible-light colour [r g b]:
;;   low frequency → red … high frequency → violet

to-report frequency-to-color [ f ]
  let stops (list [224 20 20] [255 140 0] [235 235 0]
                  [40 200 40] [40 110 255] [150 40 230])
  let frac ((f - 1) / 11) * (length stops - 1)
  let i   min (list (floor frac) (length stops - 2))
  let lo  item i stops
  let hi  item (i + 1) stops
  let t   frac - i
  report (map [ [a b] -> a + t * (b - a) ] lo hi)
end 

There are 2 versions of this model.

Uploaded by When Description Download
Omar Ibrahim 25 days ago Changes Download this version
Omar Ibrahim 25 days ago Initial upload Download this version

Attached files

File Type Description Last updated
127f07f1-0e4e-40dd-938f-df895c0943c1-Chladni_Figures (1).nlogox background eee 24 days ago, by Omar Ibrahim Download

This model does not have any ancestors.

This model does not have any descendants.