You are on page 1of 8

%.........................................................................

% MT11
% Harmonic forced vibration - Example 4.2 Craig P 91
%.........................................................................
clear all
clc
format compact
%
display(horzcat('Harmonic forced damped vibration - Example 4.2 Craig P
91'))
%
syms m k c p_0 real
syms Omega A1 A2 omega_n omega_d real
syms U_0 U_dot_0 U_st r t zeta alpha real
% Damped displacement response
display(horzcat('Damped displacement response'))
p=p_0*cos(Omega*t)
omega_n=sqrt(k/m)
r=Omega/omega_n
U_st=p_0/k
omega_d=omega_n*sqrt(1-zeta^2)
c_crit=2*m*omega_n
c=zeta*c_crit
U=U_st/(sqrt((1-r^2)^2+(2*zeta*r)^2))
alpha=atan(2.*zeta*r/(1-r^2))
u_c=exp(-zeta*omega_n.*t)*(A1*cos(omega_d.*t)+A2*sin(omega_d.*t))
u_p=U.*cos(Omega.*t-alpha)
u=u_c+u_p
% Velocity response
display(horzcat('Velocity response'))
u_dot_c=diff(u_c,'t')
u_dot_p=-Omega*U.*sin(Omega.*t-alpha)
u_dot=u_dot_c+u_dot_p
% Acceleration response
display(horzcat('Acceleration response'))
u_ddot_c=diff(diff(u_c,'t'),'t')
u_ddot_p=-Omega^2*U.*cos(Omega.*t-alpha)
u_ddot=u_ddot_c+u_ddot_p
% Stiffness damping and mass
display(horzcat('Stiffness, mass and damping'))
k=7000
m=17.5
zeta=0.02
c=subs(c)
% Angular frequency
display(horzcat('Angular frequency'))
omega_n=subs(omega_n)
% Damped natural angular frequency
display(horzcat('Damped natural angular frequency'))
omega_d=subs(omega_d)
% Static displacement
display(horzcat('Static displacement'))
p_0=45
U_st=subs(U_st)
% Ratio r
display(horzcat('Excitation ratio r'))
Omega=10
r=subs(r)
U=subs(U)
display(horzcat('Phase angle'))
alpha=subs(alpha)
alpha_deg=180.*alpha/pi
% Solve for constants A1 and A2
% Displacement and velocity initial conditions
display(horzcat('Displacement and velocity initial conditions'))
t=0
u_0=0.00
u_dot_0=0.00
t=0
A1=vpa(solve(subs(u)-u_0,A1),16)
A2=vpa(solve(subs(u_dot)-u_dot_0,A2),16)
% Plot response
display(horzcat('Plot response'))
tmin=0
tmax=1.5
np=101
tval=linspace(tmin,tmax,np);
t=tval;
% Homogenous solution
display(horzcat('Homogenous solution - Displacement'))
u_c_plot=vpa(subs(u_c),16)*1000.;
u_c_plot=subs(u_c_plot);
% Particular solution
display(horzcat('Particular solution - Displacement'))
u_p_plot=vpa(subs(u_p),16)*1000;
u_p_plot=subs(u_p_plot);
u_plot=u_c_plot+u_p_plot;
z=t*0.0;
figure(1)
clf
plot(t,u_c_plot,'k');
hold on
plot(t,u_p_plot,'k');
hold on
plot(t,u_p_plot,'k+',t,u_c_plot,'ko');
title('Cosine Excitation - Displacement u(-) u_p(+) u_c(o)')
hold on
plot(t,z,'k',t,u_plot,'k');
xlabel('t (sec)');
ylabel('u (mm)');
grid on
% Plot velocity response
display(horzcat('Plot velocity response'))
figure(2)
u_dot_c_plot=subs(u_dot_c)*1000;
u_dot_p_plot=subs(u_dot_p)*1000;
% Total velocity solution
u_dot_plot=u_dot_c_plot+u_dot_p_plot;
clf
plot(t,u_dot_p_plot,'k',t,u_dot_c_plot,'k');
hold on
plot(t,u_dot_p_plot,'k+',t,u_dot_c_plot,'ko');
title('Cosine Excitation - Velocity udot(-) udot_p(+) udot_c(o)')
hold on
plot(t,z,'k',t,u_dot_plot,'k');
xlabel('t (sec)');
ylabel('v (mm/s)');
grid on
% Plot acceleration response
display(horzcat('Plot acceleration response'))
figure(3)
u_ddot_c_plot=subs(u_ddot_c)*1000;
u_ddot_p_plot=subs(u_ddot_p)*1000;
% Total velocity solution
u_ddot_plot=u_ddot_c_plot+u_ddot_p_plot;
clf
plot(t,u_ddot_p_plot,'k',t,u_ddot_c_plot,'k');
hold on
plot(t,u_ddot_p_plot,'k+',t,u_ddot_c_plot,'ko');
title('Cosine Excitation - Acceleration uddot(-) uddot_p(+) uddot_c(o)')
hold on
plot(t,z,'k',t,u_ddot_plot,'k');
xlabel('t (sec)');
ylabel('a (mm/s^2)');
grid on
% Applied force time history
display(horzcat('Applied force time history'))
p_plot=subs(p)
% Mass * Acceleration
ma_plot=m*subs(u_ddot_plot/1000.);
% Force * Dispacement
ku_plot=k*subs(u_plot/1000.);
% Damping coefficent * speed
c_udot_plot=subs(c*u_dot_plot/1000.);
% Resultant force time history
display(horzcat('Resultant force time history'))
p_res_plot=ma_plot+c_udot_plot+ku_plot
figure(4)
display(horzcat('Plot force response'))
plot(t,p_plot,'k',t,ma_plot,'k',t,c_udot_plot,'k',t,ku_plot,'k' ...
,t,p_res_plot,'k');
hold on
plot(t,p_plot,'kx',t,ma_plot,'ko',t,c_udot_plot,'kd',t,ku_plot,'ks', ...
t,p_res_plot,'k');
title('Cosine Excitation - Inertia (o)/ damping (di)/elastic forces(sq)')
hold on
xlabel('t (sec)');
ylabel('F (N)');
grid on 
   
Harmonic forced damped vibration - Example 4.2 Craig P 91
Damped displacement response
p =p_0*cos(Omega*t)
omega_n =(k/m)^(1/2)
r =Omega/(k/m)^(1/2)
U_st =p_0/k
omega_d =(1 - zeta^2)^(1/2)*(k/m)^(1/2)
c_crit =2*m*(k/m)^(1/2)
c =2*m*zeta*(k/m)^(1/2)
U =p_0/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
alpha =-atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k - 1)))
u_c =exp(-t*zeta*(k/m)^(1/2))*(A1*cos(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)))
u_p =(p_0*cos(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k - 1))) +
Omega*t))/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
u =exp(-t*zeta*(k/m)^(1/2))*(A1*cos(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2))) +
(p_0*cos(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k - 1))) +
Omega*t))/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
Velocity response
u_dot_c =exp(-t*zeta*(k/m)^(1/2))*(A2*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2) - A1*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) - zeta*exp(-
t*zeta*(k/m)^(1/2))*(k/m)^(1/2)*(A1*cos(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)))
u_dot_p =-(Omega*p_0*sin(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k -
1))) + Omega*t))/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
u_dot =exp(-t*zeta*(k/m)^(1/2))*(A2*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2) - A1*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) - zeta*exp(-
t*zeta*(k/m)^(1/2))*(k/m)^(1/2)*(A1*cos(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2))) -
(Omega*p_0*sin(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k - 1))) +
Omega*t))/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
Acceleration response
u_ddot_c =exp(-t*zeta*(k/m)^(1/2))*((A1*k*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(zeta^2 - 1))/m + (A2*k*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(zeta^2 - 1))/m) - 2*zeta*exp(-
t*zeta*(k/m)^(1/2))*(k/m)^(1/2)*(A2*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2) - A1*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
(k*zeta^2*exp(-t*zeta*(k/m)^(1/2))*(A1*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2)) + A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2))))/m
u_ddot_p =-(Omega^2*p_0*cos(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k
- 1))) + Omega*t))/(k*(((Omega^2*m)/k - 1)^2 +
(4*Omega^2*m*zeta^2)/k)^(1/2))
u_ddot =exp(-t*zeta*(k/m)^(1/2))*((A1*k*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(zeta^2 - 1))/m + (A2*k*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(zeta^2 - 1))/m) - 2*zeta*exp(-
t*zeta*(k/m)^(1/2))*(k/m)^(1/2)*(A2*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2) - A1*sin(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2))*(1 - zeta^2)^(1/2)*(k/m)^(1/2)) +
(k*zeta^2*exp(-t*zeta*(k/m)^(1/2))*(A1*cos(t*(1 -
zeta^2)^(1/2)*(k/m)^(1/2)) + A2*sin(t*(1 - zeta^2)^(1/2)*(k/m)^(1/2))))/m -
(Omega^2*p_0*cos(atan((2*Omega*zeta)/((k/m)^(1/2)*((m*Omega^2)/k - 1))) +
Omega*t))/(k*(((Omega^2*m)/k - 1)^2 + (4*Omega^2*m*zeta^2)/k)^(1/2))
Stiffness, mass and damping
k = 7000
m = 17.5000
zeta = 0.0200
c = 14.0000
Angular frequency
omega_n = 20
Damped natural angular frequency
omega_d = 19.9960
Static displacement
p_0 = 45
U_st = 0.0064
Excitation ratio r
Omega = 10
r = 0.5000
U = 0.0086
Phase angle
alpha = 0.0267
alpha_deg = 1.5275
Displacement and velocity initial conditions
t = 0
u_0 = 0
u_dot_0 = 0
t = 0
A1 =-0.008565337664644824
A2 =-0.000285568374875646
Plot response
tmin = 0
tmax = 1.5000
np = 101
Homogenous solution - Displacement
Particular solution - Displacement
Plot velocity response
Plot acceleration response
Applied force time history
p_plot = Columns 1 through 11
45.0000 44.4947 42.9901 40.5201 37.1401 32.9260 27.9724
22.3907 16.3061 9.8553 3.1832
Columns 12 through 22
-3.5604 -10.2241 -16.6581 -22.7181 -28.2678 -33.1827 -37.3524 -
40.6832 -43.1004 -44.5497 -44.9984
Columns 23 through 33
-44.4366 -42.8768 -40.3541 -36.9252 -32.6670 -27.6751 -22.0617 -
15.9529 -9.4858 -2.8057 3.9375
Columns 34 through 44
10.5922 17.0090 23.0438 28.5612 33.4371 37.5621 40.8435
43.2077 44.6015 44.9936 44.3753
Columns 45 through 55
42.7605 40.1853 36.7076 32.4056 27.3758 21.7312 15.5986
9.1157 2.4280 -4.3142 -10.9595
Columns 56 through 66
-17.3587 -23.3680 -28.8525 -33.6891 -37.7691 -41.0009 -43.3118 -
44.6501 -44.9857 -44.3110 -42.6411
Columns 67 through 77
-40.0136 -36.4875 -32.1420 -27.0746 -21.3992 -15.2432 -8.7448 -
2.0501 4.6906 11.3260 17.7071
Columns 78 through 88
23.6905 29.1418 33.9387 37.9734 41.1553 43.4130 44.6956
44.9746 44.2434 42.5187 39.8391
Columns 89 through 99
36.2648 31.8760 26.7714 21.0656 14.8867 8.3734 1.6721 -
5.0667 -11.6918 -18.0543 -24.0113
Columns 100 through 101
-29.4291 -34.1860
Resultant force time history
p_res_plot = Columns 1 through 11
45.0000 44.4947 42.9901 40.5201 37.1401 32.9260 27.9724
22.3907 16.3061 9.8553 3.1832
Columns 12 through 22
-3.5604 -10.2241 -16.6581 -22.7181 -28.2678 -33.1827 -37.3524 -
40.6832 -43.1004 -44.5497 -44.9984
Columns 23 through 33
-44.4366 -42.8768 -40.3541 -36.9252 -32.6670 -27.6751 -22.0617 -
15.9529 -9.4858 -2.8057 3.9375
Columns 34 through 44
10.5922 17.0090 23.0438 28.5612 33.4371 37.5621 40.8435
43.2077 44.6015 44.9936 44.3753
Columns 45 through 55
42.7605 40.1853 36.7076 32.4056 27.3758 21.7312 15.5986
9.1157 2.4280 -4.3142 -10.9595
Columns 56 through 66
-17.3587 -23.3680 -28.8525 -33.6891 -37.7691 -41.0009 -43.3118 -
44.6501 -44.9857 -44.3110 -42.6411
Columns 67 through 77
-40.0136 -36.4875 -32.1420 -27.0746 -21.3992 -15.2432 -8.7448 -
2.0501 4.6906 11.3260 17.7071
Columns 78 through 88
23.6905 29.1418 33.9387 37.9734 41.1553 43.4130 44.6956
44.9746 44.2434 42.5187 39.8391
Columns 89 through 99
36.2648 31.8760 26.7714 21.0656 14.8867 8.3734 1.6721 -
5.0667 -11.6918 -18.0543 -24.0113
Columns 100 through 101
-29.4291 -34.1860
Plot force response
>>
   
Cosine Excitation - Displacement u(-) up(+) uc (o)
10

0
u (mm)

-5

-10

-15

-20
0 0.5 1 1.5
t (sec)

Cosine Excitation - Velocity udot(-) udotp(+) udotc (o)


250

200

150

100

50
v (mm/s)

-50

-100

-150

-200

-250
0 0.5 1 1.5
t (sec)
Cosine Excitation - Acceleration uddot(-) uddotp(+) uddotc (o)
4000

3000

2000

1000
a (mm/s 2)

-1000

-2000

-3000

-4000
0 0.5 1 1.5
t (sec)

Cosine Excitation - Inertia (o)/ damping (di)/elastic forces(sq)


80

60

40

20

0
F (N)

-20

-40

-60

-80

-100

-120
0 0.5 1 1.5
t (sec)

You might also like