// TLW-Modell: Interaktiver PSE-Atom-Baukasten (Alarm- & Elektronegativitäts-Update) float zeit = 0; ArrayList bausteine; Baustein gewaehlterBaustein = null; // Atom-Zustandswerte int protonenAnzahl = 0; int neutronenAnzahl = 0; int elektronenAnzahl = 0; String elementName = "Vakuum"; String elementSymbol = "Void"; float atomMasse = 0.0; String tlwStabilitaet = "Stabil (Leer)"; // Chemischer Typ, Pauling-Wert und Abweichungsmetriken color kachelFarbe; String chemischerTyp = "Inert"; float standardMasseReal = 0.0; float tlwMassenAbweichung = 0.0; float bohrModellAbweichung = 0.0; float elektroNegativitaet = 0.0; // Nach Pauling live berechnet boolean alarmAktiv = false; void setup() { size(900, 680); bausteine = new ArrayList(); kachelFarbe = color(35, 45, 60); // Starte mit freien Ur-Teilchen im Raum bausteine.add(new Baustein(150, 70, 0)); bausteine.add(new Baustein(150, 140, 1)); bausteine.add(new Baustein(150, 210, 2)); } void draw() { // Wenn der Isotopen-Alarm aktiv ist, blitzt der Hintergrund leicht rot auf if (alarmAktiv) { background(24 + sin(zeit*10)*14, 11, 16); } else { background(8, 11, 16); } zeit += 0.02; // 1. TOPOLOGISCHES RAUMGITTER (Hintergrund-Matrix) stroke(0, 130, 255, 12); strokeWeight(1); noFill(); int schritt = 28; for (int x = 0; x <= 500; x += schritt) { for (int y = 0; y <= 530; y += schritt) { beginShape(); for (int i = 0; i < 6; i++) { vertex(x + cos(PI/3*i)*15, y + sin(PI/3*i)*15); } endShape(CLOSE); } } // 2. DAS ZENTRALE ATOM-BINDFELD float zentrumX = 320; float zentrumY = 265; // Rot glühender Warnring bei Instabilität if (alarmAktiv) { stroke(255, 50, 50, 100 + sin(zeit*12)*80); strokeWeight(3); } else { stroke(0, 255, 180, 25); strokeWeight(2); } noFill(); ellipse(zentrumX, zentrumY, 190, 190); fill(alarmAktiv ? color(255, 0, 0, 3) : color(0, 255, 180, 4)); noStroke(); ellipse(zentrumX, zentrumY, 190, 190); stroke(0, 150, 255, 15); strokeWeight(1); noFill(); ellipse(zentrumX, zentrumY, 320, 320); // 3. LOGIK: ATOMKERNE BERECHNEN int pZaehler = 0; int nZaehler = 0; int eZaehler = 0; for (Baustein b : bausteine) { float abstand = dist(b.x, b.y, zentrumX, zentrumY); if (b.typ == 2) { if (abstand < 180) { b.gebunden = true; eZaehler++; } else { b.gebunden = false; } } else { if (abstand < 95) { b.gebunden = true; if (b.typ == 0) pZaehler++; else nZaehler++; } else { b.gebunden = false; } } if (b.gebunden && b != gewaehlterBaustein) { if (b.typ == 2) { float winkel = zeit * 1.5 + bausteine.indexOf(b) * 0.8; b.x = zentrumX + cos(winkel) * 120; b.y = zentrumY + sin(winkel) * 120; } else { // Bei Alarm zittern die Kernbausteine heftiger durch Netzdruck float zappelIntensitaet = alarmAktiv ? 28 : 18; b.x = lerp(b.x, zentrumX + sin(zeit*6 + bausteine.indexOf(b))*zappelIntensitaet, 0.05); b.y = lerp(b.y, zentrumY + cos(zeit*5 + bausteine.indexOf(b))*zappelIntensitaet, 0.05); } } b.display(); } protonenAnzahl = pZaehler; neutronenAnzahl = nZaehler; elektronenAnzahl = eZaehler; // PSE, Pauling-Werte & Abweichungen aktualisieren aktualisierePSEundMetriken(); // Panels zeichnen drawSpawnerPanel(); drawPSEPanel(); } void aktualisierePSEundMetriken() { atomMasse = protonenAnzahl + neutronenAnzahl; bohrModellAbweichung = abs(protonenAnzahl - elektronenAnzahl) * 14.5; alarmAktiv = false; if (protonenAnzahl == 0) { elementName = "Reines Vakuum"; elementSymbol = "Void"; tlwStabilitaet = "Inert"; chemischerTyp = "Vakuum-Feld"; kachelFarbe = color(35, 45, 60); standardMasseReal = 0.0; tlwMassenAbweichung = 0.0; bohrModellAbweichung = 0.0; elektroNegativitaet = 0.0; } else if (protonenAnzahl == 1) { elementName = "Wasserstoff"; elementSymbol = "H"; chemischerTyp = "Nichtmetall"; kachelFarbe = color(40, 90, 180); standardMasseReal = 1.008; elektroNegativitaet = 2.20; if (neutronenAnzahl == 0) tlwStabilitaet = "Stabil (Protium)"; else if (neutronenAnzahl == 1) tlwStabilitaet = "Stabil (Deuterium)"; else { tlwStabilitaet = "Isotop-Zerfall (Tritium)"; alarmAktiv = true; } } else if (protonenAnzahl == 2) { elementName = "Helium"; elementSymbol = "He"; chemischerTyp = "Edelgas"; kachelFarbe = color(220, 110, 30); standardMasseReal = 4.0026; elektroNegativitaet = 0.0; // Edelgase haben keine EN nach Pauling if (neutronenAnzahl == 2) tlwStabilitaet = "Perfekte Edelgas-Wabe"; else { tlwStabilitaet = "Gitter-Asymmetrie"; alarmAktiv = true; } } else if (protonenAnzahl == 3) { elementName = "Lithium"; elementSymbol = "Li"; chemischerTyp = "Alkalimetall"; kachelFarbe = color(190, 45, 45); standardMasseReal = 6.94; elektroNegativitaet = 0.98; if (neutronenAnzahl == 4) tlwStabilitaet = "Stabil (Li7)"; else { tlwStabilitaet = "Alkali-Gitterspannung"; alarmAktiv = true; } } else if (protonenAnzahl == 4) { elementName = "Beryllium"; elementSymbol = "Be"; chemischerTyp = "Erdalkalimetall"; kachelFarbe = color(160, 50, 100); standardMasseReal = 9.0122; elektroNegativitaet = 1.57; if (neutronenAnzahl == 5) tlwStabilitaet = "Stabil (Be9)"; else { tlwStabilitaet = "Instabiles Ur-Verhältnis"; alarmAktiv = true; } } else if (protonenAnzahl == 5) { elementName = "Bor"; elementSymbol = "B"; chemischerTyp = "Halbmetall"; kachelFarbe = color(45, 140, 120); standardMasseReal = 10.81; elektroNegativitaet = 2.04; if (neutronenAnzahl == 6) tlwStabilitaet = "Stabilisiertes Cluster (B11)"; else { tlwStabilitaet = "Cluster-Spannung"; alarmAktiv = true; } } else if (protonenAnzahl == 6) { elementName = "Kohlenstoff"; elementSymbol = "C"; chemischerTyp = "Nichtmetall"; kachelFarbe = color(40, 90, 180); standardMasseReal = 12.011; elektroNegativitaet = 2.55; if (neutronenAnzahl == 6) tlwStabilitaet = "Stabile Hex-Matrix (C12)"; else { tlwStabilitaet = "Radioaktives Residuum (C14)"; alarmAktiv = true; } } else if (protonenAnzahl == 7) { elementName = "Stickstoff"; elementSymbol = "N"; chemischerTyp = "Nichtmetall"; kachelFarbe = color(40, 90, 180); standardMasseReal = 14.007; elektroNegativitaet = 3.04; if (neutronenAnzahl == 7) tlwStabilitaet = "Stabiles Triplett-Feld (N14)"; else { tlwStabilitaet = "Instabile Gitter-Resonanz"; alarmAktiv = true; } } else if (protonenAnzahl == 8) { elementName = "Sauerstoff"; elementSymbol = "O"; chemischerTyp = "Nichtmetall"; kachelFarbe = color(40, 90, 180); standardMasseReal = 15.999; elektroNegativitaet = 3.44; if (neutronenAnzahl == 8) tlwStabilitaet = "Stabile Doppel-Wabe (O16)"; else { tlwStabilitaet = "Isotopen-Spannung (O18)"; alarmAktiv = true; } } else { elementName = "Schweratom"; elementSymbol = "Trans"; chemischerTyp = "Instabiles Isotop"; kachelFarbe = color(90, 90, 100); standardMasseReal = protonenAnzahl * 2.05; tlwStabilitaet = "Kritischer Netzdruck"; alarmAktiv = true; elektroNegativitaet = map(protonenAnzahl, 9, 20, 3.5, 1.0); } if (protonenAnzahl > 0) { tlwMassenAbweichung = abs(atomMasse - standardMasseReal); } } void drawSpawnerPanel() { fill(16, 22, 32); noStroke(); rect(0, 0, 110, 530); stroke(30, 42, 60); line(110, 0, 110, 530); drawButton(15, 40, "➕ Proton\n(p+)", color(255, 60, 60)); drawButton(15, 120, "➕ Neutron\n(n0)", color(140, 150, 160)); drawButton(15, 200, "➕ Elektron\n(e-)", color(0, 150, 255)); drawButton(15, 440, "🔥 Vakuum\nReset", color(255, 0, 100)); } void drawButton(float x, float y, String label, color c) { fill(c, 40); stroke(c, 180); strokeWeight(1); rect(x, y, 80, 50, 4); fill(245); textSize(10); textAlign(CENTER, CENTER); text(label, x + 40, y + 25); } void drawPSEPanel() { int px = 520; int py = 0; int pw = 380; fill(12, 16, 24); noStroke(); rect(px, py, pw, height); stroke(35, 48, 68); line(px, py, px, height); // PSE-Kachel fill(kachelFarbe); stroke(255, 50); rect(px + 30, 35, 110, 120, 4); fill(255); textSize(44); textAlign(CENTER, CENTER); text(elementSymbol, px + 85, 90); fill(240); textSize(11); text(chemischerTyp, px + 85, 135); fill(220); textSize(12); textAlign(LEFT, TOP); text(int(atomMasse), px + 38, 42); fill(255); textSize(16); text(elementName, px + 160, 40); fill(140, 160, 180); textSize(12); text("Kernladungszahl (Z): " + protonenAnzahl, px + 160, 68); text("Neutronenanzahl (N): " + neutronenAnzahl, px + 160, 93); text("Elektronen-Orbit: " + elektronenAnzahl, px + 160, 118); stroke(30, 45, 65); line(px + 20, 175, px + 360, 175); fill(0, 255, 180); textSize(13); text("TOPOLOGISCHE ABWEICHUNGS-ANALYSE:", px + 20, 190); // Stabilitätsanzeige schlägt bei Alarm farblich um if (alarmAktiv) fill(255, 80, 80); else fill(240); text("TLW-Gitterzustand: " + tlwStabilitaet, px + 20, 215); fill(255, 100, 100); text("Δ zum Standard-Bohr-Modell: " + nf(bohrModellAbweichung, 1, 1) + " %", px + 20, 242); fill(255, 180, 0); text("Δ zu realen Labor-Messwerten: " + nf(tlwMassenAbweichung, 1, 4) + " u", px + 20, 267); // LIVE ELEKTRONEGATIVITÄT NACH PAULING IM HUD PLAZIEREN fill(0, 255, 200); text("Elektronegativität (Pauling): " + (elektroNegativitaet > 0.0 ? nf(elektroNegativitaet, 1, 2) : "n/a (Edelgas)"), px + 20, 292); fill(16, 22, 32); rect(px + 20, 320, 340, 180, 4); fill(130, 150, 170); textSize(10); textFont(createFont("Courier", 10)); text("Wissenschaftliche Notiz:\nDie Elektronegativität wird im TLW-\nModell direkt aus der Dichte des kova-\nlenten Graph-Laplace-Netzes abgeleitet.\nEin asymmetrisches Protonen-Neutronen-\nVerhältnis triggert Radionuklid-\nSpannungen (visuelles Alarm-Blinken).", px + 30, 335, 320, 160); textFont(createFont("Arial", 12)); fill(14, 18, 26); noStroke(); rect(0, 530, width, 150); stroke(35, 48, 68); line(0, 530, width, 530);fill(160, 180, 200); textSize(11);text("Status: Platziere Bausteine. Rotes Warnleuchten signalisiert instabile Isotopen-Verhältnisse.", 25, 550);fill(0, 255, 180, 180);text("Bohr-Modellfehler skaliert über Coulomb-Diskrepanz | Pauling-Skala: H=2.2, C=2.55, N=3.04, O=3.44", 25, 575);}class Baustein {float x, y; int typ; boolean gebunden = false; float r = 16;Baustein(float kX, float kY, int t) { x = kX; y = kY; typ = t; }void display() {if (typ == 0) { fill(255, 60, 60); stroke(255, 150, 150); }else if (typ == 1) { fill(140, 150, 160); stroke(210); }else { fill(0, 150, 255); stroke(150, 220, 255); }strokeWeight(1.5); ellipse(x, y, r, r);fill(255); textSize(10); textAlign(CENTER, CENTER);if (typ == 0) text("p+", x, y); else if (typ == 1) text("n0", x, y); else text("e-", x, y);}boolean checkMaus() { return dist(mouseX, mouseY, x, y) < r; }}void mousePressed() {if (mouseX > 15 && mouseX < 95) {if (mouseY > 40 && mouseY < 90) bausteine.add(new Baustein(150, 70, 0));if (mouseY > 120 && mouseY < 170) bausteine.add(new Baustein(150, 140, 1));if (mouseY > 200 && mouseY < 250) bausteine.add(new Baustein(150, 210, 2));if (mouseY > 440 && mouseY < 490) bausteine.clear();}for (int i = bausteine.size() - 1; i >= 0; i--) {Baustein b = bausteine.get(i);if (b.checkMaus()) { gewaehlterBaustein = b; break; }}}void mouseDragged() { if (gewaehlterBaustein != null) { gewaehlterBaustein.x = mouseX; gewaehlterBaustein.y = mouseY; } }void mouseReleased() { gewaehlterBaustein = null; }