Professional Documents
Culture Documents
\
|
= sin
max
An alternate representation of the motion is given by
f is the cyclical frequency or the number of cycles per unit
time. It is typically given in units Hz or cycles per second.
And a third representation is given by
e is the angular frequency and is given in radians per unit
time.
( )
T
f
t f
1
2
=
= t u u sin
max
( )
T
f
t
t
t e
e u u
2
2 = =
= sin
max
close all;
clear;
clc;
format compact;
g = 9.807;
L = input('enter pendulum length (m): ');
thetaMax = input('maximum angle (deg): ');
T = 2*pi*sqrt(L/g);
f = 1/T;
omega = 2*pi/T;
disp('period (secs): ');
disp(T);
disp('cyclical frequency (Hz): ');
disp(f);
disp('angular frequency (rad/s): ');
disp(omega);
dt = T/100;
for i = 1:1:101
t(i) = (i-1)*dt;
theta(i) = thetaMax * sin(omega*t(i));
end
plot(t,theta);
xlabel('time (s)');
ylabel('angular displacement (deg)');
title ('Pendulum Motion');
Create the m-file shown and save it as
pendulum.m
Note that one period of the motion is
divided into 100 equal time steps.
Including the angular displacement at the
starting time or t = 0 results in 101 values for
the time and angle vectors.
We are plotting theta (y-axis) vs. t (x-axis)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
-30
-20
-10
0
10
20
30
time (s)
a
n
g
u
l
a
r
d
i
s
p
l
a
c
e
m
e
n
t
(
d
e
g
)
Pendulum Motion
enter pendulum length (m): 5
maximum angle (deg): 30
period (secs):
4.4864
cyclical frequency (Hz):
0.2229
angular frequency (rad/s):
1.4005
Execute pendulum.m and verify that you can
get the results shown for a pendulum length
of 5 m with a maximum angular deflection of
30 deg.
close all;
clear;
clc;
format compact;
tau = 40;
dt = 3*tau/100;
for i = 1:1:101
t(i) = (i-1)*dt;
a(i) = exp(-t(i)/tau);
end
plot(t,a);
xlabel('time (s)');
ylabel('amplitude');
title('Exponential Decay');
Another functional form that appears frequently in
physics and engineering is the exponential
When the coefficient in the exponent is negative, the
exponential asymptotically approaches zero for large
values of t. This provides a mathematical description for
processes that decay or are attenuated over time.
For decaying processes, it is common write the
exponential in terms of a time constant
where t (tau) is referred to as the time constant.
Note that when t = t
or, the parameter y has been attenuated to 36.8% of its
value at t = 0
Create the program shown and save it as exponential.m
(note: time constant is set to 40 s)
bt
Ae y =
t
t
e y
=
368 0
1
. = =
e y
0 20 40 60 80 100 120
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
time (s)
a
m
p
l
i
t
u
d
e
Exponential Decay
Execute exponential.m and verify that you
can get the results shown.
Note that the amplitude has been reduced
to 0.368 at t = 40 s as expected.
0 5 10 15 20 25 30 35 40 45
-30
-20
-10
0
10
20
30
time (s)
a
n
g
u
l
a
r
d
i
s
p
l
a
c
e
m
e
n
t
(
d
e
g
)
Pendulum Motion
enter pendulum length (m): 5
maximum angle (deg): 30
time constant (s):20
period (secs):
4.4864
cyclical frequency (Hz):
0.2229
angular frequency (rad/s):
1.4005
The exponential and sine functions can be
combined to represent the motion of a
damped pendulum, i.e., a pendulum that
is affected by friction.
The exponential function creates an
attenuation envelope which reduces the
amplitude of the oscillations over time.
Create a new Matlab m-file called
dampedPendulum.m that will generate
the results shown for a pendulum length
of 5 m, initial deflection angle of 30 deg,
and a damping time constant of 20 s.
For the calculations, the time increment
was set to 1/100 of the period of the
oscillation. The total time for the
calculation was set to 10 oscillation
periods for a total of 1001 time steps.
( ) t e
t
e u u
t
sin
max
=
Assignment:
Complete and submit the following m-files:
plot1.m
plot2.m
plot3.m
pendulum.m
exponential.m
dampedPendulum.m