E-Code

Black hole: horizon, shadow and a ray-traced image, step by step — a TI-89 Titanium program

By E-Code · updated

HORIZON is a TI-89 BASIC program for the TI-89 Titanium. A black hole in the textbook model (Schwarzschild, light bent by u''=3u²−u, a thin disk from 6M to 20M) from its mass, distance and your view angle. Seven steps: the event horizon, the shadow's size seen from Earth (beside the EHT's 51.8 µas for Sgr A*), light bending traced ray by ray on the graph screen, the innermost stable orbit and how clocks slow down, a ray-traced picture of the black hole and its disk, the tides at the horizon, and Hawking's temperature and lifetime.

The picture has two settings: quick (one ray per 4×4-pixel cell, the default: about half an hour on a real TI-89) or full (158×76 pixels, 6004 rays: about 4 hours on a TI-89, about a minute in E-Calc).

What it asks for and what it shows

It asks for 3 values at its prompts, after you pick option 1 from its menu. In the example below it shows HORIZON · TEXTBOOK MODEL, Schwarzschild, G, r in M, so rs, light: u'', thin disk from 6M to 20M, rays: RK4 on lists, STEP 1 OF 7: EVENT HORIZON, rs, 4.297 million suns:, STEP 2 OF 7: THE SHADOW, photon sphere r, seen from 8277 pc:, EHT 2022: 51.8+/-2.3 µas, STEP 3 OF 7: LIGHT BENDING, STEP 4 OF 7: ISCO + TIME, clocks (far, STEP 5 OF 7: THE IMAGE, RK4: 100+100 steps each, 4×4 cells, view 80°, 4×4 dither: 17 shades, STEP 6 OF 7: TIDES, stretch Δa, at the horizon, L, STEP 7 OF 7: HAWKING, T, HORIZON · SUMMARY, you'd feel nothing.

Example run

One of its oracle test cases. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Menuoption 1
Input 14.297
Input 28277
Input 380
The screen shows
TextHORIZON · TEXTBOOK MODEL
Schwarzschild, G=c=1:
r in M, so rs=2M
light: u''=3u²-u, u=M/r
Textthin disk from 6M to 20M
Textrays: RK4 on lists
TextSTEP 1 OF 7: EVENT HORIZON
rs=2GM/c²
Text4.297 million suns:
TextSTEP 2 OF 7: THE SHADOW
photon sphere r=1.5 rs
Textseen from 8277 pc:
TextEHT 2022: 51.8+/-2.3 µas
TextSTEP 3 OF 7: LIGHT BENDING
TextSTEP 4 OF 7: ISCO + TIME
clocks (far=1):
TextSTEP 5 OF 7: THE IMAGE
TextRK4: 100+100 steps each
Text4×4 cells, view 80°
Text4×4 dither: 17 shades
TextSTEP 6 OF 7: TIDES
stretch Δa=2GML/r³
at the horizon, L=2 m:
TextSTEP 7 OF 7: HAWKING
T=hc³/(16π²GMk)
TextHORIZON · SUMMARY
Textyou'd feel nothing

How it's checked

6 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 355 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-89 Titanium physics programs · All TI-89 Titanium programs