This document describes a numerical simulation of an inverted pendulum system created in MATLAB using a 4th order Runge-Kutta algorithm. The simulation models an inverted pendulum attached to a horizontally moving cart. Forces like air drag and friction are included, and parameters like mass, pendulum length, and initial conditions can be varied. Small changes to initial conditions can lead to large differences in motion, demonstrating the system's chaotic behavior. The document also outlines the methodology for adapting the Runge-Kutta algorithm to solve systems of coupled differential equations.