use runwhile maxtorque in standard problem 4