地震波反应谱计算程序
- function [x]=rspsp(damping,eqw,T)
- %
- % function [x]=rspsp(damping,eqw,T)
- % Purpose: To calculate response spectrum of EQW
- % damping 阻尼比
- % eqw 地震波,地面加速度时程. 应具有两列[t,u]
- % 当 eqw 是向量时,则认为eqw(1)是时间间隔
- % T 向量,周期
- % x 计算结果,共三列,分别为位移,速度,加速度反应谱
- % Note: What we calulate are called Pseudo-velocity response
- % spectrum and Pseudo-acceleration response spectrum.
- % Author: hjdwg@0451.com 98-11-25 15:57
- %
- if nargin ~= 3 ,error('Nargin ~=3');end
- [s1,s2]=size(eqw);
- if s2>2,error('Illegal eqw format');end
- if s2==2,
- u=eqw(:,2);
- t=eqw(:,1);
- end
- if s2==1,
- t=eqw(1)*(0:s1-2);
- u=eqw(2:s1,1);
- end
- x=zeros([length(T),3]);
- w=2*pi./T;
- for i=1:length(w)
- SYS=tf(1,[1,2*damping*w(i),w(i)*w(i)]);
- x(i,1)=max(abs(lsim(SYS,u,t)));
- end
- x(:,2)=x(:,1)*2*pi./T(:);
- x(:,3)=x(:,2)*2*pi./T(:);
- return
复制代码 |