I hope this is the right place to post. I am trying to simulate an inverted pendulum as seen in the picture using simulink, it is supposed to balance by applying momentum with a DC-motor. I have used the equation in the picture to make the block diagram and the result of the running the simulation with initial value θ=10deg and M=0 is seen in the plot. It seems to be accurate the first 8 seconds but then somethings happen and I don't know what, is there anybody that can help me? What have i done wrong?