0% found this document useful (0 votes)
61 views2 pages

HW 2

This homework assignment is from a dynamics and control course at MIT. It contains 3 problems: 1) creating matrices with elements based on row and column numbers, 2) creating an array of integers between 1-100 not divisible by 2, 3, or 7, and 3) calculating velocity and acceleration from trajectory data using a for loop and the diff function. Students are instructed to submit an m-file with their solutions and variable assignments. The document discusses using a neighboring point approach to calculate derivatives and asks students to explain if this is a good method in the presence of noise.

Uploaded by

Vaibhav Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

HW 2

This homework assignment is from a dynamics and control course at MIT. It contains 3 problems: 1) creating matrices with elements based on row and column numbers, 2) creating an array of integers between 1-100 not divisible by 2, 3, or 7, and 3) calculating velocity and acceleration from trajectory data using a for loop and the diff function. Students are instructed to submit an m-file with their solutions and variable assignments. The document discusses using a neighboring point approach to calculate derivatives and asks students to explain if this is a good method in the presence of noise.

Uploaded by

Vaibhav Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Massachusetts Institute of Technology

Department of Mechanical Engineering

2.003J/1.053J Dynamics & Control I

Fall 2007

Homework 2

Issued: Sep. 14. 2007 Due: Sep. 21. 2007

Problem 2.1 : Matrix creation with loop


i) Create a 5×5 matrix in which each element has a value equal to the sum of its row and
column numbers.
ii) Create a 5×5 matrix in which each element has a value equal to the square of the sum of
the element’s row and column numbers.

Problem 2.2 : Matrix creation with conditional


Make a one dimensional array that contains all integers in the range of 1 to 100 that are not
divisible by 2, 3, and 7.

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].

You might also like