Inverted Pendulum Modeling