Supplementary material for the paper "Cosmology from the two-dimensional renormalization group acting as the Ricci flow" (one pdf file showing calculations and three SageMath notebooks performing numerical calculations).
8.5 Numerical calculation of the invariant
This SageMath notebook uses the optional TIDES package which provides an arbitrary precision ode solver.
To add the TIDES package to SageMath (on a unix machine) run in a shell     $ sage -i tides as instructed at http://doc.sagemath.org/html/en/reference/misc/sage/misc/package.html
Definitions
Integrate the ode from large to somewhat larger to see the instability of the separatrix
Calculate the large expansion of to order 100
Choose (arbitrarily). The function separatrix(,) uses the large expansion at to calculate the initial condition, then integrates the ode to .
Points are pruned from the trajectory when the ode runs away. The value of is chosen by trial and error to capture the instability.
try higher order 120 in the large expansion
The instability shows up very slightly later in , suggesting that the higher order expansion might be slightly more accurate at placing the initial point on the separatrix.
Now integrate backwards in to find the separatrix at large . Choose the earliest such that the solver does not run away (i.e., no points are pruned).
Get the earliest point on the trajectory.
Integrate foward from that earliest point until just before runaway.
Plot the points on the trajectory with , displaying the instability.
Perturb the initial point very slightly to display the instability in both directions.
The difference in the initial values is . This is much smaller than the tolerance parameters of the ode solver.
Define a function to calculate the double expansion to and a function to use to calculate .
For one of the two trajectories bracketing the separatrix, calculate at the earliest point for several values of .
Check that the expansion improves with for small .
Evaluate the deviation in along the early part of the separatrix, i.e., small , large to check the accuracy of the expansion of .