⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cal.m

📁 通过一直参数
💻 M
字号:
clear all;

% Calculate responses of a 3-story shear building subject to White Noise Excitation on Floor 
n=3;

%Input data
%S=input('Force intensity of white noise   ');
S=0.5;
%dt=input('Time step  ');
dt=0.02;
%Duration=input('Time duration  ');
duration=40;
SeedNum=input('Input the seed number  ');
%Filter index
Findx=1;
%Filter index =1 -  use a filter to handle the direct pass-through problem. 

% ***** Generate white noise
randn('state',SeedNum);
te=[dt:dt:duration]';
Nt=length(te);

if Findx==1
   filter_order = 6;
   filter_cutoff =10; %Hz
   [filt_num,filt_den] = butter(filter_order,filter_cutoff*2*dt);
   Nt2=Nt+2*filter_order;
else
   Nt2=Nt;
end;

ff=S*randn(Nt2,1)./dt^0.5;

if Findx==1
   ff= filter(filt_num,filt_den,ff);
   ff= ff(Nt2-Nt+1:end,:);
end;

force(:,1)=te;
force(:,2)=ff;

save force.mat force

% Integrates ordinary differential equations y' = f(t,y) by Runge-Kutta, medium order method.
y0=zeros(2*n,1);   % initial conditions
OPTIONS = [];
[t,y]=ode45(@linear3dof,te,y0,OPTIONS,n,duration);

% Acceleration response
ll=length(y);
for it=1:ll 
   xx(:,it)=linear3dof(t(it),y(it,:)',n,duration);
end

xt=xx';
acc=xt(:,n+1:2*n);

save response.mat acc
save xstate.mat y

    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -