%[A,B,C,D,E]=textread('tmp.txt','%d%s%f%f')
%[A]=textread('111.txt','%d%s%f%f')
%load 111.txt %读入111.txt数据文件,该文件为频率文件或者周期数据文件,
syms freq %定义变量
syms alfa
syms time
freq = load ('111.txt'); %读入数据文件
n_freq=length(freq);
alfa=freq %定义alfa与freq的数组维数和数值形式一致
time=freq
double alfa
for i=1:n_freq %如果111.txt文件输入的是频率文件,那么要求出对应的周期alfa,然后再进行,如果是周期文件则不用执行该循环转换
time(i)=1/freq(n_freq-i+1);
end
damp=0.05 %阻尼比
alf_max=0.08 %地震影响系数最大值
tg=0.45 %卓越周期
r=0.9+(0.05-damp)/(0.5+5*damp);
cof_1=0.02+(0.05-damp)/8; %系数1
cof_2=1+(0.05-damp)/(0.06+1.7*damp); %系数2
for i=1:n_freq %开始循环求解标准反应谱谱值
if (time(i)>=0)&(time(i)<0.1)
alfa(i)=0.45*alf_max+(cof_2-0.45)*alf_max*time(i)/0.1;
elseif (time(i)>=0.1)&(time(i)<tg)
alfa(i)=cof_2*alf_max;
elseif (time(i)>=tg)&(time(i)<(5*tg))
alfa(i)=((tg/time(i))^cof_2)*alf_max;
else
alfa(i)=(cof_2*0.2^r-cof_1*(time(i)-5*tg))*alf_max;
end
end
alfa %显示最终结果
out=[time alfa]
GMT+8, 2024-12-25 14:28 , Processed in 0.039374 second(s), 15 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.