HW 2
HW 2
Fall 2007
Homework 2
Problem 2.3 : Velocity and acceleration profile calculation from the ball trajectory
Use the same trajectory file, ‘ball.mat’ from the last homework. Time(t) and trajectory(x)
are from the first and the second columns, respectively. Write an m-file to calculate the ball’s
velocity and acceleration in two different ways. You should follow the below guidelines to make
m-file. (Otherwise, you may lose point.)
You should submit only m-file through the MIT Server site.
Your m-file name should be ‘HW023_your_Kerberos_name’(For example, it
should be‘HW023_ptso.m’ with e-mail address of [email protected])
In the first line of m-file, ‘function [v1,a1,v2,a2,t]=HW023’ should be
added.
You can also start by downloading and using the template m-file from the MIT Server
site (HW023.m)
Cite as: Peter So, course materials for 2.003J / 1.053J Dynamics and Control I, Fall 2007. MIT OpenCourseWare
(http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].
i) Write a “for” loop and calculate the difference between adjacent points. For examples,
x(i +1) − x(i)
v(i) ≈
t(i +1) − t(i)
Velocity and acceleration should be assigned to the variables ‘v1’ and ‘a1’
respectively.
ii) Use the MATLAB function ‘diff’. Velocity and acceleration should be assigned to the
variables ‘v2’ and ‘a2’ respectively.
Is this neighboring point approach good in the presence of noise? Explain it.
Cite as: Peter So, course materials for 2.003J / 1.053J Dynamics and Control I, Fall 2007. MIT OpenCourseWare
(http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DD Month YYYY].