MATLAB Project - Elbow

Project tasks

5. MATLAB calculations

MATLAB calculations involving the angles θ(t) and φ(t), the angular velocities θ'(t) and φ'(t), and the midpoint C of PB. Write one long script M-File named mech.m which does all the following tasks.

(a) Use fplot to graph the angles θ(t) and φ(t), on the same axes over two cycles. You must include a legend, labels on the axes and a title.

(b) Use diff in the symbolic toolbox to find the angular velocity θ'(t) of the lever AP (in rad/sec), and then uses ezplot to graph the angular velocity over two cycles. In the main part of your report, write a sizeable paragraph to explain fully the information derived from this graph.

(c) Use fminbnd to determine the minimum value of θ'(t) and the first time it occurs, and then calculates the total distance (in cm) travelled by P in a single cycle.

(d) Use fminbnd to determine the maximum value of the angular velocity of the lever AP and the first time it occurs.

(e) Use fzero to verify the first time when the angle φ is a right angle and the second time the angle θ=π, and then finds the first two times when the angle θ is 60 degrees.

(f) Plot the path travelled by C, the midpoint of the lever PB, during one complete cycle.

You must also include the dotted circle and line shown in the simulation so that the path of C can be seen in context. (Use the same type of plotting commands as in Q2. Do not plot the path point by point in a loop.)