# NetLogo lightning: portfolio figure notes

These ten figures follow the project from its original patch model to a controlled test of field feedback. Figures 01 and 07 come from NetLogo Web's view renderer. The other eight figures use Matplotlib's default styling. Captions and interpretation are here.

**Attribution.** The original NetLogo lightning and terrain model is Derek Stone's work. The revised irregular-mesh model was developed with AI assistance. The figures and frozen-field comparison use the revised model unless explicitly marked original. Figure 07 comes from a run of the unmodified original rules. The analysis is a test of a simulation, not a comparison with natural lightning.

## 01 · Completed strike — `01-netlogo-strike.png`

**Caption:** A completed strike in the revised NetLogo model. The grid of dots displays electric potential, white links mark the channel, and the yellow dot marks contact with the terrain.

NetLogo painted the terrain as brown patches and the sky black. The channel follows connected bonds of an irregular triangular mesh. The starting segment at the cloud boundary is prescribed. The shown strike used a domain 240 by 150 model units, nominal mesh spacing 3, source at the midpoint, random seed 42, and growth exponent η = 3. The potential is normalized to −1 on the cloud boundary and channel and 0 on the ground. The display at contact retains the last field solved before contact; it does not simulate the return stroke.

## 02 · One branch decision — `02-branch-decision.png`

**Caption:** At step 37, the model picked a bond branching off an existing stretch of channel. Its probability was 0.552%, the 12th highest of 130 eligible bonds.

On the left, black links show the channel at step 36. Blue links show the exposed bonds that could be selected; their strokes grow thicker with the square root of probability so small weights remain visible. The orange link and dot identify the choice. The view is cropped, but the denominator includes **all 130 bonds**. On the right, the horizontal scale is probability and the vertical numbers are ranks; the chart shows the top five and the chosen bond in orange. The highest probability was 25.22%. The chosen source already had two channel neighbors, so adding the link formed a branch.

For a bond of length d with conductance g, the weight is g Δφ (Δφ/d)^(η−1), where Δφ is the potential rise from the occupied source toward the candidate end. Dividing each weight by their sum turns those weights into probabilities. A high weight increases the chance of selection; it does not guarantee the outcome.

## 03 · What that bond changes — `03-one-step-field-change.png`

**Caption:** Change in potential after the model adds the bond shown in Figure 02. Dots toward the yellow end of the scale show a larger decrease between steps 36 and 37.

The scale is φ_before − φ_after, in normalized potential units, at vertices that are free in both states. The orange bond ends at the vertex newly fixed to −1; that vertex dropped by 0.05528 and is marked separately from the free samples. Among vertices that remained free, the largest decrease was 0.02246. The brightest nearby dots show where the field solve responded most strongly to the changed boundary. The revised model then uses the new potential to weight its next set of possible growth bonds.

## 04 · Where the bond meets terrain — `04-terrain-crossing.png`

**Caption:** The last bond of the second archived NetLogo strike is clipped at the interpolated terrain surface. The solid black segment is the part the model adds; the dotted continuation and hollow endpoint show the unused portion.

The dashed gray line follows the top of NetLogo's terrain patches. The blue profile is the continuous piecewise-linear terrain used in the calculation. The orange marker lies on that profile at (132.8720, 113.2785), with y measured downward from the top. This bond travels 2.043 of its 5.643 model units before intersection, so the solver uses about 36.2% of the original length as the air segment. The endpoint may appear on the other side of a displayed patch boundary because the visual patches and numerical surface are two representations of the same terrain.

## 05 · Available growth directions — `05-mesh-directions.png`

**Caption:** Left: a four-neighbor square grid. Right: the six actual neighbors of one interior vertex of the revised mesh. Both panels use the same length scale.

The dotted gray circle marks three model units. Blue spokes show the edges from the orange center. The square-grid stencil only offers cardinal moves; the revised mesh offers oblique moves with different angles and lengths. The square stencil represents an intermediate revision. This local example does not establish directional neutrality across the revised mesh.

## 06 · Distribution of strike contacts — `06-strike-contacts.png`

**Caption:** Ground contacts from 4,096 simulated strikes on one terrain. The histogram shows how often a strike landed in each five-unit interval. Orange dots on the terrain mark distinct contact locations, including rare ones.

All 4,096 runs reached the ground. The largest concentration was at x = 130–155, with 2,323 contacts (56.7%). Another 1,173 contacts (28.6%) landed at x = 65–95. The most frequent five-unit bin, x = 135–140, contained 755 contacts (18.4%). The histogram counts every strike, including repeated contacts at the same point. The bottom panel uses the same horizontal scale and shows elevation above the bottom of the model.

Every run started from the saved terrain, mesh, and solved seed channel, with the source at x = 120, mesh spacing 3, and growth exponent η = 3. Only the random draws used to select growth bonds changed. The headless sampler re-solved the field after every added air bond and matched all 49 archived NetLogo choices, solver sweep counts, and potential arrays before running the new trials. The distribution describes the revised model at these settings; changing the terrain, mesh, or source could change it. The archive includes a CSV with each trial's seed and contact coordinates.

## 07 · Original NetLogo world — `07-original-interface.png`

**Caption:** The NetLogo world at its first completed strike in Derek's original patch model.

The original model builds a patch potential gradient with noise and terrain adjustments, smooths it at setup, and propagates moving tips. Branch creation is stochastic and uses a separate control and branch lifespan. The model does not solve a new electric potential after a channel step. NetLogo's own view renderer painted the world at tick 156 from a run with seed 42 and the settings saved with the original model. The export contains the world view only.

## 08 · Fixed field versus field feedback — `08-growth-rule-comparison.png`

**Caption:** The original loop uses a field prepared once at setup (top); the revised loop re-solves potential after each added bond (bottom).

Top, left to right: initialize the patch field, move existing tips using local rules, and sometimes create a separate branch. The return arrow goes to tip movement, leaving the setup field alone. Bottom: weight exposed bonds, add one sampled bond, then solve the field with the expanded conductor. The return arrow goes to bond weighting, since the updated potential changes the next choice. These small panels are explanatory schematics, not measured snapshots.

## 09 · Flat-ground solver check — `09-flat-ground-check.png`

**Caption:** The field solver recovers the linear potential between parallel boundaries. The right panel magnifies the numerical error.

The top is at −1 and the flat ground is at 0, separated by 120 model units; depth y increases downward. The analytical solution is φ(y) = −1 + y/120. All 1,962 free vertices started at −0.5. Left: the reference line and solved samples coincide at this scale. Right: numerical minus analytical potential, shown in units of 10⁻⁶. The orange dot marks the maximum absolute error of 9.51 × 10⁻⁶. The maximum local averaging residual was 9.77 × 10⁻⁸ after 328 sweeps. Error compares the numerical result to the known answer; residual measures how well it satisfies the local equation.

## 10 · Field-feedback experiment — `10-field-feedback-experiment.png`

**Caption:** In 64 matched pairs on one terrain, re-solving the field led to contact after fewer air bonds and left a smaller fraction of bonds outside the final contact path.

**Upper panels:** The first matched pair by trial number. Blue at left is the dynamic field; orange at right is the frozen field. Black traces the path to contact. The seed at the top and contact dot at the bottom use the condition color. The panels have identical bounds and scale.

**Lower panels:** Left is the number of air bonds added before contact. Right is the percentage of those bonds outside the eventual seed-to-contact path. In each chart the blue values are on the left and orange on the right, thin gray lines connect the two runs in each pair, and black diamonds mark the medians. Counts exclude the initial seed and final ground-contact link.

| Measure | Dynamic field | Frozen field |
| --- | ---: | ---: |
| Completed contacts | 64/64 | 64/64 |
| Median air bonds before contact | 56 | 263.5 |
| Range of air bond counts | 41–74 | 188–366 |
| Median share of air bonds off the contact path | 34.5% | 84.9% |

Both arms use the same terrain, mesh, initial seed and its solved field, growth weights, and rule for contact. Each pair uses the same sequence of random numbers, one per selection. The dynamic arm re-solves after adding a bond. In the frozen arm, newly occupied vertices are still set to −1 and the candidate list still changes, but the **remaining free vertices** retain their seed-stage potentials. Only the decision to re-solve differs. Shared draws act on different probability distributions once the channels diverge.

The comparison program was checked by reproducing all 49 selections in the archived NetLogo run, with exact agreement in candidate order, weights, field values and sweep counts. All 128 comparison runs completed. In each of the 64 pairs the dynamic model reached ground after fewer additions and left a smaller fraction of growth off its final path. This result concerns one terrain, mesh, source and η setting. The off-path fraction measures the shape at contact; it is not a branching rate, and the experiment does not validate an atmospheric model.
