Snapshot 1: the filtered trajectory and velocity are reconstructed in real time
Snapshot 2: at high measurement noise and long measurement interval, the accuracy of the filter deteriorates
Snapshot 3: it is possible to adjust the magnitude of the gravitational potential to be repulsive (negative), as well as to include an optional constant deceleration
The object (lunar module ) undergoes motion in a gravitational field, experiencing an acceleration
is the vector from the Moon  to the object,
is the strength of the potential, which you can vary to be either positive (attractive) or negative (repulsive), and
is a constant acceleration in the direction opposite the velocity of the object, which you can also vary. In the case of a collision between the object and the Moon, the object is stopped on the lunar surface; the walls of the box are reflective.
The Kalman filter is used to reconstruct the position and velocity of the object from noisy position measurements. For a detailed description of the Kalman filter, see e.g. [3, 4, 5]. Following the notation in , the model for the object's discrete time evolution can be expressed as
denotes the state vector,
denotes the noisy position measurements made,
is the process noise,
is the measurement noise, and
The measurement noise covariance matrix is assumed to be known:
is the two-dimensional identity matrix and
is the measurement noise variance, where
is the measurement noise variable that you set. The process noise covariance is given by
is the variance of the
component of the acceleration, and similarly for
. The variances are determined from a sample of the true accelerations experienced by the object (with sample size equal to the variable number of data points), although in practice this information is not available and other methods must be employed (see e.g. ).
To determine the performance of the filter, the MSE
is the true state vector of the object, is updated at each time step, whose expectation value is minimized by the filter.
 R. E. Kalman, "A New Approach to Linear Filtering and Prediction Problems," Transactions of the ASME Journal of Basic Engineering
(1, Series D), 1960 pp. 35-45. doi:10.1115/1.3662552