Project tasks

5. function.m files

Create three function M-files phi.m , angvel.m , angacc.m , to represent the angle φ(t) [radians], the angular velocity φ'(t) [radians/sec] and the angular acceleration φ''(t) [radians/sec2]. Others may be needed later. Write one script M-le named mech.m which

  • uses diff in the Symbolic Math Toolbox to nd simple expressions for φ'(t) and φ''(t) which can be copied into the function M-les mentioned above.
  • uses plot to plot the distance s(t) over one cycle.
  • uses fplot to plot separately the angle (t), the angular velocity φ'(t) and the angular acceleration φ''(t), over one cycle starting at t = 0.
  • uses fminbnd to determine the maximum and minimum values of the angular acceleration φ''(t)(and times). (These are often needed by engineers to determine extreme forces.)
  • uses fzero to find the first two times t1, t2 when the angle is forty-five degrees, and then calculates the angular velocity at each time.
  • calculates, in a single cycle, the total time spent by the driven link moving to the left, and also moving to the right. (There are various ways you could do this).