In this article, the author used the matlab software to simulate and then compared the results between the classical LQR (Linear Quadratic Regulator) controller and another method to adjust the matrix parameters toward optimization of the LQR controller. It is the GA (Genetic Algorithm) method to optimize the matrix of the LQR controller, and the results have been verified on the nonlinear pendulum model. The Genetic Algorithm is a modern control algorithm, which is widely applied in research and practice. The main objective of this article is to use the GA algorithm in order to optimize the matrix parameters of LQR controller, whichcontrolled the position and angle of the nonlinear inverted pendulum at the stable balance point. The matlab-based simulating results showed that the system has operated properly to the requirements and the output response has reached an equilibrium position of about 2.5 seconds.