# The Extended Kalman Filter: An Interactive Tutorial for Non-Experts

### Part 10: Adding Velocity to the System

Recall our original equation for the altitude of an airplane:

altitudecurrent = 0.98 * altitudeprevious

with the more general form: $x_k = a x_{k-1}$ Thinking back to the math and physics you may have learned in high school, this kind of formula seems a bit odd. Altitude, after all, is a kind of distance (above sea level, or above ground level), for which we learned the formula

distance = velocity * time

Can we reconcile these two different ways of thinking about distance? The answer is yes, but it will require us to take two steps.

First, we need to introduce the concepts current time and previous time into our high-school formula, and think about distance in discrete time steps rather than overall distance:

distancecurrent = distanceprevious + velocityprevious * (timecurrent - timeprevious)

In other words, where we are now is where we were a moment ago, plus the distance we just traveled. If we perform this computation at regular time intervals, or timesteps (one second, 100 nanoseconds, six months, etc.), then we can simplify this to:

distancecurrent = distanceprevious + velocityprevious * timestep

This equation moves us closer to our general form $x_k = a x_{k-1}$ but we still seem to have two very different systems: one involves a simple product, and the other involves a product and a sum. Coming up with a general equation for both brings us the second step: linear algebra.