This model consists of a subsystem called ActualPendulum that is a pendulum with the applied torque as an input and the angle and angular velocity as outputs. This model was linearized using the "PendulumLinearization" worksheet attached in the Document Folder. It was linearized about the equilibrium position of 0 rad (hanging straight down). The result of this linearization is the state-space representation contained in "LinearizedPendulum.msys". This file is then loaded into "PendulumLQRWorksheet", where the LQR cost matrices are specified and the results are loaded back into the model. The resulting gains are located in the Parameter Block on the right. The controller is applied continuously to the pendulum located at the origin, and discretely using a discrete sampler.