Sie sind auf Seite 1von 3

Mdulo2 - 1

Sub Espectro()
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim

A(1000, 1) As Variant
B(1000, 1) As Variant
Y(1000, 1) As Variant
F(1000, 1) As Variant
T(1000, 1) As Variant
E(1000, 1) As Variant
D(1000, 1) As Variant
V(1000, 1) As Variant
AC(1000, 1) As Variant

'Response spectrum of single degree of feedom system using DUHAMEL integral


'Written by: " Sobhan Rostami & Ali Moeinadini "
'M.Sc students of structural engineering of Azad university 0f Kerman-Iran
'e -mail: info@ newcivil.com
clc
clear all
Ts = ActiveSheet.Cells(3, 4).Value
td = ActiveSheet.Cells(4, 4).Value
N = ActiveSheet.Cells(5, 4).Value
'%Input data:
'Ts=xlsread('Spectrum','input','E8');
'td=xlsread('Spectrum','input','E9');
'N=xlsread('Spectrum','input''E10');
T(1) = 0
For I = 1 To N - I
T(I) = I * Ts
Next I
j = (td / Ts) + 2
For j = 1 To N - I
F(j) = 0
F(j) = ActiveSheet.Cells(10 + j, 4).Value
Next j
'F=xlsread('Spectrum','input','E15:E12500');
'j=(td/Ts)+2;
'F(j:N)=O;
'F=F(1:N);
'%Calculation of natural,damped frequency and period:
For N = 1 To 5
E(1) = 0.01
E(2) = 0.02
E(3) = 0.05
E(4) = 0.1
E(5) = 0.2
s = 0
For p = 0.02 To 4 Step 0.02
s = s + 1
W = 2 * pi / p
WD = W * sqrt(l - E(N) ^ 2)
'%Calculation of dynamic response in each time point :
A(1) = 0
B(1) = 0
Y(1) = 0
For I = 2 To N
dF(I) = F(I) - F(I - 1)
dT(I) = T(I) - T(I - 1)
S12 = exp(E(N) * W * T(I)) * (E(N) * W * cos(WD * T(I)) + WD * sin(WD * T(I))) / ((E(N)

Mdulo2 - 2
* W) ^ 2 + WD ^ 2)
S11 = exp(E(N) * W * T(I - 1)) * (E(N) * W * cos(WD * T(I - 1)) + WD * sin(WD * T(I - 1
))) / ((E(N) * W) ^ 2 + WD ^ 2)
Il = S12 - S11
S22 = exp(E(N) * W
* W) ^ 2 + WD ^ 2)
S21 = exp(E(N) * W
))) / ((E(N) * W) ^ 2 + WD
I2 = S22 -

* T(I)) * (E(N) * W * sin(WD * T(I)) - WD * cos(WD * T(I))) / ((E(N)


* T(I - 1)) * (E(N) * W * sin(WD * T(I - 1)) - WD * cos(WD * T(I - 1
^ 2)
S21

S32 = (T(I) - E(N) * W / ((E(N) * W) ^ 2 + WD ^ 2)) * S22 + WD / ((E(N) * W) ^ 2 + WD ^


2) * S12
S31 = (T(I - 1) - E(N) * W / ((E(N) * W) ^ 2 + WD ^ 2)) * S21 + WD / ((E(N) * W) ^ 2 +
WD ^ 2) * S11
I3 = S32 - S31
S42 = (T(I) - E(N) * W / ((E(N) * W) ^ 2 + WD ^ 2)) * S12 + WD / ((E(N) * W) ^ 2 + WD ^
2) * S22
S41 = (T(I - 1) - E(N) * W / ((E(N) * W) ^ 2 + WD ^ 2)) * S11 + WD / ((E(N) * W) ^ 2 +
WD ^ 2) * S21
I4 = S42 - S41
A(I) = A(I - 1) + (F(I - 1) - T(I - 1) * dF(I) / dT(I)) * I1 + dF(I) / dT(I) * I4
B(I) = B(I - 1) + (F(I - 1) - T(I - 1) * dF(I) / dT(I)) * I2 + dF(I) / dT(I) * I3
'%Solve for displacement:
Y(I) = exp(-E(N) * W * T(I)) / WD * (A(I) * sin(WD * T(I)) - B(I) * cos(WD * T(I)))
Next I
'%Determination of maximum responses:
sd = 0
For h = 1 To N
If Abs(Y(h)) > sd Then sd = Abs(Y(h))
Next h
D(I) = ActiveSheet.Cells(10 + I, 7).Value
V(I) = ActiveSheet.Cells(10 + I, 6).Value
AC(I) = ActiveSheet.Cells(10 + I, 5).Value
p = ActiveSheet.Cells(10 + s, 5).Value
sd
Sv
Sv
Sa
Sa

=
=
=
=
=

ActiveSheet.Cells(10 + s, 6).Value
W * sd
ActiveSheet.Cells(10 + s, 7).Value
W * Sv
ActiveSheet.Cells(10 + s, 8).Value

Next p
Next N

%Analysis results:
%Displacement --------------------------------------------------------------------figure(1);
hold on
plot(spec(:,1,1),spec(:,2,1),'b-','linewidth',1);
plot(spec(:,1,2),spec(:,2,2),'r-','linewidth',1);
plot(spec(:,1,3),spec(:,2,3),'y-','linewidth',1);
plot(spec(:,1,4),spec(:,2,4),'g-','linewidth',1);
plot(spec(:,1,5),spec(:,2,5),'k-','linewidth',1);
title('Response spectrum for Sd');
xlabel('PERIOD(sec)');
ylabel('DISPLACEMENT (Sd)');
legend ('\xi=0.01','\xi=0.02','\xi=0.05','\xi=0.l','\xi=0.2');
hold off
grid on;
%Velocity ----------------------------------------------------------------figure(2);

Mdulo2 - 3
hold on
plot(spec(:,1,1),spec(:,3,1),'b-','linewidth',1);
plot(spec(:,1,2),spec(:,3,2),'r-','linewidth',1);
plot(spec(:,1,3),spec(:,3,3),'y-','linewidth',1);
plot(spec(:,1,4),spec(:,3,4),'g-','linewidth',1);
plot(spec(:,1,5),spec(:,3,5),'k-','linewidth',1);
title('Response spectrum for Sv');
xlabel('PERIOD(sec)');
ylabel('VELOCIYT (Sv)');
legend ('\xi=0.01','\xi=0.02','\xi=0.05','\xi=0.1','\xi=0.2');
hold off
grid on;
%acceleration ----------------------------------------------------- - ------figure(3);
hold on
plot(spec(:,1,1),spec(:,4,1),'b-','linewidth',1);
plot(spec(:,1,2),spec(:,4,2),'r-','linewidth',1);
plot(spec(:,1,3),spec(:,4,3),'y-','linewidth',1);
plot(spec(:,1,4),spec(:,4,4),'g-','linewidth',1);
plot(spec(:,1,5),spec(:,4,5),'k-','linewidth',1);
title('Response spectrum for Sa');
xlabel('PERIOD(sec)');
ylabel('ACCELERATION (Sa)');
legend ('\xi=0.01','\xi=0.02','\xi=0.05','\xi=0.1','\xi=0.2');
hold off
grid on;
End Sub

Das könnte Ihnen auch gefallen