New Simulations
Light Polarization
Malus’s Law, Brewster’s angle with Fresnel equations, animated wave view (5 polarization types), and birefringence with wave-plate retardation.
Student’s t-Test
One-sample, two-sample independent, and paired t-tests. Live t-distribution with p-value shading, 95% CI, Cohen’s d effect size, and statistical power.
Battery Electrochemistry
Li-ion charge/discharge curves, C-rate discharge family with Ragone plot, capacity fade (SEI growth + lithium plating), Butler-Volmer kinetics, and Nyquist impedance sketch.
🔮 Light Polarization
Polarization is one of the most versatile concepts in wave optics and this simulation covers it in four independent interactive modes.
Malus’s Law Mode
Three polarizers are chained. The user adjusts each polarizer’s
angle and watches intensity values update in real time according to
I = I₀ · cos²(θ). A bar graph shows each stage’s
fraction of the original light. Rotating the analyzer from 0° to 90°
collapses the beam to zero — Malus’s Law in one drag.
Brewster’s Angle Mode
Full Fresnel equations are computed live:
rs = (n₁cosθᵢ − n₂cosθₜ) / (n₁cosθᵢ + n₂cosθₜ)
rp = (n₂cosθᵢ − n₁cosθₜ) / (n₂cosθᵢ + n₁cosθₜ)
Rs = rs², Rp = rp²
At Brewster’s angle (θ_B = arctan(n₂/n₁)),
Rp = 0 and the reflected beam is completely s-polarized,
visualised by a split graph of Rs and Rp vs incidence
angle with the Brewster marker clearly labeled.
Wave View Mode
Five polarization states are animated simultaneously — linear, right-circular (RCP), left-circular (LCP), elliptical, and unpolarized — by drawing the Ex and Ey component traces on a time axis and the resulting 2D Lissajous figure in the transverse plane.
Birefringence Mode
A wave plate with variable retardation Γ (0–2π) and fast-axis angle rotates an input polarization state. The Stokes S3 (circular component) is plotted as a function of fast-axis angle to show how a quarter-wave plate (Γ = π/2) converts linear to circular polarization.
📊 Student’s t-Test
Null-hypothesis significance testing is foundational to science, yet the ideas are notoriously difficult to build intuition about. This simulation provides three test variants side-by-side with numerical and visual feedback.
Test Types
Three t-test designs are available via tabs:
-
One-sample: compare sample mean
x̄to a fixed null μ₀. Shows 95% CI band, sample dots with jitter, and the null line. - Two-sample independent: compare Group A vs Group B. Pooled (Student) or Welch correction for unequal variances. Difference arrow labeled with Δ.
- Paired: pre-post design where each pair is connected with a green (increase) or red (decrease) line, making individual differences immediately visible.
Statistics Computed
- t-statistic and degrees of freedom (Welch correction for unequal variances)
- Two-tailed p-value via regularised incomplete beta function (Lanczos logGamma)
- 95% confidence interval using the critical t-value
- Cohen’s d effect size with verbal label (negligible / small / medium / large)
- Approximate statistical power (1 − β)
t-Distribution Visualizer
The lower canvas shows the t(df) distribution with:
- Red-shaded rejection tails (area = α)
- Blue-shaded p-value area (the observed t and its mirror)
- Vertical lines for the critical value ±t_crit and observed t-statistic
- Automatic significance verdict badge (green ✅ or red ✗)
Implementation Notes
All statistics are computed purely in JavaScript. The p-value is derived
from the t-CDF using a Lanczos-approximated logGamma and a
Lentz continued-fraction evaluation of the regularised incomplete beta
function — accurate to five decimal places across the typical
range of df. A seeded Mulberry32 PRNG (splitmix32) is used
so slider drags produce reproducible samples.
🔋 Battery Electrochemistry
Li-ion batteries power everything from phones to electric vehicles, yet their electrochemical behaviour is rarely made interactive. This simulation has four linked modes.
Charge / Discharge Mode
A simplified NMC OCV model is used:
OCV(SoC) = 3.0 + 1.2·s − 0.4·s² + 0.3·sin(π·s) − 0.05·cos(2π·s)
During a CC (constant current) discharge the terminal voltage drops by
I · R_int. When charging, the algorithm switches to a CV
(constant voltage) phase when the terminal voltage reaches 4.2 V,
tapering the current to simulate real BMS behaviour. A temperature
correction factor (exp(−0.008·(T−25)²/298)) reduces
effective capacity at cold temperatures.
C-Rate Mode
Five discharge curves are plotted simultaneously: C/5, C/2, 1C, 2C, 5C. Higher C-rates cause larger IR drops, reducing the usable capacity before the 3.0 V cutoff is reached. A Ragone plot (energy vs power density) is computed from the area under each curve and displayed in the lower canvas.
Capacity Fade Mode
Three degradation mechanisms are modelled:
-
SEI growth:
Q_SEI ∝ n^αwhere α is the parabolic growth exponent (typically 0.5 for diffusion-limited film growth). - Lithium plating: accelerated linear loss that kicks in after a user-defined cycle onset (representing overcharge conditions or low-temperature charging).
- Structural / calendar: simple linear fade rate in %/100 cycles.
The combined fade curve highlights the End-of-Life (EoL) point at 80% capacity retention, matching the standard industry definition.
Butler-Volmer Mode
The core electrode kinetic equation is plotted interactively:
i = i₀ · [exp(α·F·η / RT) − exp(−(1−α)·F·η / RT)]
Users control the exchange current density i₀, transfer
coefficient α, and temperature. The anodic and cathodic
half-currents are shown as separate dashed lines. The anodic Tafel slope
(RT/(αF) · ln(10)) is computed and displayed. The lower
canvas shows a sketch of the corresponding Nyquist impedance plot, with
the ohmic resistance intercept and the charge-transfer resistance
semicircle radius both derived from i₀.
Technical Notes
- All three simulations use Canvas 2D only — no external libraries or bundler.
- Each has EN and UK (Ukrainian) language versions with full hreflang metadata.
-
Structured data:
SoftwareApplication+BreadcrumbListin each page. -
Statistics t-test uses a Lanczos
logGamma+ Lentz continued-fractionincompleteBetafor accurate p-values. - Battery simulation uses a seeded PRNG-free approach — curves are deterministic functions, no randomness needed.
What’s Next
Upcoming candidates from the queue include quantum tunnelling, orbital mechanics (Hohmann transfer), cellular automaton rule explorer, and a protein folding coarse-grained model. The 550-simulation milestone is within reach in the next 2–3 sessions.