... The Programmer God ...
A simulation universe hypothesis at the Planck scale




if we assign geometrical objects to mass, space and time,
and then link them via a unit number relationship, 
we can build a physical universe from mathematical structures.



The simulations mentioned in the article and on the wiki-site are given here. I will list the source codes on the directory /codes but with the explanation below. I also have to do some debugging of the codes so from now I will date them to show the latest version; dd-mm-yy. Everything should be updated by end of Nov.

The simulation codes are written in C, the analysis programs in python and gnuplot. Python is too slow for the math and C too clumsy for plotting. I use codeblocks for my C compiler and Spyder for python but there are many online compilers. The codes here can be used under creative commons CC CC BY-NC-SA 4.0. This permits modifications to the code with attibution to the author.

This page assumes that the reader is already familiar with articles #3 and #4 (gravity and the atom) and/or the gravity wiki page. The following sections refer to different aspects (2-body orbits, elliptical orbits, transition orbits ...), but the orbital function itself in each program is the same. I have separated them simply to keep the code and the concept easier to follow (or we end up with a lot of menus). 

The model is designed to represent events at the Planck scale and so the mathematics is simple but computationally intensive. The core concept behind this approach is that the universe does not require an external set of commands, rather it could be a geometrically autonomous computer; electrons orbit protons, not because of an external function (a set of pre-programmed rules as with our simulations), but due to geometrical imperatives, the respective geometries of the electron and proton leading to these orbits. The incremental expansion of the universe does the rest (as it expands it pulls the particles with it).

Main variables (2-body orbits):
ipoints: number of points in the central mass (the Scwharzchild radius)
jpoints: total number of points (in a 2-body orbit, the orbiting point is 1 mass unit; jpoints = ipoints +1)
kr: sets orbital radius as multiples of ipoints (multiples of the Scwharzchild radius)
x[0], y[0]: start coordinates for the orbiting point
x[1], y[1]: start coordinates for the orbited mass center point (some simulations have x[1], y[1] and x[2], y[2]). The other center mass points are placed symmetrically around this point, this gives me a center of the center mass without having to recalculate the center for each rotation (however it assumes the orbit is always stable).         

The Kepler derivation I have put here in Maple code format so that it is easy to confirm.

Note: the simulation itself doesn't distingush between points, they all rotate around each other and so the points may also be assigned random co-ordinates for complex orbits. The 2-body orbit is however the most convenient for comparison with real-world orbits. Comments and suggestions are welcome, the code is not optimized, further improvements to the averaging and orbital stability can be added but these must reflect the geometrical autonomy of the model. 




1. 2-body orbits

The simulation Gravitational-orbital-simulation-2body.c simulates a single point orbiting a central mass. The calculated period and length of orbit are then compared with the simulation data to confirm that the calculation formulas do accurately represent the orbital data. Once this is established, these formulas can then be applied to simulating real world orbits. The earth-moon orbit is an example, as well as the Kepler derivation of G. Setting variable kr = 32 is probably the maximum radius for long double precision. Gnuplot can be used for animations.          


2. 2-body elliptical orbits

The simulation gravitational-orbital-elliptical-orbits.cpp is the same program as above but with an extra function, orbitals can travel either clock-wise or anti-clockwise. By choosing the ratio of clock-wise:anti-clockwise orbitals the degree of eccentricity can be controlled. The ratio 108:1 (kcurve = 108) gave an eccentricity close to Mercury. 
Main variables:
kcurve //0 = circular, 1 = straight line, 9999... = circular
direction //(1 anticlockwise, -1 = clockwise)
cycle //number of orbits to repeat

To extrapolate to mass = infinity for comparison with Mercury's orbit Gravitational-orbital-ellipse-extrapolate.py was used.



3a. Hyperbolic spiral - Rydberg

The simulation Rydberg-atom-transition-series-plot.py calculates hyperbolic spiral n-levels for a theorectical Rydberg atom (an atom with nucleus of point size and of infinite mass). It also generates a animation to show how the 2-photon model works. 


Needs to be updated, I am travelling at the moment but should be online by end Nov.



3b. Hyperbolic spiral - electron-proton simulation

Here we use the 2-body gravitational orbit simulation where the electron is the orbiting point and the proton is the central mass Hatom-transition-series.c. The gravity simulator is modified with an extra alpha component for the rotation angle. Also after each rotation the radius will expand by 1 alpha step. The data is then saved further analysis.

Needs to be updated, I am travelling at the moment but should be online by end Nov.




4. Orbital vs. Newton

A simple 3-body orbit was generated to compare this orbital model with a Newtonian generated orbit.
1. Newton-vs-Orbital_Orbital.py generates the data file data-3b-long.txt
2. Newton-vs-Orbital_Newton.py generates the corresponding orbit using the Newtonian leap-frog, as shown Newton-vs-Orbital-trajectory_comparison.png.