# Matlab plots

## Homework Statement

Oscillation in mechanical structures can often be described by the function:

y(t)=(e^(-t/τ))*sin(ωt+θ)

Where t is time , ω is oscillation frequency in radians per unit time. The oscillations have a period of 2*π/ω and their amplitudes decay in time at a rate determined by τ which is called the time constant. THe smaller the value of τ the faster the oscillations die out/

## Homework Equations

a.) Use the above information to develop a criterion for choosing the spacing of t values and the upper limit on t to obtain an accurate plot of y(t). (Hint two cases: 4τ>2π/ω and 4τ<2π/ω)

b) Plot y(t) for τ= 10, ω=π and θ=2

c)Plot y(t) for τ= 0.1, ω=8π and θ=2

## The Attempt at a Solution

My attempt is below, however what is bothering me is question (a). A criterion for choosing the spacing values for t and the upper limit. ?? Can't figure it out and also the hint.. How is that related? I just played around with numbers, and got those plots.

tau=10;
omega=pi;
fi=2;
t=(-40:0.1:10);
f=(exp(-t./tau)).*sin(omega.*t+fi);
subplot(2,1,1)
plot(t,f)

tau2=0.1;
omega2=8*pi;
fi=2;
t=(-0:0.1:80);
f2=(exp(-t./tau2)).*sin(omega2.*t+fi);
subplot(2,1,2)
plot(t,f2)