(Solved): 2. Swing up of a torque-limited pendulum using trajectory optimization: In this problem, we will co ...
2. Swing up of a torque-limited pendulum using trajectory optimization: In this problem, we will consider the problem of swinging up of the pendulum in minimum time Figure 1: Single link pendulum. Consider the pendulum shown in Fig. 1. The equation of the pendulum is ?¨=?sin?+u where ? is the angle as shown and u is the torque at the pin joint. The torque is bounded ?umax??u?umax?. The initial position and velocity of the pendulum are ?(t=0)=0 and ??(t=0)=0 where t is the time. The goal is to get the pendulum upright in the minimum amount of time T,?(t=T)=? and ??(t=T)=0. Formulate and solve the problem using either direct collocation or shooting method discussed in the class. (a) Formulate the optimization problem. Clearly define the objective, the constraints, and the optimization variables. (b) Program and solve the problem using scipy.optimize.minimize. Use umax?=1. Submit the cost, plots of the angle vs. time, angular velocity vs time, and torque vs. time. (c) Now re-solve the problem, but with umax?=0.25. Submit the cost, plots of the angle vs. time, angular velocity vs time, and torque vs. time.