Simulation Environment Simulation program consists of three functions main() : Main function diff_eqs() : State equation link_eqs() : Output equation and controller Inverted Pendulum: