An Application of Numerical Analysis To Science Fiction

In the 1987 film Predator, the Predator species uses an adaptive Runge-Kutta predictor-corrector[1] to calculate the location of Dutch (Arnold Schwarzenegger).

Dutch throws a stone to locate the Predator's position at movie time 1:31:14. The Predator immediately takes a snapshot of the moving target and identifies the source of movement at 1:31:19 and shoots immediately at this location, but then, while Dutch is trying to locate the Predator, the Predator realizes that the source of movement is inanimate (no thermal radiation). He then proceeds to calculate Dutch's position using an iterative Runge-Kutta method at 1:31:32:

runge-kutta predictor 1
Predictor starts at movie time 1:31:32, with stone data

runge-kutta predictor 2
Predictor continues with Runge-Kutta iterative

runge-kutta predictor 3
Iterative predictor continues...

runge-kutta predictor 4
Until...

runge-kutta predictor 5
Method converges to a hideout point

The next two images, show the calculational details of the iterative predictor. The first image was created by overlaying a necessary number of subsequent frames onto the first frame to discern clearly the calculation of the initial parameters, while the second image was created by overlaying the 60 subsequent frames onto another image, while keeping the background fixed in both cases[2]. They show the full extent of the predictor's trajectory all the way to the point of convergence. The calculation sequence is shown in reverse, because time is reversed for the Predator (t'=-t), as it has to calculate the point of stone launching.

runge-kutta predictor initial guess
Initial guess for predictor

convergence of runge-kutta predictor to target
Convergence of predictor to target

The red line is always y'=f(t,y) of the initial value problem {y'=f(t,y),y(t0)=y0}. The calculation shows the solution to some interesting problems. The Predator has at its disposal y0. This is the source of sound and movement (first hit of the stone against the rock).

This datum however is 1-dimensional, so the predictor cannot start by using only this. A second datum has to be calculated and this is the shooting angle θ. Assuming Dutch does not throw the rock normally against the rock, the trajectory of the stone can be visualized on the Predator's visor plane approximately as a parabola as follows:

stone trajectory
Trajectory of stone and stone bounces on rock

This second datum is then obtained from the stone snapshot: The stone bounces several times against the rock, at points A, B, C, D, etc. This means not only that the rock has an inclination 0< φ<π/2, relative to the visor's plane, but also that there is a horizontal displacement between the successive bounce points A, B, C, etc., because of the conservation of the trajectory on this plane. The Predator then needs only points A and B from the snapshot, to approximate the shooting vector as vector BA[3]. The normal to BA is line ε, which is precisely the stone data line on the first image.

Once the Predator has an approximation to the inclination ε, he immediately has an approximation for the shooting angle θ, in which case the predictor can start its calculation. Let's follow the calculation of the predictor with Maple, using the classic projectile trajectory. Note that in this case, the initial value problem differential equation y'=f(t,y) reduces to y'=f(t), since y is a simple parabola:

> with(plots):
> theta:=2*Pi/3;#(assumed) calculated shooting angle from stone data
> v:=20;#m/s#(assumed) calculated launch speed from stone bounce points A and B (abs(BA))
> g:=9.81;#m/s^2 gravitational constant
> x:=t->v*cos(theta)*t;#x-coordinate of projectile trajectory
> y0:=10;#m Dutch's stone launching height
> y:=t->y0+v*sin(theta)*t-1/2*g*t^2;#y-coordinate of projectile
> at:=plot(y(t),t=0..2.5):#actual trajectory
> f:=unapply(diff(y(t),t),t,y);#Runge-Kutta derivative for initial value problem
> RKP:=proc(yn,tn,h)#Runge-Kutta predictor RK4
> local k1,k2,k3,k4;
> k1:=f(tn,yn);
> k2:=f(tn+1/2*h,yn+1/2*h*k1);
> k3:=f(tn+1/2*h,yn+1/2*h*k2);
> k4:=f(tn+h,yn+h*k3);
> yn+1/6*h*(k1+2*k2+2*k3+k4);
> end:
> h:=0.1;#step size
> RKPT:=proc(y0,t0,h)#construct list of points of predicted trajectory
> local T,tn,yn,n;
> yn:=y0;tn:=t0;
> T:=[[tn,yn]];
> for n from 1 to floor(abs(3/h)) do
> tn:=tn+h;yn:=RKP(yn,tn,h);
> T:=[op(T),[tn,yn]];
> od;
> T;
> end:

> t0:=2.5;# final t of trajectory (reversed time!!)

> PT:=RKPT(y(t0),t0,-h):#make predicted trajectory list
> p:=plot(PT,style=point,symbol=cross,color=blue):
> display({p,at});#display both

actual trajectory of stone and predicted trajectory
Actual trajectory of stone (red) and RK4 predicted trajectory (blue), for a step size of h=0.1 secs

Note that because there are several approximations (launch angle, launch speed, inclination angle and finite step size h), the predictor misses the exact position by a little bit and Dutch is not hit[4][5].

Notes

  1. Numerical Runge-Kutta predictor-corrector algorithms are often employed in the study of predator-prey systems evolution as a function of time.
  2. It can be seen in the movie that during the entire calculation the Predator moves his head (viewer), because the background shifts until the target is reached. Therefore, when overlaying those images there is a shifting error when keeping the background fixed. The Predator's head movement doesn't affect the calculation however, because the predictor can compensate for relative motion, by adding or subtracting the visor's movement.
  3. Because the Predator takes a snapshot after he detects the sound from the rock hit A, it is conceivable that he uses the vector CB instead, since point A may not be recorded in the snapshot.
  4. To see a Spectroscopy application on the same science-fiction subject, click here.
  5. To see a Color Matching application on the same science-fiction subject, click here.

Back to Mathematics

web stats

Valid HTML 4.01 Transitional