It is known that link P1A has the angular velocity and acceleration of 8 rad/s and 20 rad/s2, respectively, both counterclockwise. P1 and P2 are on the same horizontal line and attached to the ground.
a) Using the four-bar linkage as mentioned in the figure above, write a computer program to find the angle (BP2P1) with input is the angle (AP1P2). The explanation for your codes should be provided in the solutions in addition to the comments in your codes.
b) Using the data generated from program in question a, plot a graph showing the relationship between output angle (BP2P1) with input angle (AP1P2) and a graph showing trajectories of point A and B in their operational working range. Please explain your approach.