Kalman Filter Playground

Learn algorithmic concepts through interactive pendulum simulation

Introduction to Simple Pendulum

A simple pendulum is a fundamental physical system consisting of a mass attached to a lightweight rod. When the pendulum moves, it performs a periodic motion under the influence of gravity.

The pendulum serves as an excellent example of a dynamic system where we can apply Kalman filtering for tracking and prediction.

Physics of the Pendulum

The motion of a simple pendulum is described by a second-order differential equation:

\[\frac{d^2\theta}{dt^2} + \frac{g}{L}\sin(\theta) = 0\]

Where:

For small angles (θ < 15°), we can approximate the equation to:

\[\frac{d^2\theta}{dt^2} + \frac{g}{L}\theta = 0\]

This becomes a simple harmonic oscillator with angular frequency:

\[\omega = \sqrt{\frac{g}{L}}\]

And the period (time for one complete oscillation) of the pendulum is:

\[T = 2\pi\sqrt{\frac{L}{g}}\]

Interactive Pendulum Simulation

Adjust the various parameters and see how they affect the pendulum's motion:

1.0
9.8
30
0.02
Period
2.0 s
Energy
0.0 J
Pendulum Reference Line

Tracking the Pendulum State

To understand the Kalman Filter algorithm, we'll start by understanding the system state. The state of the pendulum can be described by a two-component vector:

\[x = \begin{bmatrix} \theta \\ \dot{\theta} \end{bmatrix}\]

Where:

In the following sections, we'll see how the Kalman Filter algorithm allows us to track this state even when our measurements are noisy or incomplete.