Skip to content
Permalink
Browse files

Agrega carga de piers

  • Loading branch information...
ppizarror committed Dec 19, 2018
1 parent 03100ec commit c57f0a0188b8f8d1666ec12693c00ede53d67737
@@ -0,0 +1,10 @@
function cargar_piers(piers, figin, figout, dataresd, ndt)
npiers = length(piers);
styles = {'+', 'o', '*', '.', 'x', 's', 'd', 'v', '>', '<'};
for i=1:npiers
cargar_puntos_ambos(piers{i}, dataresd, ndt, true, styles{i}, figin);
end
for i=1:npiers
cargar_puntos_ambos(piers{i}, dataresd, ndt, false, styles{i}, figout);
end
end
@@ -0,0 +1,37 @@
function cargar_puntos(pier, data, n, inplano, style, color, sis, fig)
figure(fig);
ps = [];
ms = [];
j = 1;
for i = 1:n
if strcmp(data(i, 1).Var1{1}, pier)
comb = data(i, 2).Var2{1};
p = abs(data(i, 4).Var4);
if inplano
m = abs(data(i, 9).Var9);
else
m = abs(data(i, 8).Var8);
end
if sis
ps(j) = p; %#ok<*AGROW>
ms(j) = m;
else
if (strcmp(comb, 'PP') || strcmp(comb, 'SC') || strcmp(comb, 'ASD-C1 Max') || ...
strcmp(comb, 'ASD-C1 Min') || strcmp(comb, 'ASD-C2 Max') || ...
strcmp(comb, 'ASD-C2 Min'))
ps(j) = p;
ms(j) = m;
end
end
j = j + 1;
end
end

% Plotea los datos
if sis
disname = strcat(pier, ' - Dinámico');
else
disname = strcat(pier, ' - Estático');
end
plot(ms, ps, style, 'Color', color, 'DisplayName', disname);
end
@@ -0,0 +1,4 @@
function cargar_puntos_ambos(pier, data, n, inplano, style, fig)
cargar_puntos(pier, data, n, inplano, style, [0, 0, 1], true, fig);
cargar_puntos(pier, data, n, inplano, style, [1, 0, 0], false, fig);
end
@@ -1,4 +1,7 @@
function [fin, fout] = genera_diag_geom(fm, h, b, t, As_in, As_out, geom)
fin = plot_mn(fm, h, b, t, b-t/2, t/2, As_in, true, strcat(geom, ' - Eje en el plano'));
fout = plot_mn(fm, h, t, b, t/2, t/2, As_out, true, strcat(geom, ' - Fuera del plano'));
function [fin, fout] = genera_diag_geom(fm, h, b, t, As_in, As_out, geom, outside)
if ~exist('outside', 'var')
outside = true;
end
fin = plot_mn(fm, h, b, t, b-t/2, t/2, As_in, true, strcat(geom, ' - Eje en el plano'), outside);
fout = plot_mn(fm, h, t, b, t/2, t/2, As_out, true, strcat(geom, ' - Fuera del plano'), outside);
end
@@ -7,20 +7,64 @@
FI_10 = 5 * 5 * pi/100;
FI_8 = 4 * 4 * pi/100;

% cargar_puntos('M1Y');
if ~exist('datares', 'var')
dataresd= readtable('resultados.txt','Delimiter','\t');
datares=table2struct(dataresd);
end
ndt = size(dataresd);
ndt = ndt(1);

% ------------------------------------------------------------------------
% GEOMETRÍAS EJE Y
% ------------------------------------------------------------------------
[g1in, g1out] = genera_diag_geom(37.5, 260, 390, 14, FI_12, FI_8, 'Geometría 1'); % M1Y, M3Y, M4Y, M5, M6Y, M8Y
cargar_piers({'M1Y', 'M3Y', 'M4Y', 'M5Y', 'M6Y', 'M8Y'}, g1in, g1out, dataresd, ndt);

[g2in, g2out] = genera_diag_geom(37.5, 260, 225, 14, FI_12, FI_8, 'Geometría 2'); % M2Y, M7Y
cargar_piers({'M2Y', 'M7Y'}, g2in, g2out, dataresd, ndt);

% ------------------------------------------------------------------------
% GEOMETRÍAS EJE X
% ------------------------------------------------------------------------
[g3in, g3out] = genera_diag_geom(37.5, 94.6, 330, 14, FI_12, FI_8, 'Geometría 3'); % M1X, M13X
cargar_piers({'M1X', 'M13X'}, g3in, g3out, dataresd, ndt);

[g4in, g4out] = genera_diag_geom(37.5, 113.4, 112, 14, FI_10, FI_8, 'Geometría 4'); % M2X, M14X
cargar_piers({'M2X', 'M14X'}, g4in, g4out, dataresd, ndt);

[g5in, g5out] = genera_diag_geom(37.5, 113.4, 98, 14, FI_10, FI_8, 'Geometría 5'); % M3X, M6X, M15X
cargar_piers({'M3X', 'M6X', 'M15X'}, g5in, g5out, dataresd, ndt);

[g6in, g6out] = genera_diag_geom(37.5, 52, 330, 14, FI_12, FI_8, 'Geometría 6'); % M4X, M16X
cargar_piers({'M4X', 'M16X'}, g6in, g6out, dataresd, ndt);

[g7in, g7out] = genera_diag_geom(37.5, 94.6, 382, 14, FI_12, FI_8, 'Geometría 7'); % M5X
cargar_piers({'M5X'}, g7in, g7out, dataresd, ndt);

[g8in, g8out] = genera_diag_geom(37.5, 113.4, 164.5, 14, FI_10, FI_8, 'Geometría 8'); % M7X
cargar_piers({'M7X'}, g8in, g8out, dataresd, ndt);

[g9in, g9out] = genera_diag_geom(37.5, 52, 510, 14, FI_12, FI_8, 'Geometría 9'); % M8X, M21X
cargar_piers({'M8X', 'M21X'}, g9in, g9out, dataresd, ndt);

[g10in, g10out] = genera_diag_geom(37.5, 208, 37, 14, FI_12, FI_8, 'Geometría 10'); % M9X
[g11in, g11out] = genera_diag_geom(37.5, 260, 232, 14, FI_12, FI_8, 'Geometría 11'); % M10X % M10X, M12X
cargar_piers({'M9X'}, g10in, g10out, dataresd, ndt);

[g11in, g11out] = genera_diag_geom(37.5, 260, 232, 14, FI_12, FI_8, 'Geometría 11'); % M10X, M12X
cargar_piers({'M10X'}, g11in, g11out, dataresd, ndt);

[g12in, g12out] = genera_diag_geom(37.5, 260, 277, 14, FI_12, FI_8, 'Geometría 12'); % M11X
cargar_piers({'M11X'}, g12in, g12out, dataresd, ndt);

[g13in, g13out] = genera_diag_geom(37.5, 208, 97, 14, FI_12, FI_8, 'Geometría 13'); % M12X
cargar_piers({'M12X'}, g13in, g13out, dataresd, ndt);

[g14in, g14out] = genera_diag_geom(37.5, 94.6, 322, 14, FI_12, FI_8, 'Geometría 14'); % M13X
cargar_piers({'M13X'}, g14in, g14out, dataresd, ndt);

[g15in, g15out] = genera_diag_geom(37.5, 113.4, 164, 14, FI_10, FI_8, 'Geometría 15'); % M14X
[g16in, g16out] = genera_diag_geom(37.5, 113.4, 37, 14, FI_10, FI_8, 'Geometría 16'); % M15X
cargar_piers({'M14X'}, g15in, g15out, dataresd, ndt);

[g16in, g16out] = genera_diag_geom(37.5, 113.4, 37, 14, FI_10, FI_8, 'Geometría 16'); % M15X
cargar_piers({'M15X'}, g16in, g16out, dataresd, ndt);
@@ -1,4 +1,4 @@
function fig = plot_mn(fm, h, b, t, d, dp, As, aceroA44_28, geom)
function fig = plot_mn(fm, h, b, t, d, dp, As, aceroA44_28, geom, outside)
%PLOT_MN Genera el grafico interaccion.
%
% Parametros:
@@ -11,6 +11,9 @@
% As Area de las barras de acero (cm2)
% aceroA44_28 Indica si usa el acero A44-28H o el A63-42H
% geom Nombre de la geometria
if ~exist('outside', 'var')
outside = false;
end

fig = figure();
hold on;
@@ -22,13 +25,18 @@

% Grafico sismico
[ms, ns] = gen_mn_muro(fm, h, b, t, d, dp, As, true, aceroA44_28);
plot(ms(1:end), ns(1:end), 'b-', 'LineWidth', 1);
plot(ms(1:end), ns(1:end), 'b-', 'LineWidth', 1, 'DisplayName', 'Dinámico');

% Grafico estatico
[me, ne] = gen_mn_muro(fm, h, b, t, d, dp, As, false, aceroA44_28);
plot(me(1:end), ne(1:end), 'r-', 'LineWidth', 1);
plot(me(1:end), ne(1:end), 'r-', 'LineWidth', 1, 'DisplayName', 'Estático');

legend({'Dinámico', 'Estático'}, 'location', 'southeast');
if outside
legend('location', 'eastoutside');
set(gca,'position',[0.1 0.1 0.59 0.8])
else
legend('location', 'southeast');
end
ylim([0, max(yticks)]);
xlim([0, max(xticks)]);

0 comments on commit c57f0a0

Please sign in to comment.
You can’t perform that action at this time.