Adapting the code for forcing the rotor to take an initial angle.