Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

An objects travels with an undamped oscillatory motion based on the following fo

ID: 3871916 • Letter: A

Question

An objects travels with an undamped oscillatory motion based on the following formula:

x=2sin(3.2t)+1.8cos(3.2t)

where: t is time in seconds

x is location in inches

Using MATLAB write a script file to compute the location of the object every 2 seconds over a time interval of 200 seconds (0 t 200 seconds ). Plot the location as a function of time.

The script file should also calculate:

a) the amplitude (the distance between the highest and lowest points of the oscillation).

b) the period of the oscillations; equal to twice the time it takes to travel from the highest point to the lowest point.

Explanation / Answer

x=(0:100)                                                                                //declaring x vector
t1=(0:2:200)                                                                             //time vector
j=1
for t=0:2:200
    x(j)=2*sin(3.2*t)+1.8*cos(3.2*t)                                                  //calculating distance
    j=j+1
end
display(x)                                                                                         //displaying x vector
amp=max(x)-min(x)                                                                           //calculating amplitude
period=2*amp                                                                                   //calculating period
fprintf("amp:%f..period:%f ",amp,period)                                                //printing those two values
plot(t1,x)                                                                                          //plotting time vs distance.