E-Code

Asteroid deflection by a kinetic impactor, step by step — a TI-89 Titanium program

By E-Code · updated

IMPACT89 is a TI-89 BASIC program for the TI-89 Titanium. Planetary defence, the classic course problem, in the textbook model (coplanar two-body orbits: Earth on a circle at 1 AU, the rock on a 1.2 AU, e=.25 orbit that meets Earth). From the rock's size and density and the impactor's mass, speed, ejecta boost β and lead time.

Five steps: the rock's mass, impact speed and energy in megatons; Earth's capture radius (gravitational focusing); the push Δv=βmU/M; the lever (Kepler's equation back to where the rock was pushed, the new orbit by vis-viva, the delay growing every lap), with the orbits drawn on the graph screen; and the miss in the b-plane, drawn too, or a warning that it still hits.

What it asks for and what it shows

It asks for 6 values at its prompts. In the example below it shows IMPACT · TEXTBOOK MODEL, coplanar two-body orbits, Earth: circle r, push along track; b-plane, STEP 1 OF 5: THE THREAT, STEP 2 OF 5: EARTH'S PULL, b, unpushed: b, STEP 3 OF 5: THE PUSH, impactor 2000 kg, 10 km/s, ejecta boost beta 3, Δv, STEP 4 OF 5: THE LEVER, STEP 5 OF 5: THE MISS, IMPACT · SUMMARY.

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
Input 1150
Input 22000
Input 32000
Input 410
Input 53
Input 612
The screen shows
TextIMPACT · TEXTBOOK MODEL
Textcoplanar two-body orbits
Earth: circle r=1 AU
Textpush along track; b-plane
TextSTEP 1 OF 5: THE THREAT
TextSTEP 2 OF 5: EARTH'S PULL
b=R√(1+ve²/v∞²) focusing
unpushed: b=0 → IMPACT
TextSTEP 3 OF 5: THE PUSH
Textimpactor 2000 kg, 10 km/s
Textejecta boost beta 3
Δv=beta·m·U/M
TextSTEP 4 OF 5: THE LEVER
TextSTEP 5 OF 5: THE MISS
TextIMPACT · SUMMARY

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 221 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