📄 tdof_modal_time.m
字号:
echo off
% tdof_modal_time.m hand solution of modal equations
% Plots displacements versus time in principal and physical coordinates.
clf;
clear all;
% define time vector for plotting responses
t = linspace(0,10,50);
% solve for and plot the modal displacements
zp1 = (-t.^2/(2*sqrt(3))) - sqrt(3)*t/3;
zp2 = 3*sqrt(2)/2 - (3*sqrt(2)/2)*cos(t) - (sqrt(2)/2)*cos(t) + (sqrt(2)/2)*sin(t);
zp3 = (sqrt(6)/6)*((-1/3) + (1/3)*cos(sqrt(3)*t) + 3*cos(sqrt(3)*t) - (7/sqrt(3))*sin(sqrt(3)*t));
plot(t,zp1,'k+-',t,zp2,'kx-',t,zp3,'k-')
title('Displacements in Principal Coordinate System')
xlabel('Time, sec')
ylabel('Displacements')
legend('zp1','zp2','zp3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
axis([0 1 -2 2])
disp('execution paused to display figure, "enter" to continue'); pause
% define the normalized modal matrix, m = 1
zn = [1/sqrt(3) 1/sqrt(2) 1/sqrt(6)
1/sqrt(3) 0 -2/sqrt(6)
1/sqrt(3) -1/sqrt(2) 1/sqrt(6)];
% define the principal displacement matrix, column vectors of principal displacements
% at each time step
zp = [zp1; zp2; zp3];
% multiply zn times zp to get z
z = zn*zp;
z1 = z(1,:);
z2 = z(2,:);
z3 = z(3,:);
plot(t,z1,'k+-',t,z2,'kx-',t,z3,'k-')
title('Displacements in Physical Coordinate System')
xlabel('Time, sec')
ylabel('Displacements')
legend('z1','z2','z3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
% define the motion of each each dof for each mode, zij below refers to the
% motion of dof "i" due to mode "j"
z11 = zn(1,1)*zp1;
z12 = zn(1,2)*zp2;
z13 = zn(1,3)*zp3;
z21 = zn(2,1)*zp1;
z22 = zn(2,2)*zp2;
z23 = zn(2,3)*zp3;
z31 = zn(3,1)*zp1;
z32 = zn(3,2)*zp2;
z33 = zn(3,3)*zp3;
plot(t,z11,'k+-',t,z12,'kx-',t,z13,'k-')
title('Displacement of dof 1 for Modes 1, 2 and 3')
xlabel('Time, sec')
ylabel('Displacements')
legend('Mode 1','Mode 2','Mode 3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
plot(t,z21,'k+-',t,z22,'kx-',t,z23,'k-')
title('Displacement of dof 2 for Modes 1, 2 and 3')
xlabel('Time, sec')
ylabel('Displacements')
legend('Mode 1','Mode 2','Mode 3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
plot(t,z31,'k+-',t,z32,'kx-',t,z33,'k-')
title('Displacement of dof 3 for Modes 1, 2 and 3')
xlabel('Time, sec')
ylabel('Displacements')
legend('Mode 1','Mode 2','Mode 3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
% define the motion of each each dof with the rigid body motion for that
% mode subtracted
z1vib = z1 - z11;
z2vib = z2 - z21;
z3vib = z3 - z31;
plot(t,z1vib,'k+-',t,z2vib,'kx-',t,z3vib,'k-')
title('Displacements of dof 1, 2 and 3 with Rigid Body Removed')
xlabel('Time, sec')
ylabel('Vibration Displacements')
legend('dof 1','dof 2','dof 3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
tplot = t;
plot(tplot,z1,'k+-',t,z2,'kx-',t,z3,'k-')
title('Displacements of dof 1, 2 and 3')
xlabel('Time, sec')
ylabel('Vibration Displacements')
legend('dof 1','dof 2','dof 3',3)
grid
disp('execution paused to display figure, "enter" to continue'); pause
save tdof_modal_time_z1z2z3 tplot z1 z2 z3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -