一、基本理论
二、MATLAB实现
以下是两自由度耦合系统自由振动质量块振动过程动画显示的MATLAB程序。
clear;
clc;
close allx0 = 1;
D1 = 40;
D12 = 8;
D2 = D1;
m1 = 1;
omega0 = sqrt(D1/m1);
k1 = D12 / D1;
k2 = D12 / D2;
k = sqrt(k1 * k2);
omegazh = omega0 * sqrt(1 + k);
omegaaf = omega0 * sqrt(1 - k);
for t = 0:0.1:10%%%T = 0:0.1:t;X1 = x0 * cos((omegazh - omegaaf) * T/2) .* cos((omegazh + omegaaf) * T/2) ;X2 = x0 * sqrt(k2/k1) * sin((omegazh - omegaaf) * T/2) .* sin((omegazh + omegaaf) * T/2) ;subplot(2,2,1)plot(T, X1,'b','LineWidth',1.5);xlabel('t');ylabel('Amplitude');axis([0 10 -1 1]);subplot(2,2,3)plot(T, X2,'r','LineWidth',1.5);xlabel('t');ylabel('Amplitude');axis([0 10 -1 1]);%%%X1 = x0 * cos((omegazh - omegaaf) * t/2) .* cos((omegazh + omegaaf) * t/2) ;X2 = x0 * sqrt(k2/k1) * sin((omegazh - omegaaf) * t/2) .* sin((omegazh + omegaaf) * t/2) ;subplot(2,2,2)plot(X1, 0, '.', 'MarkerSize', 30);xlabel('x1');axis([-1 1 -1 1]);subplot(2,2,4)plot(X2, 0, '.', 'MarkerSize', 30);xlabel('x2');axis([-1 1 -1 1]);pause(0.1)
endT = 0:0.1:10;
X1 = x0 * cos((omegazh - omegaaf) * T/2) ;
X2 = x0 * sqrt(k2/k1) * sin((omegazh - omegaaf) * T/2) ;figure
subplot(2,1,1)
plot(T, X1,'b','LineWidth',1.2);
xlabel('t');
ylabel('Amplitude');
axis([0 10 -1 1]);
title('包络');
set(gca, 'FontSize', 16);
set(0,'defaultfigurecolor','w');subplot(2,1,2)
plot(T, X2,'r','LineWidth',1.2);
xlabel('t');
ylabel('Amplitude');
axis([0 10 -1 1]);
set(gca, 'FontSize', 16);
set(0,'defaultfigurecolor','w');
程序执行结果包括两个振子的位置随时间变换的轨迹(图1中左图)以及两个振子振动情况的动画显示(图1中右图)。
图2为两个振子振动信号的包络。