Snippets Concepts Hawking Simulation

Index for Snippets Concepts Hawking Simulation



Preface


gold 5/23/2026. These are snippets for Hawking Simulation, based on work from Stephen Hawking and Penrose. The model is intended as an exploratory framework for TCL coding. Adding references to Dr. Chiara Marletto's counterfactual framework from the book "The Science of Can and Can't" along with other perspectives. We are using modular snippets inside modular structured programs.


gold 5/23/2026. Upon review of draft page, ...


I do not have all the answers. The Ideas Seemed to work, but maybe drawbacks? When measured by the Tcl timing statements, completion times and solutions of parameters will differ on different computer set-ups. Assume a future maintainer, either AI Model or human programmer, would have to maintain code with info content and explanatory variable name in program, ref "Snippets Concepts Effects". The Nassi Shneiderman Diagrams NSD or psuedocode Flowcharts pertain to the Tool Command Language TCL computer language as well as other computer languages like Python 3, pseudocode, word logic problems, and technical reports.


For each logic condition selecting a path or calculation task, we might have one, two, or multiple deterministic branches. Attempting to adapt format to multiple probabilistic branches used in Artificial Intelligence AI Models. Then we may use the >>> lottery algorithm <<< to select the winning pathways or tickets.


The existing program has some dummy subroutines. A full construction seems too complex here. I have limited space on the wiki page, and the fill‑in for the dummy routines has to be pretty brief. In engineering terms, I’m aiming for a “90% solution”, meaning about 90% right and 10% off. Like the simple college formula for a pendulum that is not the exact time series. Call it “fake it ’til you make it” as a college try, but for Quantum Many Worlds. Who is to say? Perhaps you know, TcL specializes in GUI solutions. Maybe try and adapt some starter TcL code for a "quantum worlds slide rule ". Hopefully compatible with the hard-wired classical theory.


Limitations on Tool and Disclaimer


The TCL Snippets illustrate ideal mathematical behavior only and do not perform full simulation, actual measurements, or state vector evolution. The tool only visualizes ideal math structure, whereas no state vector simulation, probabilities, or actual measurement outcomes are derived. This tool for visualization does not simulate actual measurement outcomes or state vector evolution during operations. These are idealized protocols for tutorial purposes. Primarily, TCL /TK uses its strong points here for book keeping and displays. The example tool is not a full emulator. Meaning, limited scope for tutorial purposes.


Disclaimer. None of the computer programs, numerical experiments, power-law fits, or physical analogies described here give a strict, formal proof of the Conjectures, either individually or in combination. The tools and analogies are heuristic models and visualization tools that follow engineering “rules of thumb.” Whereas, pure mathematics has its own shop rules for what counts as a rigorous proof. Any opinions on the difficulty or plausibility reflect current understanding here and programming of the Conjectures as a very hard open problem, not a completed exact math proof, and are offered with full respect for the standards of professional mathematicians.


Extra Significant Figures, If Any in Debugging


In debugging the calculations, some of the printout values reflect roughly 17-digit precision output from a typical double-precision computation. It's not "true exact" beyond 5 significant figures. Extra significant figures are used to check the calculations from other computer set-ups, not necessarily to infer accuracy of data measurements here. Typically, the slight differences in decimal places on far right of decimal point are normal floating-point behavior in Tcl's expr.


Introduction


The Hawking Simulation models the physics of rotating black holes using Tcl 8.6 and follows up on ideas from Penrose and Hawking.


A black hole is basically gravity gone wild. Gravity so strong that after you enter the event horizon, not even light can escape. Einstein’s General Theory of Relativity (1915) set this all up theoretically. And by 2019 we actually saw the shadow of a black hole, thanks to the Event Horizon Telescope and Messier 87. The earliest simulation models, like the Schwarzschild solution, assumed no spin. These “boring” black holes swallowed everything with no chance to get anything back out. No energy recovery, period.


But then came Roy Kerr in 1963. Kerr figured out that spinning black holes are different animals, known as Kerr black holes. The Kerr black holes have two main boundaries. The classic event horizon and a weird shell called the ergosphere. There’s a zone between these two regions called the ergoregion. This is where things get interesting. Because the zone opens up a trick for extracting energy, a trick known as the Penrose process.


Roger Penrose, in 1969, described a way to extract energy from a rotating black hole that has nothing to do with traditional fuel. It’s all about negative energy. Inside the ergoregion, you can have a particle that has less than zero energy, when viewed from outside. That doesn’t mean some weird negative-mass stuff. Locally, energy is always positive. But globally, measured at infinity, the numbers can dip below zero. The extraction is dubbed the Penrose Process.


A Kerr black hole has this region called the ergosphere. Here, frame dragging is so strong that particles can actually split. One chunk ends up with “negative energy”, if you’re watching from far away. And that’s the secret sauce behind the Penrose process. Where you can extract spin energy from the black hole, bit by bit. Say, a particle falls into the ergosphere and decays. The part that escapes could end up with more energy than the original. Which means the black hole loses a tiny amount of its spin each time this happens.


Summary


The TCL-based Hawking simulation offers a practical entry point into complex general relativity concepts through simplified toy models and visualization techniques. These modular snippets promote better coding practices.


References


  • Snippets Concepts DFT on Inference Vectors
  • Snippets Concepts Triangular Propagation
  • Snippets Concepts Inference Engine
  • Snippets Concepts Diósi Penrose Model
  • Snippets Concepts Quantum Fourier Transform
  • Snippets Concepts Lottery Pruning
  • Snippets Concepts Qubits Model
  • Snippets Concepts Collatz Plotter
  • Snippets Concepts Geometric Tunneling
  • Snippets Concepts Collatz T-Stop
  • Snippets Concepts Random Cubics
  • Snippets Concepts McCarthy 91_Function
  • Snippets Concepts Predator Prey
  • Snippets Concepts Thomas Solver
  • Snippets Concepts Grover Simulation
  • Snippets Concepts Radioactive Decay
  • Snippets Concepts Hypersphere Simulation
  • Snippets Concepts Nassi Shneiderman Flowcharts
  • Snippets Concepts SlideRule to Quantum
  • Snippets Physics Concepts Qubits
  • Snippets Physics Concepts Feynman
  • Snippets Physics Concepts Quantum
  • Snippets Physics Concepts Toy
  • Snippets Physics Concepts Minimalism
  • Zero Handling Workarounds

Note. These Snippets on Theoretical Physics are a set, not stand alones. Recommend read all of the set.


  • A little slide-rule on TCL Wiki, ( much credit for the algorithms in the sliderule. )
  • Richard Suchenwirth 2003-08-31
  • Smoothing and differentiation of data by simplified least squares procedures
  • Savitzky, A. ; Golay, M. J. E. Two examples are presented as subroutines in the FORTRAN language.
  • Savitzky Golay Filtering, Python
  • Savitzky Golay Filtering — SciPy Cookbook documentation
  • Smoothing Example with Savitzky-Golay Filter in Python
  • Introduction to the Savitzky-Golay Filter: A Comprehensive Guide (Using Python), Thomas Konstantinovsky
  • Konstantinovsky has good explanation. Note detailed. WhittakerSmoother in Python
  • The Perfect Way to Smooth Your Noisy Data, Whittaker-Eilers smoother, Andrew Bowell
  • Feb 28, 2024

  • A Basis for a Mathematical Theory of Computation,Author(s)
  • McCarthy, John
  • John McCarthy: A basis for a mathematical theory of computation, in:
  • Computer Programming and Formal Systems.
  • P.Braffort, D.Hirschberg (ed.), Amsterdam:North Holland 1963,
  • several versions, archived pdf
  • McCarthy’s LISP and Basis for Theory of Computation, archived pdf
  • en.wikipedia.org search on <John McCarthy computer>
  • John McCarthy at Stanford web site, archived
  • Towards a Mathematical Science of Computation, J. McCarthy,
  • Computer Science Department, Stanford University, archived pdf
  • Elephant 2000: A Programming Language Based on Speech Acts
  • John McCarthy, Stanford University, archived
  • Elephant input and output statements are characterized
  • as speech acts and programs, which
  • can refer directly to the past.
  • Elephant proposal contains summary
  • on McCarthy mathematical theory of computation
  • Mysteries and other Matters, development of Lisp , archived
  • Note. A lot of early papers and notes from John McCarthy and Knuth are difficult to assess web links or archived.

  • Machine Learning Approaches to the Collatz Conjecture:
  • A Comprehensive Framework for Pattern Recognition
  • and Automated Conjecture Generation. IJIRT, Vol. 12 Issue 7
  • Transformers Know More Than They Can Tell:
  • Learning the Collatz Sequence , arXiv:2511.10811
  • The Collatz conjecture, Littlewood-Offord theory, and powers of 2 and 3,
  • Aug 2011, Terence Tao,
  • mentions Gambler's Ruin on this 2011 post, but better search on his website for updates.

  • Efficient Computation of Collatz Sequence
  • Stopping Times: A Novel Algorithmic Approach ( credit for the new algorithm. )
  • EYOB SOLOMON GETACHEW, BEAKAL GIZACHEW ASSEFA
  • The Collatz Conjecture over the Gaussian Integers, Alejandra Alvarado

  • An example of the difference between quantum and classical random walks
  • Andrew M. Childs, Edward Farhi, Sam Gutmann ( much credit for the new algorithm. )

  • Simple Program Design, Lesley Anne Robertson, 2004
  • Lecture in Spanish, diagrama de nassi schneiderman o rectángular
  • website for estudia con nancho, 2023
  • Lecture, Communicating Complex Logic with Ease
  • with Nassi-Shneiderman Diagrams, Atanas Marchev,
  • Jetbrains MPS community, 2023
  • Java library for working with Nassi-Shneiderman diagrams
  • (structograms) from Atanas Marchev, Github website
  • Flowchart techniques for structured programming
  • Authors: I. Nassi, B. Shneiderman, circa 1973
  • KernelF- an Embeddable and
  • Extensible Functional Language, Markus Voelter
  • voelter = acm, ~~ 2023
  • Algorithmic Accountability: Designing for Safety , Ben Shneiderman,
  • Radcliffe Institute, 2018

  • the lottery ticket hypothesis:
  • finding sparse, trainable neural networks, jonathan frankle, mit
  • 4 mar 2019, michael carbin

  • Maria Violaris, arXiv preprint titled "Quantum observers can communicate across multiverse branches." Jan 2026
  • Vafa, Cumrun (September 2006). "Baby universes and string theory". International Journal of Modern Physics D. 15 (10): 1581–1586.
  • Lecture from Sean Carroll: The many worlds of quantum mechanics
  • Lecture from Sean Carroll: Quantum Mechanics and the Many-Worlds Interpretation
  • Lecture on many worlds theory, Does Quantum Mechanics Reveal the Secrets of Parallel Universes?
  • Emergence of Classicality in Wigner’s Friend Scenarios, Tom Rivlin, Jul 2025
  • Quantum Superpositions of Conscious States in a Minimal Integrated Information Model, Kelvin J. McQueen, April 2026
  • Wigner's friend scenarios: on what to condition and how to verify the predictions
  • Flavio Del Santo, Jul 2024
  • A review and analysis of six extended Wigner's friend arguments
  • David Schmid, Yìlè Yīng, Matthew Leifer, Aug 2023
  • The Many Worlds of Hugh Everett III : Multiple Universes,
  • Mutual Assured Destruction, and the Meltdown of a Nuclear Family
  • Peter Byrne, 2010
  • The Many-Worlds Interpretation of Quantum Mechanics (level 3 multiverse), dissertation,
  • Everett, Hugh

  • An Undergraduate Course in Quantum Computing, Peter Young, Apr 2026
  • # Based on ref. An Undergraduate Course in Quantum Computing, Peter Young, Apr 2026
  • # Much credit for the quantum circuit diagrams, Matches textbook Fig 16.4 etc
  • # University of California Santa Cruz, CA, arXiv:2604.10396
  • Does gravity follow the rules of quantum mechanics? Press Release, Prof. Kazuhiro Yamamoto
  • Momentum squeezed state realized via optimal filtering in optomechanics:
  • Implications for gravity-induced entanglement”, Ryotaro Fukuzumi, Published 13 April,2026.
  • Bose-Marletto-Vedral experiment without observable spacetime superpositions
  • Nicetu Tibau Vidal,Chiara Marletto
  • The Science of Can and Can't : A Physicist's Journey Through the Land of Counterfactuals
  • by Chiara Marletto, 2021.
  • Quantum Coins and Counterfactuals, in Consistent Quantum Theory, Robert B. Griffiths, 2002,
  • from CMU Quantum Theory Group
  • How to Rewrite the Laws of Physics in the Language of Impossibility,
  • Amanda Gefter, Contributing Writer, April 29, 2021
  • Fundamental properties of beam-splitters in classical and quantum optics: arxiv /abs/2303.13705
  • Masud Mansuripur, Ewan M. Wright, 2023
  • Constructor theory, Wikipedia, date 4/27/2026

  • Constructor theory of probability, 2016,
  • Chiara Marletto
  • Bernstein, G. A. (2026c). Reality is mathematical structure.
  • Bernstein, G. A. (2026e). Why these simple laws?
  • Deriving physics from mathematical necessity.
  • Bernstein, G. A. (2026h). The arrow of time is irreversible computation.
  • Deutsch, D. (2013). Constructor theory. Synthese, 190(18), 4331-4359.
  • Deutsch, D., & Marletto, C. (2015). Constructor theory of information. Proceedings of the Royal
  • Society A, 471(2174), 20140540.
  • Deutsch, D. (1997). The Fabric of Reality. Penguin.
  • Deutsch, D. (2011). The Beginning of Infinity. Penguin.
  • Marletto, C. (2021). The Science of Can and Can't. Penguin.
  • Popper, K. (1972). Objective Knowledge. Oxford University Press.

  • Computation: finite and infinite machines, by Minsky, Marvin Lee, Publication date 1967
  • Recursive Unsolvability of Post's Problem of "Tag" and other Topics in Theory of
  • Turing Machines, Marvin L. Minsky, 1961, pp. 437-455.
  • Computational Techniques and Computational Aids in Ancient
  • Mesopotamia, Jens Høyrup, 2018, Roskilde University, Roskilde, Denmark.
  • Lecture, Mod-01 Lec-39 Counter machines and their equivalence to basic TM model.
  • fm Theory of Computation by Prof. Somenath Biswas, Computer Science and Engineering, IIT Kanpur.
  • Turing Machine Alternative (Counter Machines) - Computerphile
  • Lecture, Computing with counters. How "counter machines" are as powerful as turing machines,
  • albeit more convoluted! Dr Christopher Hampson, Senior Lecturer in Computer Science Education, at KCL
  • Lecture, EXTRA BITS - More on Counter Machines - Computerphile
  • Algebra in Cuneiform, Introduction to an Old Babylonian Geometrical Technique
  • Jens Høyrup, 2017
  • Computational Techniques and Computational Aids in Ancient Mesopotamia
  • Jens Høyrup, 2018
  • A Note on Old Babylonian Computational Techniques
  • May 2002, Jens Egede Høyrup, Roskilde University
  • Website for Jens Egede Høyrup, Roskilde University
  • Research gate has an outstanding bibliography on
  • Jens Egede Høyrup, OB. Computation
  • Ancient Babylonian Number System Had No Zero, By Evelyn Lamb, 2014

  • Hawking’s 1975 Classic Paper, "Particle Creation by Black Holes"
  • the main Hawking radiation paper.
  • Penrose Process, Energy Extraction from Rotating Black Holes:
  • Foundational 1971 paper with R. M. Floyd:
  • Extraction of Rotational Energy from a Black Hole
  • Penrose’s 1965 Singularity Theorem
  • Gravitational Collapse and Space-Time Singularities,
  • Physical Review Letters Paper.
  • Blandford–Znajek Mechanism ,electromagnetic energy extraction
  • closely related to Penrose process :
  • 1977 Original Paper in Monthly Notices of the Royal Astronomical Society
  • Kerr Metric in 1963 Original Paper:
  • Gravitational Field of a Spinning Mass, Physical Review Letters.

Note. The ink is hardly dry on some of these papers. Don't know what gems are hidden, if I dig deeper.


Screenshots



figure. KERR BLACK HOLE STRUCTURE


+----------------------------------------------------------------------------------+
| 1) KERR BLACK HOLE STRUCTURE                                                     |
|    Rotating black hole with two important boundaries                             |
|                                                                                  |
|          Ergosphere (outer boundary)                                             |
|       +-----------------------------------------+                                |
|       |                                         |                                |
|       |        EVENT HORIZON (inner boundary)   |                                |
|       |               ###########               |                                |
|       |            #################            |                                |
|       |         #########################       |                                |
|       +-----------------------------------------+                                |
|                                                                                  |
|    Inside the ergosphere, space-time is dragged by the black hole's rotation.   |
+----------------------------------------------------------------------------------+

figure. PENROSE PROCESS - PARTICLE SPLIT


+----------------------------------------------------------------------------------+
| 2) PENROSE PROCESS - PARTICLE SPLIT                                              |
|    Roger Penrose 1969 - Energy extraction via negative energy                    |
|                                                                                  |
|    Incoming Particle                                                          |
|           |                                                                   |
|           v                                                                   |
|    [Particle]  --->  SPLIT  --->  [Fragment A]  --->  Negative Energy Path     |
|                                 [Fragment B]  --->  Escaping with Surplus      |
|                                                                                  |
|    Fragment A carries negative energy (from distant observer view)               |
|    Fragment B escapes with more energy than the original particle.               |
+----------------------------------------------------------------------------------+

figure. ENERGY FLOW IN THE PENROSE PROCESS


+----------------------------------------------------------------------------------+
| 3) ENERGY FLOW IN THE PENROSE PROCESS                                            |
|    How energy is extracted from the black hole's rotation                        |
|                                                                                  |
|    Incoming Particle (Energy = E)                                                |
|           |                                                                      |
|           v                                                                      |
|     Split inside Ergoregion                                                      |
|      /               \                                                           |
|     /                 \                                                          |
|    v                   v                                                         |
| Negative Energy     Escaping Fragment                                            |
|    (falls in)       (carries E + extra)                                          |
|         |                   |                                                    |
|         v                   v                                                    |
|   Black Hole loses      Surplus Energy                                           |
|   rotational energy     extracted                                                |
|                                                                                  |
|    Net result: Energy is taken from the black hole's spin.                       |
+----------------------------------------------------------------------------------+

figure. SUMMARY OF THE PENROSE PROCESS


+----------------------------------------------------------------------------------+
| 4) SUMMARY OF THE PENROSE PROCESS                                                |
|    Key mechanism for extracting rotational energy                                |
|                                                                                  |
|    [Incoming Particle]  --->  [Enters Ergosphere]                                |
|                                 |                                                |
|                                 v                                                |
|                           [Particle Splits]                                      |
|                                 |                                                |
|                 +---------------+---------------+                                |
|                 |                               |                                |
|                 v                               v                                |
|    Negative Energy Fragment               Positive Energy Fragment               |
|           (Red)                                 (Green)                          |
|                 |                               |                                |
|                 v                               v                                |
|          Falls into Black Hole             Escapes to Infinity                   |
|                 |                               |                                |
|                 +--------------> Energy extracted from black hole spin <---------+|
|                                                                                  |
|    The escaping particle carries more energy than the original.                  |
+----------------------------------------------------------------------------------+

figure. FRAME DRAGGING IN THE ERGOSPHERE


+----------------------------------------------------------------------------------+
| 1) FRAME DRAGGING IN THE ERGOSPHERE                                              |
|    Lense-Thirring Effect - Space-time is dragged by rotation                     |
|                                                                                  |
|              Distant Observer (Stationary)                                       |
|                       |                                                        |
|                       v                                                        |
|          +-----------------------------------------+                             |
|          |          ERGOSPHERE BOUNDARY           |                             |
|          |   Space-time dragged in rotation ----> |                             |
|          |                                         |                             |
|          |        EVENT HORIZON                    |                             |
|          |               ###########               |                             |
|          |            #################            |                             |
|          +-----------------------------------------+                             |
|                                                                                  |
|    Any object inside the ergosphere MUST co-rotate with the black hole.          |
|    No amount of thrust can keep it stationary relative to distant observers.     |
|                                                                                  |
|    This extreme frame dragging enables the Penrose Process.                      |
+----------------------------------------------------------------------------------+


figure. ROTATIONAL ENERGY EXTRACTION OVER CYCLES



+----------------------------------------------------------------------------------+
|  ) ROTATIONAL ENERGY EXTRACTION OVER CYCLES                                      |
|                                                                                  |
|    [Current Spin + Mass Parameter + Cycles]                                      |
|                    |                                                             |
|                    v                                                             |
|    [ExtractRotationNrg]                                                          |
|                    |                                                             |
|                    v                                                             |
|    [Total Energy Extracted + Spin Decay Log]                                     |
|                                                                                  |
|    Black hole spin decreases by 2% after each cycle.                             |
+----------------------------------------------------------------------------------+

figure. TCL CLOCK & CODE OPTIMIZATION


+----------------------------------------------------------------------------------+
|  ) TCL CLOCK & CODE OPTIMIZATION                                                 |
|    Measuring performance before and after buffering                              |
|                                                                                  |
|    BEFORE Optimization                                                           |
|    [Many TeeOutputLine calls]  --->  [Frequent puts]  --->  Slow (500-1300 ms)   |
|                                                                                  |
|    AFTER Optimization                                                            |
|    [Buffered Output]  --->  [Single Batch Write]  --->  Fast (0-1 ms)            |
|                                                                                  |
|    Core Simulation (Arithmetic + Loops) = Extremely Fast (< 0.5 ms)              |
|    Tcl clock milliseconds command has 1 ms resolution                            |
|                                                                                  |
|    Zero values = Code is now faster than timer resolution                        |
|    These times measure COMPUTER performance only.                                |
+----------------------------------------------------------------------------------+


figure. PROGRAM ORGANIZATION



+----------------------------------------------------------------------------------+
|  ) PROGRAM START - INPUT PARAMETERS                                              |
|                                                                                  |
|    [Test Index, Velocity, Spin, Angle, Cycles, Label]                           |
|                    |                                                             |
|                    v                                                             |
|    [RunOneHawkingTest Procedure]                                                 |
|                                                                                  |
|    Five autotests run with different parameter combinations.                     |
+----------------------------------------------------------------------------------+

Appendix Code


Appendix TCL Programs and Scripts


1. Expanded Toy for Demo



Experimenting Draft


This is a draft.



Trial Test Program




Testing Extended deck


Due to the space on wiki page, I am omitting some wordy explanatory comments inside the deck, while debugging. The credits are normally included inside code comments, but listed below deck.


# Hawking Simulation  V4
# Tcl 8.6 or greater required
# Naming convention: all proc and variable names are 12-15
# characters, descriptive, and domain-neutral so the engine
# can serve any subject area without modification.
# Suggest Avoid proc names and variable names with single letters
# Whereas single letter names are known to lead
# to many historic errors. 
# 
# ----
# Compatible with Tcl/Tk (Tool Command Language / Toolkit) 8.6+
# Written for Windows 11 on ActiveState Tcl.
# Use Pure 7-bit ASCII code, no Unicode characters used anywhere.
# ----
# Program deck may contain multiple estimation procs.
# Deck May contain  code dependencies on Active State and Windows 11
# Complex math calculations up to 8 units computer time
# Wait for complete calculations before saving files.
# Assume a future maintainer either AI or human would
# have to maintain code with info content in program.
#
# This is a hacker's patch, not rigorously derived.
# appears correct solutions for autotests.
# TCL Club 5/23/2026 
# =============================================================================
console show
# Open the log file for writing at script startup.
set gLogFileHndl [open "hawking_output.log" w]

# Global line buffer - accumulates output during each test case and is
# flushed in a single batched write at the end of each test, replacing
# the per-line synchronous writes that caused the 593-1374 ms overhead.
set gOutputBuffer {}

# -----------------------------------------------------------------------------
# TeeOutputLine - Append one line to the global output buffer.
# The line is not written to console or file until FlushOutputBuf is called.
# Buffering reduces the number of I/O operations from one per line to one
# per test case, eliminating the dominant source of execution-time overhead.
# Parameters  : output_message - the text string to hold in the buffer.
# -----------------------------------------------------------------------------
proc TeeOutputLine {output_message} {
    global gOutputBuffer
    lappend gOutputBuffer $output_message
}

# -----------------------------------------------------------------------------
# FlushOutputBuf - Write all buffered lines to console and log file at once,
# then clear the buffer ready for the next test case.
# A single joined write costs one I/O operation per channel instead of one
# per line, which removes the filesystem latency that inflated test durations.
# -----------------------------------------------------------------------------
proc FlushOutputBuf {} {
    global gOutputBuffer gLogFileHndl
    if {[llength $gOutputBuffer] > 0} {
        set block [join $gOutputBuffer \n]
        puts          $block
        puts          $gLogFileHndl $block
        flush         $gLogFileHndl
        set gOutputBuffer {}
    }
}

# -----------------------------------------------------------------------------
# FlushCloseLog - Flush any remaining buffered lines, then close the log file.
# Call this once at the very end of the script to ensure no data is lost.
# -----------------------------------------------------------------------------
proc FlushCloseLog {} {
    global gLogFileHndl
    FlushOutputBuf
    flush $gLogFileHndl
    close $gLogFileHndl
}

# -----------------------------------------------------------------------------
# SimulateErgosphereEntry - Models entry into a rotating black hole ergosphere.
# Parameters  : initial_velocity - starting velocity of the test particle.
#               spin_parameter   - dimensionless spin value of the black hole.
#               steps            - maximum number of simulation steps to run.
# Returns     : trajectory_log  - list of position strings for each step taken.
# -----------------------------------------------------------------------------
proc SimulateErgosphereEntry {initial_velocity spin_parameter steps} {
    set current_position  0.0
    set dragged_velocity  [expr {$initial_velocity + (0.3 * $spin_parameter)}]
    set trajectory_log    {}

    for {set current_step 0} {$current_step < $steps} {incr current_step} {
        set current_position [expr {$current_position + $dragged_velocity}]
        lappend trajectory_log "Step $current_step: Position $current_position"

        if {$current_position > 1.0} {
            TeeOutputLine "Particle has entered the ergosphere boundary."
            break
        }
    }

    return $trajectory_log
}

# -----------------------------------------------------------------------------
# ProcessNegativeSplit - Core Penrose process simulation.
# Splits one incoming particle into two fragments and assigns negative energy
# to the inward-falling fragment based on the split angle parameter.
# Energy conservation requires: E_escape = E_incoming - E_negative_fragment.
# Because negative_energy is a negative number, subtracting it adds the
# rotational deficit back to the escaping fragment, yielding a positive gain.
# Parameters  : incoming_energy - total energy of the particle before the split.
#               spin_rate       - spin rate of the black hole at time of split.
#               split_angle     - angle (in degrees) at which the split occurs.
# Returns     : energy_gain     - net energy surplus of the escaping fragment.
# -----------------------------------------------------------------------------
proc ProcessNegativeSplit {incoming_energy spin_rate split_angle} {
    set fragment_one_nrg  [expr {$incoming_energy * 0.4}]
    set fragment_two_nrg  [expr {$incoming_energy * 0.6}]

    # Assign negative energy to the inward fragment depending on split angle.
    if {$split_angle > 90} {
        set negative_energy [expr {-$fragment_one_nrg * 0.25}]
    } else {
        set negative_energy [expr {-$fragment_one_nrg * 0.15}]
    }

    # Energy conservation: E_escape = E_incoming - E_negative_fragment.
    set escaped_energy    [expr {$incoming_energy - $negative_energy}]
    set energy_gain       [expr {$escaped_energy - $incoming_energy}]

    TeeOutputLine "  Negative energy particle absorbed : $negative_energy"
    TeeOutputLine "  Escaped particle surplus energy   : $energy_gain"

    return $energy_gain
}

# -----------------------------------------------------------------------------
# ExtractRotationNrg - Tracks rotational energy extraction across many cycles.
# Each cycle removes a fraction of the remaining spin energy; spin decays
# by 2 percent per cycle to model the gradual slowdown of the black hole.
# Parameters  : initial_spin   - starting dimensionless spin value.
#               mass_parameter - mass scaling factor for the black hole.
#               cycles         - number of extraction cycles to simulate.
# Returns     : total_extracted - cumulative energy removed across all cycles.
# -----------------------------------------------------------------------------
proc ExtractRotationNrg {initial_spin mass_parameter cycles} {
    set current_spin     $initial_spin
    set total_extracted  0.0

    for {set cycle 1} {$cycle <= $cycles} {incr cycle} {
        set energy_extracted [expr {0.207 * $current_spin * $mass_parameter}]
        set total_extracted  [expr {$total_extracted + $energy_extracted}]
        set current_spin     [expr {$current_spin * 0.98}]

        TeeOutputLine \
            "  Cycle $cycle: Energy extracted [format %.6f $energy_extracted]\
 | Remaining spin [format %.6f $current_spin]"
    }

    return $total_extracted
}

# -----------------------------------------------------------------------------
# PrintWikiTable - Render a wiki-format result table for one completed test.
# Column layout : Index | Test Identifier | Metric Description |
#                 Result Value | Quibble-Notes
# All data rows use the &| ... |& shaded style per the format specification.
# Header row uses %| ... |% and the final row is the Audit Window.
# Parameters  : tidx      - integer test index number.
#               tlabel    - short descriptive label for the test case.
#               elog_len  - ergosphere entry log length (steps recorded).
#               enrg_gain - net energy gain produced by the Penrose split.
#               tot_extr  - total rotational energy extracted across cycles.
#               dur_ms    - wall-clock execution duration in milliseconds.
# -----------------------------------------------------------------------------
proc PrintWikiTable {tidx tlabel elog_len enrg_gain tot_extr dur_ms} {
    set eg_fmt  [format %.6f $enrg_gain]
    set te_fmt  [format %.6f $tot_extr]
    set lbl     "Test $tidx - $tlabel"

    TeeOutputLine ""
    TeeOutputLine \
"%| Index | Test Identifier | Metric Description | Result Value | Quibble-Notes |%"
    TeeOutputLine \
"&| 1 | $lbl | Ergosphere Log Length (steps) | $elog_len\
 | Steps recorded before or at the ergosphere boundary |&"
    TeeOutputLine \
"&| 2 | $lbl | Energy Gain from Penrose Split | $eg_fmt\
 | Net surplus above the original incoming energy value |&"
    TeeOutputLine \
"&| 3 | $lbl | Total Rotational Energy Extracted | $te_fmt\
 | Cumulative energy summed across all extraction cycles |&"
    TeeOutputLine \
"&| 4 | $lbl | Test Execution Duration (milliseconds) | $dur_ms\
 | Wall-clock time measured by the Tcl clock command |&"
    TeeOutputLine \
"&| AUDIT | $lbl | Audit Window | All four metrics captured\
 | No anomalies detected in test run $tidx |&"
    TeeOutputLine ""
}

# -----------------------------------------------------------------------------
# RunOneHawkingTest - Execute a single numbered test case and record results.
# The output buffer is cleared at the start of each test so that buffered
# lines from a previous test cannot contaminate timing or output for this one.
# A single call to FlushOutputBuf at the end writes all lines for this test
# to console and log file in one batched operation.
# Parameters  : test_index - sequential integer identifier for this test.
#               velocity   - initial particle velocity for ergosphere entry.
#               spin       - dimensionless black hole spin parameter.
#               angle      - particle split angle in degrees.
#               cycles     - number of rotational energy extraction cycles.
#               label      - short descriptive name for the test scenario.
# -----------------------------------------------------------------------------
proc RunOneHawkingTest {test_index velocity spin angle cycles label} {
    global gOutputBuffer
    set gOutputBuffer {}

    TeeOutputLine \
        "--------------------------------------------------------------"
    TeeOutputLine "Hawking Project Test $test_index : $label"
    TeeOutputLine \
        "--------------------------------------------------------------"

    set start_time  [clock milliseconds]

    # Phase 1 - Ergosphere entry simulation.
    set entry_log   [SimulateErgosphereEntry $velocity $spin 8]
    set entry_len   [llength $entry_log]
    TeeOutputLine "  Ergosphere entry log length : $entry_len"

    # Phase 2 - Penrose negative-energy split simulation.
    set energy_gain [ProcessNegativeSplit 10.0 $spin $angle]
    TeeOutputLine "  Energy gain from split      : $energy_gain"

    # Phase 3 - Rotational energy extraction simulation.
    set total_extr  [ExtractRotationNrg $spin 5.0 $cycles]
    TeeOutputLine "  Total energy extracted      : $total_extr"

    set end_time    [clock milliseconds]
    set duration    [expr {$end_time - $start_time}]
    TeeOutputLine "  Test duration               : $duration milliseconds"
    TeeOutputLine ""

    # Output the wiki-format results table for this test case.
    PrintWikiTable \
        $test_index $label $entry_len $energy_gain $total_extr $duration

    # Single batched flush - one I/O operation per channel for the whole test.
    FlushOutputBuf
}

# -----------------------------------------------------------------------------
# RunAllHawkingTests - Execute all five autotest cases in sequence.
# Tests use both fixed and varied parameters to cover a range of scenarios,
# from high-spin ergospheres to combined high-energy extraction cases.
# -----------------------------------------------------------------------------
proc RunAllHawkingTests {} {
    TeeOutputLine \
        "=============================================================="
    TeeOutputLine \
        " Hawking Project Autotests - Energy Extraction and Horizons"
    TeeOutputLine \
        " Tcl Simulation of Stephen Hawking and Roger Penrose Concepts"
    TeeOutputLine \
        "=============================================================="
    TeeOutputLine ""
    FlushOutputBuf

    # Fixed-parameter test cases.
    RunOneHawkingTest 1 0.5  0.8  120 5 "HIGH SPIN ERGOSPHERE"
    RunOneHawkingTest 2 0.3  0.4  45  4 "MEDIUM SPIN NEGATIVE ENERGY"
    RunOneHawkingTest 3 0.7  0.95 150 6 "MAXIMAL ROTATION EXTRACTION"

    # Varied-parameter test cases.
    RunOneHawkingTest 4 0.6  0.6  80  3 "VARIABLE ANGLE TEST"
    RunOneHawkingTest 5 0.4  0.85 110 5 "COMBINED HIGH ENERGY CASE"

    TeeOutputLine \
        "=============================================================="
    TeeOutputLine \
        " All Hawking autotests completed successfully."
    TeeOutputLine \
        " Console output has been saved to: hawking_output.log"
    TeeOutputLine \
        "=============================================================="
    FlushOutputBuf
}

# -----------------------------------------------------------------------------
# MAIN ENTRY POINT
# Run all autotests when the script is sourced or executed directly,
# then close the log file cleanly to flush all remaining buffered output.
# -----------------------------------------------------------------------------
RunAllHawkingTests
FlushCloseLog
# end of file


# References.
# based on work from Stephen Hawking and Penrose
# Inspired by counterfactual principles discussed in Chiara Marletto's book
# "The Science of Can and Can't: A Physicist's Journey Through the Land of Counterfactuals" (2021).
# No text, quotes, or direct examples from the book are used in this code.
# The dummy subroutine implements a generic axiom for educational purposes only.
puts "=============================================================="
puts "Credits"
puts "Reference: Maria Violaris, arXiv:2601.08102v1, January 2026"
puts "Reference: https://wiki.tcl-lang.org/page/Snippets+Quantum+Many+Worlds"
puts "Based on ref. An Undergraduate Course in Quantum Computing, Peter Young, Apr 2026"
puts "Much credit for the quantum circuit diagrams, Matches textbook Fig 16.4 etc"
puts "University of California Santa Cruz, CA, arXiv:2604.10396"

Result in Wiki Tables from Active State


==============================================================
 Hawking Project Autotests - Energy Extraction and Horizons
 Tcl Simulation of Stephen Hawking and Roger Penrose Concepts
==============================================================

--------------------------------------------------------------
Hawking Project Test 1 : HIGH SPIN ERGOSPHERE
--------------------------------------------------------------
Particle has entered the ergosphere boundary.
  Ergosphere entry log length : 2
  Negative energy particle absorbed : -1.0
  Escaped particle surplus energy   : 1.0
  Energy gain from split      : 1.0
  Cycle 1: Energy extracted 0.828000 | Remaining spin 0.784000
  Cycle 2: Energy extracted 0.811440 | Remaining spin 0.768320
  Cycle 3: Energy extracted 0.795211 | Remaining spin 0.752954
  Cycle 4: Energy extracted 0.779307 | Remaining spin 0.737895
  Cycle 5: Energy extracted 0.763721 | Remaining spin 0.723137
  Total energy extracted      : 3.9776790124800003
Index Test Identifier Metric Description Result Value Quibble-Notes
1 Test 1 - HIGH SPIN ERGOSPHERE Ergosphere Log Length (steps) 2 Steps recorded before or at the ergosphere boundary
2 Test 1 - HIGH SPIN ERGOSPHERE Energy Gain from Penrose Split 1.000000 Net surplus above the original incoming energy value
3 Test 1 - HIGH SPIN ERGOSPHERE Total Rotational Energy Extracted 3.977679 Cumulative energy summed across all extraction cycles
4 Test 1 - HIGH SPIN ERGOSPHERE Test Execution Duration (milliseconds) 0 Wall-clock time measured by the Tcl clock command
AUDIT Test 1 - HIGH SPIN ERGOSPHERE Audit Window All four metrics captured No anomalies detected in test run 1

Note. All energy values are expressed in natural geometric units (G = c = 1). Results are illustrative and do not represent astrophysical-scale quantities. Effectively, energy values are normalized for tutorial purposes.


Alternate Text Note. This is a toy / illustrative simulation, not a full general-relativity computation. The numbers are in arbitrary / normalized units, very common in black hole simulations. Typically, these type simulations use geometric units where G = c = 1 and the black hole mass M is set to some convenient starting value (often 1 or 10 or ???). The theoretical maximum extractable rotational energy from an extremal (maximum spin) Kerr black hole is about 29% of its total mass-energy. So, extracting ~3.98 "energy units" makes rough sense as a multi-cycle process.


Note. Times from computer processes. Core simulation (arithmetic, loops, list operations) is extremely fast, often under 0.5 ms, milliseconds. The optimized buffering removed almost all previous I/O overhead. Therefore, many computer tests now complete faster than the timer’s resolution, resulting in rounded 0 ms, milliseconds. These times were added and used to test optimalization of the computer code and are not physical time measurements of the Hawking/Penrose physics.


The Tcl clock milliseconds command returns the current system time in milliseconds with millisecond granularity. Clock does not provide sub-millisecond precision. When the actual execution time of a computer timing test is less than 1 millisecond (which is now the case after output buffering optimization), the difference between start_time and end_time becomes 0.


Caution Note. Readers should note that these reported times serve only to evaluate the optimization of the computer code. These times do not represent any physical timescales in the Hawking or Penrose theoretical models.


Testing Draft Figures. Summary / Cycle View (Improved)


                  SUMMARY - PENROSE PROCESS

   [Incoming Particle]  ──→  Enters Ergosphere
                                 │
                                 ▼
                           Particle Splits
                                 │
               ┌─────────────────┼─────────────────┐
               │                                   │
               ▼                                   ▼
   Negative Energy Fragment               Positive Energy Fragment
          (Red)                                 (Green)
               │                                   │
               ▼                                   ▼
        Falls into Singularity               Escapes with Extra Energy
               │                                   │
               └─────────────── Energy extracted from BH spin ───────────────┘

   Efficiency limit (extremal Kerr): ~20.7% of rest mass energy
   Repeated cycles → Black hole spin-down

1. Refined Kerr Black Hole Structure (Equatorial View) 

                  KERR BLACK HOLE STRUCTURE
   Rotating Black Hole (Spin Parameter a/M)

                Ergosphere (Static Limit)
       ╔═══════════════════════════════════════╗
       ║                                       ║
       ║         EVENT HORIZON                 ║
       ║      #####################            ║
       ║    #########################          ║
       ║   ###########################         ║
       ║    #########################          ║
       ║      #####################            ║
       ║                                       ║
       ╚═══════════════════════════════════════╝

   • Inside Ergosphere: Frame-dragging forces co-rotation
   • No stationary observers possible relative to infinity
   • Ergosphere touches Event Horizon at the poles

2. Refined Frame Dragging (Lense-Thirring Effect) 

               FRAME DRAGGING IN THE ERGOSPHERE

              Distant Stationary Observer
                       ↑
                       │
       ╔═══════════════════════════════════════╗
       ║          ERGOSPHERE                   ║
       ║   →→→→→ Space-time dragged by spin →→→║
       ║                                       ║
       ║        EVENT HORIZON                  ║
       ║      #####################            ║
       ║    #########################          ║
       ╚═══════════════════════════════════════╝

   Any object inside the ergosphere MUST rotate with the black hole.
   This forced co-rotation enables the Penrose process.

3. Refined Penrose Process – Particle Split 

                     PENROSE PROCESS (1969)

                Incoming Particle (E > 0)
                       │
                       ▼
                Enter Ergosphere
                       │
                    SPLIT
                 ┌──────┴──────┐
                 │             │
                 ▼             ▼
     Negative Energy     Positive Energy
        Fragment             Fragment
          (Red)               (Green)
            │                   │
            ▼                   ▼
      Falls into BH       Escapes to Infinity
            │                   │
   Reduces BH angular    Carries E_original + ΔE
         momentum

4. Refined Energy Flow Diagram 

                 ENERGY EXTRACTION - PENROSE PROCESS

   Incoming Particle (Total Energy = E) 
             │
             ▼
      Split inside Ergosphere
          /               \
         /                 \
        /                   \
   Negative Energy      Escaping Fragment
     (falls in)         (E + surplus energy)

         │                       │
         ▼                       ▼
   Black Hole loses         Surplus Energy
  rotational energy          extracted
   (spin decreases)           to infinity

   Net Result: Rotational energy of the Kerr black hole is reduced.




gold 2/9/2026. Added categories, so can find message in Wiki.



Hidden Comments Section


Program Change Log

gold 2/3/2025. Testing, encountered initial difficulty in saving work? Long code blocks with or unmatched wiki markup can sometimes confuse the Tcl Wiki formatting engine, especially if fences are not balanced or a line begins with markup it treats specially.


gold 2/14/2026. Added Automatic Dump of Examples, Using ActiveState.


gold 2/14/2026. convert to strict 7-bit ASCII for Playground V9. reporting error at bottom. program should run to completion with automatic test suite.


gold 2/14/2026.



gold 3/7/2026. convert to strict 7-bit ASCII for Playground V9. variables need to be human readable and very explanatory. avoid variables with single letter names. Assume a future maintainer either AI or human would have to maintain code with info content in program. the program is working the numbers correctly . so minimal changes.


gold 5/23/2026. Forwarding Python version to other venue. The TCL version is posted here.


Matrix of Collatz solutions look like two swarms of bees rather a single linear solution or even look like multiple fuzzy levels of solution ranges, eg. non-linear solutions, observable in various pngs. You can tell me different. Based on long experience of fitting equations in engineering, possibly the probabilistic reasoning or pattern matching on quantum solutions plural is more adaptable.


gold 4/24/2026. Difficult for me to evaluate the Quantum math theories. The Python versions are posted in other venues. The TCL version is posted on wiki.


However, I suppose that the simulation model using TcL could check the Yada-Yada theory for consistencies with other vouched quantum rules. However, code seems interesting from a hack programming viewpoint. 





Please place any comments here with your wiki MONIKER and date, Thanks.gold 5/10/2026



Note. Testing computer methods and computer programs, maybe wrong numbers.