You are on page 1of 24

PONTIFICIA UNIVERSIDAD CATÓLICA DEL CHILE

MAGISTER EN INGENIERIA ESTRUCTURAL Y GEOTECNICA

TAREA 2

Disipación de Energía

AUTOR

Alan Manrique Guillén

PROFESOR

Juan C. De La Llera

Lima, 30 de enero de 2021


29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 1 of 8

% IEG3520 - Disipación Energía


% Pregunta 3 27 Enero del 2020
%======================
% Alan Manrique
% al.manrique@uc.cl
%=======================
clear
close all
clc

%%Variables (tonf - cm)


%syms L H EI m

L = 1200;
H= 500;
m=173/981;
EI=645000000;
xi=0.02;

%% Cinematica

% Cinematica
a_r{1}=[1/H 0 0 0 0 0 0 0 0;1/H 0 0 1 0 0 0 0 0]; a_x{1}=[-1/H ;-1/H];
a_r{2}=[1/H 0 0 0 0 0 0 0 0;1/H 0 0 0 1 0 0 0 0]; a_x{2}=[-1/H;-1/H];
a_r{3}=[-1/H 1/H 0 1 0 0 0 0 0;-1/H 1/H 0 0 0 1 0 0 0]; a_x{3}=[0;0];
a_r{4}=[-1/H 1/H 0 0 1 0 0 0 0;-1/H 1/H 0 0 0 0 1 0 0]; a_x{4}=[0;0];
a_r{5}=[0 -1/H 1/H 0 0 1 0 0 0;0 -1/H 1/H 0 0 0 0 1 0]; a_x{5}=[0;0];
a_r{6}=[0 -1/H 1/H 0 0 0 1 0 0;0 -1/H 1/H 0 0 0 0 0 1]; a_x{6}=[0;0];
a_r{7}=[0 0 0 1 0 0 0 0 0;0 0 0 0 1 0 0 0 0]; a_x{7}=[0;0];
a_r{8}=[0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 1 0 0]; a_x{8}=[0;0];
a_r{9}=[0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 1]; a_x{9}=[0;0];
a_r{10}=[0 0 1 0 0 0 0 0 0];a_x{10}=[1];
a_r{11}=[-1 0 1 0 0 0 0 0 0];a_x{11}=[0];
a_r{12}=[1 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0];a_x{12}=[0];
a_r{13}=[0 1 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0];a_x{13}=[0];
a_r{14}=[0 0 1 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0];a_x{14}=[0];

%Elementos elasticos
are_s=[a_r{1};a_r{2};a_r{3};a_r{4};a_r{5};a_r{6};a_r{7};a_r{8};a_r{9}];
axe_s=[a_x{1};a_x{2};a_x{3};a_x{4};a_x{5};a_x{6};a_x{7};a_x{8};a_x{9}];

%Elementos inerciales
ari_s=[a_r{12};a_r{13};a_r{14}];
axi_s=[a_x{12};a_x{13};a_x{14}];

%Elementos disipadores
ard_s=[a_r{10};a_r{11}];
axd_s=[a_x{10};a_x{11}];

%% Accion-deformacion

km_s{1}=(EI/H)*[4 2;2 4];


km_s{2}=(EI/H)*[4 2;2 4];
km_s{3}=(EI/H)*[4 2;2 4];
29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 2 of 8

km_s{4}=(EI/H)*[4 2;2 4];


km_s{5}=(EI/H)*[4 2;2 4];
km_s{6}=(EI/H)*[4 2;2 4];
km_s{7}=(1.5*EI/L)*[4 2;2 4];
km_s{8}=(1.5*EI/L)*[4 2;2 4];
km_s{9}=(1.5*EI/L)*[4 2;2 4];

km_s{12}=[m 0;0 m];


km_s{13}=[m 0;0 m];
km_s{14}=[m 0;0 m];

ke_s=blkdiag(km_s{1},km_s{2},km_s{3},km_s{4},km_s{5},km_s{6},km_s{7},km_s{8},km_s
{9});
mi_s=blkdiag(km_s{12},km_s{13},km_s{14});

%% Matriz de rigidez condensada

Ke=are_s'*ke_s*are_s;
p=[1 2 3];
pc=[4 5 6 7 8 9];

Kpp=Ke(p,p);
Kppc=Ke(p,pc);
Kpcp=Ke(pc,p);
Kpcpc=Ke(pc,pc);
H=Kpcpc\Kpcp;
Kec=Kpp-Kppc*H;

% Matriz de Masa

Msi=ari_s'*mi_s*ari_s;
Msi_1=Msi(1,[1 2 3]);
Msi_2=Msi(2,[1 2 3]);
Msi_3=Msi(3,[1 2 3]);

Msi=[Msi_1;Msi_2;Msi_3];

% Matrices de input (en funcion de DDug y ug)


mi_s_1=mi_s(1,[1 2 3]);
mi_s_2=mi_s(2,[1 2 3]);
mi_s_3=mi_s(3,[1 2 3]);
mi_s=[mi_s_1;mi_s_2;mi_s_3];

ari_s_1=ari_s(1,[1 2 3]);
ari_s_2=ari_s(3,[1 2 3]);
ari_s_3=ari_s(5,[1 2 3]);
ari_s=[ari_s_1;ari_s_2;ari_s_3];

Mi = ari_s'.*mi_s*axi_s;
Ki = are_s'*ke_s*axe_s;
Ki=[-1;-1;-1];

%% Propiedades del sistema


[phis,wn2]=eig(inv(Msi)*Kec);
29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 3 of 8

wn2=diag(wn2);
wn=wn2.^0.5;
[wn,inds]=sort(wn,'ascend');
phis=phis(:,inds);
Ts=2*pi./wn;

% Matriz de amortiguamiento
wi=wn(1);
wj=wn(2);
a0=2*wi*wj/(wi+wj)*xi;
a1=2/(wi+wj)*xi;
Cin=a0*Msi+a1*Kec;

%% Ecuaciones de movimiento

% Definimos el sistema

M=Msi;
C=Cin;
K=Kec;
r=[-1;-1;-1];
R = M*r;
g = 981;
Ld = [0 0 1;-1 0 1;0 0 0];
%Ld = [0 0 1;0 0 0;0 0 0];
N = size(M, 1);

%% Disipadores
SPS = 2; % 1 = sin disipadores, 2 = Amortiguador vicoso NL, 3 =
Maxwell NL
linNum = true; % Se linealiza numericamente (para SPS == 3)
alpha = 0.3; % Exponente de la velocidad
kd = 10; % Resorte
cd = 0.2; % Amortiguador

% Input
t0 = 10; % Desfase del input
%th = pi/6; % Rotacion del eje de la estructura respecto a las
direcciones de los registros

% Linealizacion completa
tol_v0 = 1e-2; % Tolerancia en la deformacion maxima
v0 = 100; % Initial guess
aLE = 1/sqrt(2); % La deformacion maxima se multiplica por este numero

% Linealizacion por tramos


Dii = 100; % Se linealiza cada Dii pasos
v0min = 0.05; % El minimo valor usado para v0

% No lineal
tol_fd = 1e-2; % Tolerancia para la fuerza de los disipadores, dentro de
ZOH NL
limJ = 20; % Limite de iteraciones para que converja la fuerza en los
disipadores
29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 4 of 8

% Solvers
optimOpt = optimset('Display', 'off', 'TolX', 1e-2, 'TolFun', 1e-2);
odeOpt = odeset('AbsTol', 1e-2, 'RelTol', 1e-2);

%% Cargar un registro sísmico y encontrar respuesta

n=180;
Espectro=zeros(3,n);

for i=1:n

for theta=pi()/i

load('SanPedro.mat');
DDug=cos(theta)*chx+cos(theta+pi()/2)*chy;
dtg = dt;

% Eliminamos el desplazamiento residual


Dug=cumtrapz(DDug)*dtg;
ug=cumtrapz(Dug)*dtg;
Ng=length(ug);
tg=0:dtg:(Ng-1)*dtg;
ug=cumtrapz(Dug-ug(end)/tg(end))*dtg;

% Modos
[PHI, LAM] = eig(K, M);
WN = sqrt(diag(LAM));
TN = 2*pi./WN;

% Zero padding de la señal


Ng=length(ug);
NG=2^(nextpow2(Ng)+1);

% Calculamos la FFT del registro y las frecuencias asociadas


UG=fftshift(fft(ug,NG));
Tg=dtg*NG;
dw=2*pi/Tg;
WW=(-NG/2+1:1:NG/2)*dw;

% Input
[~,idx] = min(abs(tg - t0));
ug1 = ug;
ug2 = zeros(size(ug));
ug2(:, idx:end) = ug1(:, 1:Ng-idx+1);
ug12 = [ug1 ; ug2];

%% Integramos para dispadores lineales-equivalentes


% Parametros de la linearizacion
w0 = WN(1);
T0 = 2*pi/w0;

% Iteramos sobre la deformacion maxima, v0


29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 5 of 8

iter = 1;
flag = true;
while(flag)
% Disipadores lineales equivalentes
fprintf('i = %i ; v0 = %1.2f\n', iter, v0)
% Elegimos el tipo de disipador
switch(SPS)
case 1
keq = 0;
ceq = 0;
case 2
keq = kd;
ceq = 2/sqrt(pi())*cd*(w0*v0).^(alpha-1)*gamma(1+alpha/2)/(gamma
((3+alpha)/2));
case 3
if(linNum)
% Linealizamos numericamente
% Condicion inicial de DS
S0 = 0;
fun = @(DS) cd*abs(v0*w0-DS/kd)^alpha*tanh(v0*w0 - DS/kd) -
S0;
[DS0, fval] = fsolve(fun, 0, optimOpt);

% Calculamos un ciclo
odefun = @(t, S, DS) NLVM(t, S, DS, kd, cd, alpha, w0, v0);
[t, fd] = ode15i(odefun, [0 T0], S0, DS0, odeOpt);
v = v0*sin(w0*t);
Dv = w0*v0*cos(w0*t);

% Linealizamos
keq = kd + w0*trapz(t, fd.*v)/(pi*v0^2);
ceq = trapz(t, fd.*Dv)/(pi*v0^2*w0);

else
% Linealizamos analiticamente
ceq = cd*(w0*v0)^(alpha-1)*2^(alpha+2)*gamma(1+alpha/2)^2/(pi*gamma
(2+alpha)); %#ok<*UNRCH>
tau = ceq / kd;
Sw = v0*kd*(w0*tau)^2 / (1 + (w0*tau)^2);
Lw = v0*kd*(w0*tau) / (1 + (w0*tau)^2);
keq = kd + Sw;
ceq = Lw/w0;
end
end

% Ecuacion de estadosi
Ceq = Ld.'*ceq*Ld;
Keq = Ld.'*keq*Ld;
A = [zeros(size(M)), eye(size(M)) ; -M\(K+Keq) -M\(Cin+Ceq)];
B = [zeros(size(Ki)) ; -M\Ki ];

%% Resolucion por ZOH


tic
29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 6 of 8

% Matrices del sistema


G = expm(A*dtg);
H = A\(G-eye(size(A,1)))*B;

% ZOH
z = zeros(size(A,1), Ng);
for ii = 2:Ng
z(:, ii) = G*z(:,ii-1) + H*DDug(:,ii-1);
end

% Iteramos si es necesario
if(SPS == 1)
flag = false;
else
vv = Ld * z(1:3,:);
v1 = max(vv(1,:))*aLE;
err = abs(v0 - v1);
if(err < tol_v0)
flag = false;
else
v0 = v1;
iter = iter + 1;
end
end
end % end while v0

Despla=zeros(3,Ng);

Despla(1,:)=z(3,:)-z(2,:);
Despla(2,:)=z(2,:)-z(1,:);
Despla(3,:)=z(1,:);

end

Espectro(1,i)=max(abs(Despla(1,:)));
Espectro(2,i)=max(abs(Despla(2,:)));
Espectro(3,i)=max(abs(Despla(3,:)));

end

% Dibujar Espectro

figure
a=1:n;
theta=a/pi();
theta=theta.^-1;
hold on
plot(theta,Espectro)
legend('1er Entrepiso','2do Entrepiso','3er Entrepiso');
grid minor
title('Espectro')
xlabel('Theta')
ylabel('Desplazamiento máximos')
29/01/21 09:40 PM C:\Users\Alan\Desktop\...\Pregunta3.m 7 of 8

%===========================
% Graficamos
%===========================

lw = 1;
figure
y=Despla(1,:);
[y_max, idx]= max(abs(y));
subplot(3,1,1)
hold on
plot(tg, y, 'Linewidth', lw, 'Linestyle', '-')
xlim([min(tg) max(tg)])
ylim(1.1*[min(y) max(y)])
scatter(tg(idx),y(idx), 55, [0 0 0]);
leg={sprintf('{Max} =%1.2f cm', y_max)};
legend(leg)
xlabel('Tiempo (s)')
ylabel('Despl. Entrepiso 3er')
grid on

y=Despla(2,:);
[y_max, idx]= max(abs(y));
subplot(3,1,2)
hold on
plot(tg, y, 'Linewidth', lw, 'Linestyle', '-')
xlim([min(tg) max(tg)])
ylim(1.1*[min(y) max(y)])
scatter(tg(idx),y(idx), 55, [0 0 0]);
leg={sprintf('{Max} =%1.2f cm', y_max)};
legend(leg)
xlabel('Tiempo (s)')
ylabel('Despl. Entrepiso 2do')
grid on

y=Despla(3,:);
[y_max, idx]= max(abs(y));
subplot(3,1,3)
hold on
plot(tg, y, 'Linewidth', lw, 'Linestyle', '-')
xlim([min(tg) max(tg)])
ylim(1.1*[min(y) max(y)])
scatter(tg(idx),y(idx), 55, [0 0 0]);
leg={sprintf('{Max} =%1.2f cm', y_max)};
legend(leg)
xlabel('Tiempo (s)')
ylabel('Despl. Entrepiso 1er')
grid on
SIN DISIPADORES
CON DISIPADORES

You might also like