You are on page 1of 7

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

% MT11
% Harmonic forced vibration - Example 4.1 Craig P 84
%.........................................................................
clear all
clc
format compact
display(horzcat('Harmonic forced vibration - Example 4.1 Craig P 84'))
%
syms k m p_0 U_st real
syms Omega A1 A2 omega_n r t real
% Angular frequency
display(horzcat('Angular frequency'))
omega_n=sqrt(k/m)
% Static displacement
U_st=p_0/k
% Excitation ratio r
display(horzcat('Excitation ratio r'))
r=Omega/omega_n
p=p_0*cos(Omega*t)
% Displacement amplitude
display(horzcat('Displacement amplitude'))
U=U_st/(1-r^2)
% Displacement response
display(horzcat('Displacement response'))
u_c=A1*cos(omega_n*t)+A2*sin(omega_n*t)
u_p=U*cos(Omega*t)
u=u_c+u_p
% Velocity response
display(horzcat('Velocity response'))
u_dot=diff(u,t)
% Stiffness and mass
display(horzcat('Stiffness and mass'))
k=7000
m=17.5
% Angular frequency
display(horzcat('Angular frequency'))
omega_n=subs(omega_n)
% Static displacement
display(horzcat('Static displacement'))
p_0=45
% Ratio r
display(horzcat('Excitation ratio r'))
Omega=10
r=subs(r)
% Displacement amplitude
display(horzcat('Displacement amplitude'))
U=subs(U)
% Solve for constants using initial conditions
display(horzcat('Solve for constants using initial conditions'))
u_0=0.00
u_dot_0=0.00
t=0
A1=vpa(solve(subs(u)-u_0,A1),6)
A2=vpa(solve(subs(u_dot)-u_dot_0,A2),6)
% Response - displacement and velocity
display(horzcat('Response - displacement and velocity'))
u_val=subs(u)
u_dot_val=subs(u_dot)
% Plot displacement response
display(horzcat('Plot displacement response'))
tmin=0
tmax=1.5
np=101
tval=linspace(tmin,tmax,np);
t=tval;
% Homogenous solution
display(horzcat('Homogenous displacment solution'))
u_c_plot=subs(u_c)*1000;
% Particular solution
display(horzcat('Particular displacment solution'))
u_p_plot=subs(u_p)*1000;
% Total solution
display(horzcat('Total displacment solution'))
u_plot=u_c_plot+u_p_plot;
z=t*0.0;
figure(1)
clf
plot(t,u_p_plot,'k',t,u_c_plot,'k');
hold on
plot(t,u_p_plot,'k+',t,u_c_plot,'ko');
title('Cosine Excitation - Displacement')
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=diff(u_c,'t')
u_dot_p=diff(u_p,'t')
u_dot=u_dot_c+u_dot_p
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')
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=diff(diff(u_c,'t'),'t')
u_ddot_p=diff(diff(u_p,'t'),'t')
u_ddot=u_ddot_c+u_ddot_p
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')
hold on
plot(t,z,'k',t,u_ddot_plot,'k');
xlabel('t (sec)');
ylabel('a (mm/s^2)');
grid on
% Applied force
p_plot=subs(p)
% Mass * Acceleration
ma_plot=subs(u_ddot_plot*m/1000.)
% Force * Dispacement
ku_plot=subs(k*u_plot/1000.)
p_res_plot=ma_plot+ku_plot
figure(4)
display(horzcat('Plot force response'))
plot(t,p_plot,'k',t,ma_plot,'k',t,ku_plot,'k',t,p_res_plot,'k');
plot(t,p_plot,'kx',t,ma_plot,'ko',t,ku_plot,'ks',t,p_res_plot,'k');
title('Cosine Excitation - Inertia and elastic forces')
hold on
xlabel('t (sec)');
ylabel('F (N)');
grid on 
Harmonic forced vibration - Example 4.1 Craig P 84
Angular frequency
omega_n =(k/m)^(1/2)
U_st =p_0/k
Excitation ratio r
r =Omega/(k/m)^(1/2)
p =p_0*cos(Omega*t)
Displacement amplitude
U =-p_0/(k*((m*Omega^2)/k - 1))
Displacement response
u_c =A1*cos(t*(k/m)^(1/2)) + A2*sin(t*(k/m)^(1/2))
u_p =-(p_0*cos(Omega*t))/(k*((m*Omega^2)/k - 1))
u =A1*cos(t*(k/m)^(1/2)) + A2*sin(t*(k/m)^(1/2)) -
(p_0*cos(Omega*t))/(k*((m*Omega^2)/k - 1))
Velocity response
u_dot =A2*cos(t*(k/m)^(1/2))*(k/m)^(1/2) -
A1*sin(t*(k/m)^(1/2))*(k/m)^(1/2) +
(Omega*p_0*sin(Omega*t))/(k*((m*Omega^2)/k - 1))
Stiffness and mass
k = 7000
m = 17.5000
Angular frequency
omega_n = 20
Static displacement
p_0 = 45
Excitation ratio r
Omega = 10
r = 0.5000
Displacement amplitude
U = 0.0086
Solve for constants using initial conditions
u_0 = 0
u_dot_0 = 0
t = 0
A1 =-0.00857143
A2 =0.0
Response - displacement and velocity
u_val =0
u_dot_val =0.0
Plot displacement response
tmin = 0
tmax = 1.5000
np = 101
Homogenous displacment solution
Particular displacment solution
Total displacment solution
Plot velocity response
u_dot_c =A2*cos(t*(k/m)^(1/2))*(k/m)^(1/2) -
A1*sin(t*(k/m)^(1/2))*(k/m)^(1/2)
u_dot_p =(Omega*p_0*sin(Omega*t))/(k*((m*Omega^2)/k - 1))
u_dot =A2*cos(t*(k/m)^(1/2))*(k/m)^(1/2) -
A1*sin(t*(k/m)^(1/2))*(k/m)^(1/2) +
(Omega*p_0*sin(Omega*t))/(k*((m*Omega^2)/k - 1))
Plot acceleration response
u_ddot_c =- (A1*k*cos(t*(k/m)^(1/2)))/m - (A2*k*sin(t*(k/m)^(1/2)))/m
u_ddot_p =(Omega^2*p_0*cos(Omega*t))/(k*((m*Omega^2)/k - 1))
u_ddot =(Omega^2*p_0*cos(Omega*t))/(k*((m*Omega^2)/k - 1)) -
(A2*k*sin(t*(k/m)^(1/2)))/m - (A1*k*cos(t*(k/m)^(1/2)))/m
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
ma_plot = Columns 1 through 11
45.0000 42.4886 35.1901 23.7899 9.3614 -6.7311 -22.9563 -
37.7543 -49.6790 -57.5294 -60.4606
Columns 12 through 22
-58.0620 -50.3975 -38.0032 -21.8430 -3.2251 16.3108 35.1295
51.6427 64.4496 72.4601 74.9910
Columns 23 through 33
71.8262 63.2358 49.9525 33.1065 14.1263 -5.3876 -23.8034 -
39.6012 -51.5059 -58.5983 -60.3938
Columns 34 through 44
-56.8822 -48.5256 -36.2135 -21.1802 -4.8915 11.0888 25.2413
36.2287 43.0168 44.9682 41.8998
Columns 45 through 55
34.0995 22.3001 7.6130 -8.5724 -24.7143 -39.2588 -50.7808 -
58.1144 -60.4600 -57.4590 -49.2292
Columns 56 through 66
-36.3576 -19.8514 -1.0510 18.4863 37.1233 53.2860 65.6027
73.0247 74.9189 71.1235 61.9626
Columns 67 through 77
48.2172 31.0566 11.9350 -7.5362 -25.7307 -41.1498 -52.5534 -
59.0676 -60.2597 -56.1736 -47.3222
Columns 78 through 88
-34.6382 -19.3882 -3.0559 12.7929 26.6526 37.2141 43.4837
44.8728 41.2511 32.9584 20.7738
Columns 89 through 99
5.8456 -10.4131 -26.4521 -40.7250 -51.8296 -58.6362 -60.3917 -
56.7898 -48.0021 -34.6660 -17.8308
Columns 100 through 101
1.1324 20.6504
ku_plot = Columns 1 through 11
-0.0000 2.0061 7.8001 16.7302 27.7787 39.6571 50.9287
60.1450 65.9851 67.3847 63.6438
Columns 12 through 22
54.5015 40.1734 21.3451 -0.8751 -25.0427 -49.4936 -72.4819 -
92.3259 -107.5500 -117.0098 -119.9894
Columns 23 through 33
-116.2627 -106.1126 -90.3066 -70.0317 -46.7933 -22.2875 1.7417
23.6483 42.0201 55.7926 64.3312
Columns 34 through 44
67.4744 65.5346 59.2573 49.7414 38.3286 26.4733 15.6022
6.9790 1.5847 0.0254 2.4755
Columns 45 through 55
8.6609 17.8851 29.0946 40.9780 52.0901 60.9900 66.3794
67.2300 62.8880 53.1448 38.2697
Columns 56 through 66
18.9989 -3.5166 -27.8015 -52.1754 -74.8923 -94.2868 -108.9145 -
117.6749 -119.9046 -115.4345 -104.6037
Columns 67 through 77
-88.2308 -67.5440 -44.0770 -19.5384 4.3315 25.9066 43.8085
57.0174 64.9503 67.4997 65.0292
Columns 78 through 88
58.3287 48.5301 36.9946 25.1805 14.5027 6.1989 1.2119
0.1017 2.9923 9.5603 19.0653
Columns 89 through 99
30.4192 42.2891 53.2236 61.7906 66.7163 67.0096 62.0638
51.7231 36.3104 16.6117 -6.1805
Columns 100 through 101
-30.5615 -54.8364
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
10

0
u (mm)

-5

-10

-15

-20
0 0.5 1 1.5
t (sec)

Cosine Excitation - Velocity


250

200

150

100

50
v (mm/s)

-50

-100

-150

-200

-250
0 0.5 1 1.5
t (sec)
Cosine Excitation - Acceleration
5000

4000

3000

2000
a (mm/s 2)

1000

-1000

-2000

-3000

-4000
0 0.5 1 1.5
t (sec)

Cosine Excitation - Inertia and elastic forces


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