spectral.rar

  • adelgraili
    了解作者
  • matlab
    开发工具
  • 2KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2016-11-01 00:58
    上传日期
this file prepares a spectral analysis for structure.
spectral.rar
  • spectral.m
    5.6KB
内容介绍
%This program used for spectral analysis of building according earthquake %code 2800 of Iran. clc;close all;clear all; n = input('Enter the number of degrees of freedom:'); H = input('Enter the total hight of the building from the base level:'); kode = input('Enter the kode of the type of lateral resistance system of building:'); T0 = input('Enter the parameter T0 based on code 2800:'); TS = input('Enter the parameter TS based on code 2800:'); S = input('Enter the parameter S based on code 2800:'); I = input('Enter the importance coafficient I of building based on code 2800:'); A = input('Enter the design base acceleration ratio A based on code 2800:'); R = input('Enter the R (Reduction coafficient) based on code 2800:'); KV = input('Enter stiffness vector:'); MV = input('Enter mass vector:'); %section 1 : calculating static base shear . % section 1 - 1 : calculating natural period of building. if kode == 0 EST = 0.08 * H^(0.75) ; elseif kode==1 EST = 0.07 * H^(0.75) ; else EST = 0.05 * H^(0.75) ; end % section 1 - 2 : calculating reflection coafficient. if EST<=T0 && EST>= 0 B = 1 + S*(ST/T0); elseif EST>=T0 && EST<=TS B = S+1 ; else B = (S+1) * (TS/EST)^(2/3) ; end % section 1 -3 :calculating equivalent static base shear. TW = sum(MV(:));%effective total weight of building. ESBS = (A * B * I / R) * TW ;%A * B * I / R : Cofficient of base shear. %section 2 : Assembling Mass matrix and Stiffness matrix. g = 9.806 ; if n== 1 M = MV ; K = KV ; else M = diag(MV); K = zeros(n,n); for i = 1:n if i == 1 K(1,1) = KV(1)+ KV(2); elseif i == n K(n,n) = KV(n); K(n,n-1) = -KV(n); K(n-1,n) = -KV(n); else K(i,i) = KV(i)+ KV(i+1); K(i,i-1) = -KV(i); K(i-1,i) = -KV(i); end end end M = (1/g) * M ; %section 3:calculating natural frequencies and periods of building. syms w D = K - w*M ; Eq = det(D); Fr = solve(Eq); Fr = double(Fr); omega = sqrt(Fr); omega = sort(omega); T = 2*pi*omega.^(-1); %section 4: calculating modal matrix of multiple degree of freedom %system. MM = zeros(n,n); for i=1:n D = K-(omega(i)^2 )*M ; Dbb = D(2:n,2:n); Dba = D(2:n,1); Fi(1)=1 ; Fi(2:n) = -inv(Dbb)*Dba ; Fi = Fi'; MM(:,i)= Fi ; end %section 5:Plotting mode shapes of multiple degree of freedom %system. j = 1:n; j = [0,j]; MS = zeros(n,n+1); for i=1:n ms = MM(:,i)'; MS(i,:)=[0,ms]; figure barh(j,MS(i,:),0.08) hold on p = plot(MS(i,:),j); set(p,'Color','g','LineWidth',1.5) set(gca,'Fontsize',6.5) title(['Mode shape ',num2str(i),'-','Relative displacement to first degree of freedom']) xlabel('Relative displacement to the first degree of freedom of system','fontsize',6.5) ylabel('The number of degree of freedom of system','fontsize',6.5) axis square grid on end %section 6:calculating modal massess (Mi) Mm = zeros(n,1) ; for i = 1 : n Mm (i) = MM(:,i)' * M *MM(:,i) ; end %section 7 : calculating modal participating coafficients. L = zeros(n,1); for i = 1 : n L(i) = MM(:,i)'*M*ones(n,1); end %section 8 : calculating spectral acceleration San. sB = zeros(n,1);% dynamic reflection cofficients. for i = 1 : n if T(i)<=T0 && T(i)>= 0 sB(i) = 1 + S*(T(i)/T0); elseif T(i)>=T0 && T(i)<=TS sB(i) = S+1 ; else sB(i) = (S+1) * (TS/T(i))^(2/3) ; end end San = (1/R) * A * I * sB * g ; % Spectral accelerations. %section 9 :Calculating absolut lateral displacements of stories of %building. U = zeros(n,n) ; for i = 1 : n U(:,i) = MM(:,i) * (L(i) / Mm(i)) * T(i)^2 * 0.25 /(pi^2) * San(i) ; end %section 10 :Calculating relative lateral displacements of stories of %building (story drift) NU = [zeros(1,n);U]; RU = zeros(n,n) ; for i = 1 : n RU(i,:) = NU(i+1,:) - NU(i,:); end %section 11:calculating modal accelerations. MA = zeros(n,n) ; for i = 1 : n MA(:,i) = MM(:,i) * (L(i) / Mm(i)) * San(i) ; end %section 12 :calculating lateral forces in various modes. fn = zeros(n,n) ; for i = 1 : n fn(:,i) = M * MA(:,i); end % section 13 : calculating spectral base shear in various modes. MSPBS = sum(fn) ; %section 12 : SRSS method for combining results . % section 12 - 1 : calculating absolut lateral displacement of stories by % SRSS method. CU = zeros(n,1); for i = 1 : n CU(i) = sqrt(sum(U(i,:).^2)); end % section 12-2 : calculating relative lateral displacement of stories by % SRSS method. CRU = zeros(n,1); for i = 1 : n CRU(i) = sqrt(sum(RU(i,:).^2)); end % section 12-3 :calculating lateral force of stories by % SRSS method. Cfn = zeros(n,1); for i = 1 : n Cfn(i) = sqrt(sum(fn(i,:).^2)); end % section 12-4 :calculating spectral base shear by SRSS method. FSPBS = sqrt(sum(MSPBS.^2)); % section 13 :modifying results of spectral dynamic analysis . CC : % coafficient of modification based on code 2800. if ESBS > FSPBS CC = 0.9*ESBS /FSPBS ; if CC < 1 CC = 1 ; end end if ESBS < FSPBS CC = ESBS / FSPBS ; end CU = CC * CU ; CRU = CC * CRU ; Cfn = CC * Cfn ; CFSPBS = CC * FSPBS ; %section 14 : sending results to excel software. xlswrite('outputs.xlsx',M,'MASS MATRIX') xlswrite('outputs.xlsx',K,'STIFFNESS MATRIX') xlswrite('outputs.xlsx',T,'Period') xlswrite('outputs.xlsx',MM,'Modal matrix') xlswrite('outputs.xlsx',Mm,'Modal masses') xlswrite('outputs.xlsx',CU,'ALD') xlswrite('outputs.xlsx',CRU,'RLD') xlswrite('outputs.xlsx',Cfn,'CLF') xlswrite('outputs.xlsx',ESBS,'ESBS') xlswrite('outputs.xlsx',CFSPBS,'CFSPBS')
评论
    相关推荐
    • spectral.rar
      此程序可用于光谱处理,适用于光谱图像处理和地物光谱测量处理。
    • SpectralClustering
      光谱聚类
    • Spectral Clustering.zip
      matlab谱聚类工具包
    • Spectral-Clustering
      光谱聚类 图分区谱分析的实现 在这里找到的 SPAN 算法的实现
    • spectral_clustering
      光谱聚类 在此存储库中,我们提供了两个演示笔记本,如何应用频谱聚类从各种监视指标中提取相关动态。 玩具示例笔记本描绘了频谱聚类如何在具有三个(准)块的小型扰动块矩阵上工作。 在真实数据示例中,算法被...
    • spectral saliency
      各种利用频率谱变换进行显著性检测的matlab集合包,包括频谱残差、正弦谱等等的实现
    • matlab开发-spectral
      matlab开发-spectral。周期图法频谱
    • spectralclustering
      spectral clustering 算法工具包
    • Spectral Estimation.rar
      Spectral Estimation and Power Spectral Density
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载