Simulation and control of the Rotary Inverted Pendulum (RIP) in Matlab Simulink/Simscape.