Matter Antimatter (1D)

by Chantal Roth

HTML

<h2>Matter–Antimatter (ESU Wave) Annihilation</h2>
<div class="subtitle">
  ESU demo: opposite charge-cores (volume eigenstrain) overlap → energy converts into 2γ (traveling waves)
</div>

<div class="hud">
  <div class="control-group">
    <label>Rest “Mass” (ω₀)</label>
    <input type="range" id="massSlide" min="0.10" max="0.80" step="0.05" value="0.20">
    <div class="val" id="massVal"></div>
  </div>

  <div class="control-group">
    <label>Packet Width (σ)</label>
    <input type="range" id="widthSlide" min="20" max="110" step="1" value="50">
    <div class="val" id="widthVal"></div>
  </div>

  <div class="control-group">
    <label>Matter Speed (v/c)</label>
    <input type="range" id="vSlide" min="0.05" max="0.85" step="0.01" value="0.35">
    <div class="val" id="vVal"></div>
  </div>

  <div class="control-group">
    <label>COM Boost (asymmetry)</label>
    <input type="range" id="boostSlide" min="-0.80" max="0.80" step="0.01" value="0.00">
    <div class="val" id="boostVal"></div>
  </div>

  <div class="control-group">
    <label>Sim Speed</label>
    <input type="range" id="speedSlide" min="0.00" max="1.50" step="0.01" value="0.30">
    <div class="val" id="speedVal"></div>
  </div>

  <div class="checks">
    <label class="chk"><input type="checkbox" id="showSum" checked> Sum (physical field)</label>
    <label class="chk"><input type="checkbox" id="showParts" checked> Components</label>
    <label class="chk"><input type="checkbox" id="showEnergy" checked> Energy strip</label>
    <label class="chk"><input type="checkbox" id="showMarkers" checked> Markers</label>
  </div>

  <button id="resetBtn">RESET</button>
</div>

<div class="canvas-container">
  <canvas id="simCanvas" width="900" height="420"></canvas>
  <div class="overlay-text" id="status">STATUS: STANDBY</div>
</div>

CSS

body {
  background-color: #050505;
  color: #ccc;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 18px;
  height: 100vh;
  overflow: hidden;
}

h2 {
  margin: 0 0 6px 0;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.18);
}

.subtitle {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 14px;
  text-align: center;
  max-width: 980px;
}

.hud {
  display: flex;
  gap: 18px;
  background: #111;
  border: 1px solid #333;
  padding: 14px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.55);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 10;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: #9aa;
  font-size: 12px;
  margin-top: -2px;
}

input[type=range] { cursor: pointer; }

.checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px;
  border-left: 1px solid #2b2b2b;
  border-right: 1px solid #2b2b2b;
}

.chk {
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0;
  color: #9aa;
  font-size: 0.85rem;
}

button {
  padding: 10px 22px;
  cursor: pointer;
  background: linear-gradient(135deg, #444, #222);
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  font-weight: 800;
  transition: all 0.2s;
}

button:hover { background: #555; border-color: #777; }
button:active { transform: translateY(1px); }

.canvas-container {
  position: relative;
  margin-top: 14px;
  box-shadow: 0 0 30px rgba(0,0,0,0.85);
  border: 1px solid #222;
}

canvas {
  background: #000;
  display:...

JavaScript

// Matter–Antimatter (ESU Wave) Annihilation Demo
// ---------------------------------------------------------------
// Goals of this version:
//  1) Relativistic wave kinematics for matter packets (group vs phase velocity)
//  2) Charge modeled as a static volumetric eigenstrain "core" (± bulge/dip)
//  3) Annihilation conserves energy + momentum -> two photons (2γ) with energies E1,E2
//  4) Smooth conversion rather than instant disappearance
//  5) More visually interesting rendering (flash, stars, energy strip, markers)
//
// ESU notes alignment:
//  - "Charge as volume eigenstrain" style core (inclusion/exclusion)  :contentReference[oaicite:3]{index=3}
//  - "Photons are waves / wave-only ontology"                         :contentReference[oaicite:4]{index=4} :contentReference[oaicite:5]{index=5}

"use strict";

const canvas = document.getElementById("simCanvas");
const ctx = canvas.getContext("2d");

const statusDiv = document.getElementById("status");

// ------------------------ Config ------------------------
const cfg = {
  // UI-driven parameters
  mass: 0.20,           // dimensionless knob; mapped to rest angular freq ω0
  width: 50,            // Gaussian sigma (px)
  speedMult: 0.30,      // simulation time multiplier
  vFrac: 0.35,          // base matter speed as fraction of c
  boost: 0.00,          // asymmetry (COM boost proxy)

  // Visual + "unit system"
  c: 220,               // "speed of light" on canvas (px/s)
  amp: 55,              // oscillatory amplitude of matter packets (px)
  coreAmp: 18,          // charge-core displacement amplitude (px)
  omega0Scale: 250,     // ω0 = mass * omega0Scale   (rad/s)

  gammaSigma: 18,       // photon packet sigma (px)
  photonAmpBase: 18,    // base amplitude scaling for photons

  annihilationRate: 8.0,// speed of conversion once overlap is strong (1/s)

  // toggles
  showSum: true,
  showParts: true,
  showEnergy: true,
  showMarkers: true
};

//...