%PROGRAMA: ''Estudio de Portico Tridimensional (Columna Base 1)''
clc
clear
syms delta1 y1 teta1 A1 M1 V1 delta21 y21 teta21 A21 M21 V21 delta22  y22  teta22 A22 M22 V22 delta32  y32 teta32 A32 M32 V32 delta43 y43 teta43 A43 M43 V43 delta33 y33 teta33 A33 M33 V33 delta54  y54 teta54 A54 M54 V54 delta44 y44 teta44  A44 M44 V44 delta65  y65 teta65  A65 M65 V65 delta55 y55 teta55 A55  M55 V55 delta76 y76 teta76  A76  M76 V76 delta66 y66  teta66 A66  M66 V66 delta87 y87  teta87 A87 M87 V87 delta77 y77 teta77 A77 M77 V77 delta98 y98 teta98 A98 M98 V98 delta88 y88 teta88 A88 M88 V88 delta109 y109 teta109 A109 M109 V109 delta99 y99 teta99 A99 M99 V99 delta1110 y1110 teta1110 A1110 M1110 V1110 delta1010 y1010 teta1010 A1010 M1010 V1010 delta1111 y1111 teta1111 A1111 M1111 V1111 delta12 y12 teta12 A12 M12 V12 delta1112 y1112 teta1112 A1112  M1112 V1112 delta212 y212 teta212 A212 M212 V212 delta313 y313 teta313 A313 M313 V313 delta1313 y1313 teta1313 A1313 M1313 V1313 delta1314 y1314 teta1314 A1314 M1314 V1314 delta1014 y1014 teta1014 A1014 M1014 V1014 delta1415 y1415 teta1415 A1415 M1415 V1415 delta415 y415 teta415 A415 M415 V415 delta1416 y1416 teta1416 A1416 M1416 V1416 delta916 y916 teta916 A916 M916 V916 delta817 y817 teta817 A817 M817 V817 delta517 y517 teta517 A517 M517 V517 delta1418 y1418 teta1418 A1418 M1418 V1418 delta318 y318 teta318 A318 M318 V318 delta1419 y1419 teta1419 A1419 M1419 V1419 delta1019 y1019 teta1019 A1019 M1019 V1019 delta1320 y1320 teta1320 A1320 M1320 V1320 delta220 y220 teta220 A220 M220 V220 delta1321 y1321 teta1321 A1321 M1321 V1321 delta1121 y1121 teta1121 A1121 M1121 V1121
syms deltaa1 ya1 tetaa1 Aa1 Ma1 Va1 deltaa21 ya21 tetaa21 Aa21 Ma21 Va21 deltaa22  ya22  tetaa22 Aa22 Ma22 Va22 deltaa32  ya32 tetaa32 Aa32 Ma32 Va32 deltaa43 ya43 tetaa43 Aa43 Ma43 Va43 deltaa33 ya33 tetaa33 Aa33 Ma33 Va33 deltaa54  ya54 tetaa54 Aa54 Ma54 Va54 deltaa44 ya44 tetaa44  Aa44 Ma44 Va44 deltaa65  ya65 tetaa65  Aa65 Ma65 Va65 deltaa55 ya55 tetaa55 Aa55  Ma55 Va55 deltaa76 ya76 tetaa76  Aa76  Ma76 Va76 deltaa66 ya66  tetaa66 Aa66  Ma66 Va66 deltaa87 ya87  tetaa87 Aa87 Ma87 Va87 deltaa77 ya77 tetaa77 Aa77 Ma77 Va77 deltaa98 ya98 tetaa98 Aa98 Ma98 Va98 deltaa88 ya88 tetaa88 Aa88 Ma88 Va88 deltaa109 ya109 tetaa109 Aa109 Ma109 Va109 deltaa99 ya99 tetaa99 Aa99 Ma99 Va99 deltaa1110 ya1110 tetaa1110 Aa1110 Ma1110 Va1110 deltaa1010 ya1010 tetaa1010 Aa1010 Ma1010 Va1010 deltaa1111 ya1111 tetaa1111 Aa1111 Ma1111 Va1111 deltaa12 ya12 tetaa12 Aa12 Ma12 Va12 deltaa1112 ya1112 tetaa1112 Aa1112  Ma1112 Va1112 deltaa212 ya212 tetaa212 Aa212 Ma212 Va212 deltaa313 ya313 tetaa313 Aa313 Ma313 Va313 deltaa1313 ya1313 tetaa1313 Aa1313 Ma1313 Va1313 deltaa1314 ya1314 tetaa1314 Aa1314 Ma1314 Va1314 deltaa1014 ya1014 tetaa1014 Aa1014 Ma1014 Va1014 deltaa1415 ya1415 tetaa1415 Aa1415 Ma1415 Va1415 deltaa415 ya415 tetaa415 Aa415 Ma415 Va415 deltaa1416 ya1416 tetaa1416 Aa1416 Ma1416 Va1416 deltaa916 ya916 tetaa916 Aa916 Ma916 Va916 deltaa817 ya817 tetaa817 Aa817 Ma817 Va817 deltaa517 ya517 tetaa517 Aa517 Ma517 Va517 deltaa1418 ya1418 tetaa1418 Aa1418 Ma1418 Va1418 deltaa318 ya318 tetaa318 Aa318 Ma318 Va318 deltaa1419 ya1419 tetaa1419 Aa1419 Ma1419 Va1419 deltaa1019 ya1019 tetaa1019 Aa1019 Ma1019 Va1019 deltaa1320 ya1320 tetaa1320 Aa1320 Ma1320 Va1320 deltaa220 ya220 tetaa220 Aa220 Ma220 Va220 deltaa1321 ya1321 tetaa1321 Aa1321 Ma1321 Va1321 deltaa1121 ya1121 tetaa1121 Aa1121 Ma1121 Va1121 nn

fprintf('\n')    
fprintf('\n')
fprintf('   PROGRAMA: ''DISEÑO DE COLUMNA BASE DE LA ESTRUCTURA DISPENSADORA DE RF''\n')
fprintf('   ********************************************************************\n')
fprintf('\n')
fprintf(' El programa está basado  en  la  CB  del  plano 1; conformada en su interior\n')
fprintf(' por  cerchas  de  tuberías de 6´´  de  diámetro  Sch. 40, y en su  marco por\n')
fprintf(' vigas H. A continuación se indica las opciones  de  los  perfiles  HEA  a ser\n')
fprintf(' utilizado en el marco, el programa indicará si se cumplen  los  códigos  AISC\n')
fprintf(' para los esfuerzos axiales, flexión y cortante; y el ASTM para las deflexiones.\n')
fprintf('\n')
fprintf('    (1) Viga HEA 260\n')
fprintf('    (2) Viga HEA 320\n')
fprintf('    (3) Viga HEA 360\n')
fprintf('    (4) Viga HEA 450\n')
fprintf('\n')    
fprintf('\n')
fprintf(' Ingrese la numeración de su elección.')
opcion = input('¿Cuál selección desea?  = ');
fprintf('\n')
fprintf(' Tiempo Estimado de Corrida = 4 minutos\n')
fprintf(' Espere, por favor ...\n')

if opcion==1
    %Inicio de parametros que identifica perfil o tuberia a emplear 
    %Perfil HEA 260
    Aa=0.009;  %Area del perfil elegido
    I1=3.66e-5;  %Iyy del perfil elegido
    I2=1.05e-4;  %Ixx del perfil elegido
    tw=7.5e-3; %Espesor del alma
    tf=12.5e-3; %Espesor del ala
    bf=260e-3; %Ancho del ala
    d=250e-3;  %Altura neta del perfil H
    svigay=2.82e-4; %Modulo elastico de la seccion menor, Syy
    svigax=0.836e-3; %Modulo elastico de la seccion mayor, Sxx
    Pp5x=+9352; % Vease tabla 3.13
    Pp5y=-1649; % Vease tabla 3.13 
    Pp10x=-9352; % Vease tabla 3.13 
    Pp10y=1649; % Vease tabla 3.13 
    P6=-1002;  % Vease tabla 3.13

    Ab=0.0054;  %Area de tuberia
    I3=1.68e-5; % I de tuberia
    e=0.007112;         %Espesor de la pared de la tuberia
    De=0.168;        %Diametro externo de la tuberia
    Di=0.146;        %Diametro interno de la tuberia
    stub=2e-4;   %Modulo elastico de la seccion de tuberia 
    EApermisible=415e6; %Esfuerzo permisible de traccion del material empleado
end;

if opcion==2
    %Inicio de parametros que identifica perfil o tuberia a emplear
    %Perfil HEA 320
    Aa=0.012;  %Area del perfil elegido
    I1=6.98e-5;  %Iyy del perfil elegido
    I2=2.29e-4;  %Ixx del perfil elegido
    tw=9e-3; %Espesor del alma
    tf=15.5e-3; %Espesor del ala
    bf=300e-3; %Ancho del ala
    d=310e-3;  %Altura neta del perfil H
    svigay=4.65e-4; %Modulo elastico de la seccion menor, Syy
    svigax=1.48e-3; %Modulo elastico de la seccion mayor, Sxx
    Pp5x=13384;  % Vease tabla 3.13
    Pp5y=-2360;  % Vease tabla 3.13
    Pp10x=-13384;  % Vease tabla 3.13
    Pp10y=2360;  % Vease tabla 3.13
    P6=-1434; % Vease tabla 3.13
    
    Ab=0.0054;  %Area de tuberia
    I3=1.68e-5; % I de tuberia
    e=0.007112;         %Espesor de la pared de la tuberia
    De=0.168;        %Diametro externo de la tuberia
    Di=0.146;        %Diametro interno de la tuberia
    stub=2e-4;   %Modulo elastico de la seccion de tuberia 
    EApermisible=415e6; %Esfuerzo permisible de traccion del material empleado
end;

if opcion==3
    %Inicio de parametros que identifica perfil o tuberia a emplear
    %Perfil HEA 360
    Aa=0.014;  %Area del perfil elegido
    I1=7.88e-5;  %Iyy del perfil elegido
    I2=3.31e-4;  %Ixx del perfil elegido
    tw=10e-3; %Espesor del alma
    tf=17.5e-3; %Espesor del ala
    bf=300e-3; %Ancho del ala
    d=350e-3;  %Altura neta del perfil H
    svigay=5.25e-4; %Modulo elastico de la seccion menor, Syy
    svigax=1.89e-3; %Modulo elastico de la seccion mayor, Sxx
    Pp5x=15609;  % Vease tabla 3.13
    Pp5y=-2711;  % Vease tabla 3.13
    Pp10x=-15609;  % Vease tabla 3.13
    Pp10y=2711;  % Vease tabla 3.13
    P6=-1647;  % Vease tabla 3.13

    Ab=0.0054;  %Area de tuberia
    I3=1.68e-5; % I de tuberia
    e=0.007112;         %Espesor de la pared de la tuberia
    De=0.168;        %Diametro externo de la tuberia
    Di=0.146;        %Diametro interno de la tuberia
    stub=2e-4;   %Modulo elastico de la seccion de tuberia 
    EApermisible=415e6; %Esfuerzo permisible de traccion del material empleado
end;

if opcion==4
    %Inicio de parametros que identifica perfil o tuberia a emplear
    %Perfil HEA 450
    Aa=0.018;  %Area del perfil elegido
    I1=9.46e-5;  %Iyy del perfil elegido
    I2=6.37e-4;  %Ixx del perfil elegido
    tw=11.5e-3; %Espesor del alma
    tf=21e-3; %Espesor del ala
    bf=300e-3; %Ancho del ala
    d=440e-3;  %Altura neta del perfil H
    svigay=6.31e-4; %Modulo elastico de la seccion menor, Syy
    svigax=2.9e-3; %Modulo elastico de la seccion mayor, Sxx
    Pp5x=19208;  % Vease tabla 3.13
    Pp5y=-3387;  % Vease tabla 3.13
    Pp10x=-19208;  % Vease tabla 3.13
    Pp10y=3387;  % Vease tabla 3.13
    P6=-2058; % Vease tabla 3.13

    Ab=0.0054;  %Area de tuberia
    I3=1.68e-5; % I de tuberia
    e=0.007112;         %Espesor de la pared de la tuberia
    De=0.168;        %Diametro externo de la tuberia
    Di=0.146;        %Diametro interno de la tuberia
    stub=2e-4;   %Modulo elastico de la seccion de tuberia 
    EApermisible=415e6; %Esfuerzo permisible de traccion del material empleado
end;
%Fin de parametros que identifica perfil o tuberia a emplear
nn=0;  
E=200e9;
l1=2.84;
la1=2.84;
Prfa1=-35280;
l2=2.84;
la2=2.84;
Prfa2=-8781;
Pmp1=-9945; 
l3=1.42;
la3=2.84;
l4=2.84;
la4=2.84;
l5=2.84;
la5=2.84;
l6=1.5;
la6=3;
Pa6=-15131;
Pt6=-54165;
l7=2.84;
la7=2.84;
l8=2.84;
la8=2.84;
l9=1.42;
la9=2.84;
l10=2.84;
la10=2.84;
Prfa20=-8781;
Pmp2=-9945;
l11=2.84;
la11=2.84;
Prfa10=-35280;
l12=3.4;
la12=6.8;
P12=-2829;
l13=1.5;
la13=3;
P13=-1248;
l14=1.5;
la14=3;
P14=1248;
l15=1.2;
la15=2.4;
P15=-999;
l16=1.2;
la16=2.4;
P16=999;
l17=2.9;
la17=5.8;
P17=-2419;
l18=1.8;
la18=3.6;
P18x=-1133;
P18y=-985;
l19=1.8;
la19=3.6;
P19x=-1133;
P19y=985;
l20=2;
la20=4;
P20x=-1004;
P20y=-1332;
l21=2;
la21=4;
P21x=-1004;
P21y=1332;

delta1=0;
teta1=0;
y1=0;
delta12=0;
teta12=0;
y12=0;
deltaa1=0;
tetaa1=0;
ya1=0;
deltaa12=0;
tetaa12=0;
ya12=0;

z1=[delta1 y1 teta1 A1 M1 V1 1];
z21=[delta21 y21 teta21 A21 M21 V21 1];
za1=[deltaa1 ya1 tetaa1 Aa1 Ma1 Va1 1];
za21=[deltaa21 ya21 tetaa21 Aa21 Ma21 Va21 1];

z22=[delta22 y22 teta22 A22 M22 V22 1];
z32=[delta32 y32 teta32 A32 M32 V32 1];
za22=[deltaa22 ya22 tetaa22 Aa22 Ma22 Va22 1];
za32=[deltaa32 ya32 tetaa32 Aa32 Ma32 Va32 1];

z43=[delta43 y43 teta43 A43 M43 V43 1];
z33=[delta33 y33 teta33 A33 M33 V33 1];
za43=[deltaa43 ya43 tetaa43 Aa43 Ma43 Va43 1];
za33=[deltaa33 ya33 tetaa33 Aa33 Ma33 Va33 1];

z54=[delta54 y54 teta54 A54 M54 V54 1];
z44=[delta44 y44 teta44 A44 M44 V44 1];
za54=[deltaa54 ya54 tetaa54 Aa54 Ma54 Va54 1];
za44=[deltaa44 ya44 tetaa44 Aa44 Ma44 Va44 1];

z65=[delta65 y65 teta65 A65 M65 V65 1];
z55=[delta55 y55 teta55 A55 M55 V55 1];
za65=[deltaa65 ya65 tetaa65 Aa65 Ma65 Va65 1];
za55=[deltaa55 ya55 tetaa55 Aa55 Ma55 Va55 1];

z76=[delta76 y76 teta76 A76 M76 V76 1];
z66=[delta66 y66 teta66 A66 M66 V66 1];
za76=[deltaa76 ya76 tetaa76 Aa76 Ma76 Va76 1];
za66=[deltaa66 ya66 tetaa66 Aa66 Ma66 Va66 1];

z87=[delta87 y87 teta87 A87 M87 V87 1];
z77=[delta77 y77 teta77 A77 M77 V77 1];
za87=[deltaa87 ya87 tetaa87 Aa87 Ma87 Va87 1];
za77=[deltaa77 ya77 tetaa77 Aa77 Ma77 Va77 1];

z98=[delta98 y98 teta98 A98 M98 V98 1];
z88=[delta88 y88 teta88 A88 M88 V88 1];
za98=[deltaa98 ya98 tetaa98 Aa98 Ma98 Va98 1];
za88=[deltaa88 ya88 tetaa88 Aa88 Ma88 Va88 1];

z109=[delta109 y109 teta109 A109 M109 V109 1];
z99=[delta99 y99 teta99 A99 M99 V99 1];
za109=[deltaa109 ya109 tetaa109 Aa109 Ma109 Va109 1];
za99=[deltaa99 ya99 tetaa99 Aa99 Ma99 Va99 1];

z1110=[delta1110 y1110 teta1110 A1110 M1110 V1110 1];
z1010=[delta1010 y1010 teta1010 A1010 M1010 V1010 1];
za1110=[deltaa1110 ya1110 tetaa1110 Aa1110 Ma1110 Va1110 1];
za1010=[deltaa1010 ya1010 tetaa1010 Aa1010 Ma1010 Va1010 1];

z1111=[delta1111 y1111 teta1111 A1111 M1111 V1111 1];
z12=[delta12 y12 teta12 A12 M12 V12 1];
za1111=[deltaa1111 ya1111 tetaa1111 Aa1111 Ma1111 Va1111 1];
za12=[deltaa12 ya12 tetaa12 Aa12 Ma12 Va12 1];

z1112=[delta1112 y1112 teta1112 A1112 M1112 V1112 1];
z212=[delta212 y212 teta212 A212 M212 V212 1];
za1112=[deltaa1112 ya1112 tetaa1112 Aa1112 Ma1112 Va1112 1];
za212=[deltaa212 ya212 tetaa212 Aa212 Ma212 Va212 1];

z313=[delta313 y313 teta313 A313 M313 V313 1];
z1313=[delta1313 y1313 teta1313 A1313 M1313 V1313 1];
za313=[deltaa313 ya313 tetaa313 Aa313 Ma313 Va313 1];
za1313=[deltaa1313 ya1313 tetaa1313 Aa1313 Ma1313 Va1313 1];

z1314=[delta1314 y1314 teta1314 A1314 M1314 V1314 1];
z1014=[delta1014 y1014 teta1014 A1014 M1014 V1014 1];
za1314=[deltaa1314 ya1314 tetaa1314 Aa1314 Ma1314 Va1314 1];
za1014=[deltaa1014 ya1014 tetaa1014 Aa1014 Ma1014 Va1014 1];

z1415=[delta1415 y1415 teta1415 A1415 M1415 V1415 1];
z415=[delta415 y415 teta415 A415 M415 V415 1];
za1415=[deltaa1415 ya1415 tetaa1415 Aa1415 Ma1415 Va1415 1];
za415=[deltaa415 ya415 tetaa415 Aa415 Ma415 Va415 1];

z1416=[delta1416 y1416 teta1416 A1416 M1416 V1416 1];
z916=[delta916 y916 teta916 A916 M916 V916 1];
za1416=[deltaa1416 ya1416 tetaa1416 Aa1416 Ma1416 Va1416 1];
za916=[deltaa916 ya916 tetaa916 Aa916 Ma916 Va916 1];

z817=[delta817 y817 teta817 A817 M817 V817 1];
z517=[delta517 y517 teta517 A517 M517 V517 1];
za817=[deltaa817 ya817 tetaa817 Aa817 Ma817 Va817 1];
za517=[deltaa517 ya517 tetaa517 Aa517 Ma517 Va517 1];

z1418=[delta1418 y1418 teta1418 A1418 M1418 V1418 1];
z318=[delta318 y318 teta318 A318 M318 V318 1];
za1418=[deltaa1418 ya1418 tetaa1418 Aa1418 Ma1418 Va1418 1];
za318=[deltaa318 ya318 tetaa318 Aa318 Ma318 Va318 1];

z1419=[delta1419 y1419 teta1419 A1419 M1419 V1419 1];
z1019=[delta1019 y1019 teta1019 A1019 M1019 V1019 1];
za1419=[deltaa1419 ya1419 tetaa1419 Aa1419 Ma1419 Va1419 1];
za1019=[deltaa1019 ya1019 tetaa1019 Aa1019 Ma1019 Va1019 1];

z1320=[delta1320 y1320 teta1320 A1320 M1320 V1320 1];
z220=[delta220 y220 teta220 A220 M220 V220 1];
za1320=[deltaa1320 ya1320 tetaa1320 Aa1320 Ma1320 Va1320 1];
za220=[deltaa220 ya220 tetaa220 Aa220 Ma220 Va220 1];

z1321=[delta1321 y1321 teta1321 A1321 M1321 V1321 1];
z1121=[delta1121 y1121 teta1121 A1121 M1121 V1121 1];
za1321=[deltaa1321 ya1321 tetaa1321 Aa1321 Ma1321 Va1321 1];
za1121=[deltaa1121 ya1121 tetaa1121 Aa1121 Ma1121 Va1121 1];

zd21=[delta21 y21 teta21];
zd212=[delta212 y212 teta212];
zda21=[deltaa21 ya21 tetaa21];
zda212=[deltaa212 ya212 tetaa212];

zd220=[delta220 y220 teta220];
zd22=[delta22 y22 teta22];
zda220=[deltaa220 ya220 tetaa220];
zda22=[deltaa22 ya22 tetaa22];

zd32=[delta32 y32 teta32];
zd313=[delta313 y313 teta313];
zda32=[deltaa32 ya32 tetaa32];
zda313=[deltaa313 ya313 tetaa313];

zd318=[delta318 y318 teta318];
zd33=[delta33 y33 teta33];
zda318=[deltaa318 ya318 tetaa318];
zda33=[deltaa33 ya33 tetaa33];

zd43=[delta43 y43 teta43];
zd415=[delta415 y415 teta415];
zda43=[deltaa43 ya43 tetaa43];
zda415=[deltaa415 ya415 tetaa415];

zd44=[delta44 y44 teta44];
zd54=[delta54 y54 teta54];
zda44=[deltaa44 ya44 tetaa44];
zda54=[deltaa54 ya54 tetaa54];

zd517=[delta517 y517 teta517];
zd55=[delta55 y55 teta55];
zda517=[deltaa517 ya517 tetaa517];
zda55=[deltaa55 ya55 tetaa55];

zd65=[delta65 y65 teta65];
zd66=[delta66 y66 teta66];
zda65=[deltaa65 ya65 tetaa65];
zda66=[deltaa66 ya66 tetaa66];

zd76=[delta76 y76 teta76];
zd77=[delta77 y77 teta77];
zda76=[deltaa76 ya76 tetaa76];
zda77=[deltaa77 ya77 tetaa77];

zd87=[delta87 y87 teta87];
zd817=[delta817 y817 teta817];
zda87=[deltaa87 ya87 tetaa87];
zda817=[deltaa817 ya817 tetaa817];

zd88=[delta88 y88 teta88];
zd98=[delta98 y98 teta98];
zda88=[deltaa88 ya88 tetaa88];
zda98=[deltaa98 ya98 tetaa98];

zd916=[delta916 y916 teta916];
zd99=[delta99 y99 teta99];
zda916=[deltaa916 ya916 tetaa916];
zda99=[deltaa99 ya99 tetaa99];

zd109=[delta109 y109 teta109];
zd1019=[delta1019 y1019 teta1019];
zda109=[deltaa109 ya109 tetaa109];
zda1019=[deltaa1019 ya1019 tetaa1019];

zd1014=[delta1014 y1014 teta1014];
zd1010=[delta1010 y1010 teta1010];
zda1014=[deltaa1014 ya1014 tetaa1014];
zda1010=[deltaa1010 ya1010 tetaa1010];

zd1121=[delta1121 y1121 teta1121];
zd1112=[delta1112 y1112 teta1112];
zda1121=[deltaa1121 ya1121 tetaa1121];
zda1112=[deltaa1112 ya1112 tetaa1112];

zd1111=[delta1111 y1111 teta1111];
zd1110=[delta1110 y1110 teta1110];
zda1111=[deltaa1111 ya1111 tetaa1111];
zda1110=[deltaa1110 ya1110 tetaa1110];

zd1415=[delta1415 y1415 teta1415];
zd1416=[delta1416 y1416 teta1416];
zda1415=[deltaa1415 ya1415 tetaa1415];
zda1416=[deltaa1416 ya1416 tetaa1416];

zd1418=[delta1418 y1418 teta1418];
zd1419=[delta1419 y1419 teta1419];
zda1418=[deltaa1418 ya1418 tetaa1418];
zda1419=[deltaa1419 ya1419 tetaa1419];

zd1313=[delta1313 y1313 teta1313];
zd1314=[delta1314 y1314 teta1314];
zda1313=[deltaa1313 ya1313 tetaa1313];
zda1314=[deltaa1314 ya1314 tetaa1314];

zd1320=[delta1320 y1320 teta1320];
zd1321=[delta1321 y1321 teta1321];
zda1320=[deltaa1320 ya1320 tetaa1320];
zda1321=[deltaa1321 ya1321 tetaa1321];

zf21=[A21 M21 V21];
zf212=[A212 M212 V212];
zfa21=[Aa21 Ma21 Va21];
zfa212=[Aa212 Ma212 Va212];

zf220=[A220 M220 V220];
zf22=[A22 M22 V22];
zfa220=[Aa220 Ma220 Va220];
zfa22=[Aa22 Ma22 Va22];

zf32=[A32 M32 V32];
zf313=[A313 M313 V313];
zfa32=[Aa32 Ma32 Va32];
zfa313=[Aa313 Ma313 Va313];

zf318=[A318 M318 V318];
zf33=[A33 M33 V33];
zfa318=[Aa318 Ma318 Va318];
zfa33=[Aa33 Ma33 Va33];

zf43=[A43 M43 V43];
zf415=[A415 M415 V415];
zfa43=[Aa43 Ma43 Va43];
zfa415=[Aa415 Ma415 Va415];

zf44=[A44 M44 V44];
zf54=[A54 M54 V54];
zfa44=[Aa44 Ma44 Va44];
zfa54=[Aa54 Ma54 Va54];

zf517=[A517 M517 V517];
zf55=[A55 M55 V55];
zfa517=[Aa517 Ma517 Va517];
zfa55=[Aa55 Ma55 Va55];

zf65=[A65 M65 V65];
zf66=[A66 M66 V66];
zfa65=[Aa65 Ma65 Va65];
zfa66=[Aa66 Ma66 Va66];

zf76=[A76 M76 V76];
zf77=[A77 M77 V77];
zfa76=[Aa76 Ma76 Va76];
zfa77=[Aa77 Ma77 Va77];

zf87=[A87 M87 V87];
zf817=[A817 M817 V817];
zfa87=[Aa87 Ma87 Va87];
zfa817=[Aa817 Ma817 Va817];

zf88=[A88 M88 V88];
zf98=[A98 M98 V98];
zfa88=[Aa88 Ma88 Va88];
zfa98=[Aa98 Ma98 Va98];

zf916=[A916 M916 V916];
zf99=[A99 M99 V99];
zfa916=[Aa916 Ma916 Va916];
zfa99=[Aa99 Ma99 Va99];

zf109=[A109 M109 V109];
zf1019=[A1019 M1019 V1019];
zfa109=[Aa109 Ma109 Va109];
zfa1019=[Aa1019 Ma1019 Va1019];

zf1014=[A1014 M1014 V1014];
zf1010=[A1010 M1010 V1010];
zfa1014=[Aa1014 Ma1014 Va1014];
zfa1010=[Aa1010 Ma1010 Va1010];

zf1110=[A1110 M1110 V1110];
zf1121=[A1121 M1121 V1121];
zfa1110=[Aa1110 Ma1110 Va1110];
zfa1121=[Aa1121 Ma1121 Va1121];

zf1112=[A1112 M1112 V1112];
zf1111=[A1111 M1111 V1111];
zfa1112=[Aa1112 Ma1112 Va1112];
zfa1111=[Aa1111 Ma1111 Va1111];

zf1416=[A1416 M1416 V1416];
zf1415=[A1415 M1415 V1415];
zfa1416=[Aa1416 Ma1416 Va1416];
zfa1415=[Aa1415 Ma1415 Va1415];

zf1419=[A1419 M1419 V1419];
zf1418=[A1418 M1418 V1418];
zfa1419=[Aa1419 Ma1419 Va1419];
zfa1418=[Aa1418 Ma1418 Va1418];

zf1314=[A1314 M1314 V1314];
zf1313=[A1313 M1313 V1313];
zfa1314=[Aa1314 Ma1314 Va1314];
zfa1313=[Aa1313 Ma1313 Va1313];

zf1320=[A1320 M1320 V1320];
zf1321=[A1321 M1321 V1321];
zfa1320=[Aa1320 Ma1320 Va1320];
zfa1321=[Aa1321 Ma1321 Va1321];

L1=[1 0 0 l1/(E*Aa) 0 0 0;0 1 l1 0 l1^2/(2*E*I1) l1^3/(6*E*I1) 0;0 0 1 0 l1/(E*I1)  l1^2/(2*E*I1) 0;0 0 0 1 0 0 0;0 0 0 0 1 l1 0;0 0 0 0 0 1 0;0 0 0 0 0 0 1];
La1=[1 0 0 la1/(E*Aa) 0 0 0;0 1 la1 0 la1^2/(2*E*I2) la1^3/(6*E*I2) 0;0 0 1 0 la1/(E*I2)  la1^2/(2*E*I2) 0;0 0 0 1 0 0 0;0 0 0 0 1 la1 0;0 0 0 0 0 1 0;0 0 0 0 0 0 1];
L2=[1 0 0 l2/(E*Aa) 0 0 0;0 1 l2 0 l2^2/(2*E*I1) l2^3/(6*E*I1) 0;0 0 1 0 l2/(E*I1)  l2^2/(2*E*I1) 0;0 0 0 1 0 0 0;0 0 0 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in(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD2=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf2=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa2=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa2=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD3=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf3=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa3=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa3=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD4=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf4=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa4=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa4=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD5=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf5=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa5=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa5=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=-80*pi/180;
RD7=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf7=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa7=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa7=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD8=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf8=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa8=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa8=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD9=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf9=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa9=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa9=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD10=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf10=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa10=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa10=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD11=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf11=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa11=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa11=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=0;
RD6=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf6=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa6=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa6=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD12=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf12=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa12=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa12=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD13=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf13=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa13=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa13=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD15=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf15=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa15=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa15=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD17=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf17=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa17=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa17=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=-pi;
RD14=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf14=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa14=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa14=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RD16=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf16=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa16=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa16=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=41*pi/180;
RD18=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf18=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa18=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa18=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=-41*pi/180;
RD19=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf19=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa19=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa19=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=37*pi/180;
RD20=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf20=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa20=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa20=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

alpha=-37*pi/180;
RD21=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rf21=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];
RDa21=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 1];
Rfa21=[cos(alpha) 0 -sin(alpha) ;0 1 0;sin(alpha) 0 cos(alpha)];

EC1=Rf1*zf21.'-Rf12*zf212.'-Rf20*zf220.'-Rf2*zf22.';
EC2=Rf2*zf32.'-Rf13*zf313.'-Rf18*zf318.'-Rf3*zf33.';
EC3=Rf3*zf43.'-Rf15*zf415.'-Rf4*zf44.';
EC4=Rf4*zf54.'-Rf17*zf517.'-Rf5*zf55.';
EC5=Rf5*zf65.'-Rf6*zf66.';
EC6=Rf6*zf76.'-Rf7*zf77.';
EC7=Rf17*zf817.'+Rf7*zf87.'-Rf8*zf88.';
EC8=Rf8*zf98.'-Rf9*zf99.'-Rf16*zf916.';
EC9=Rf9*zf109.'-Rf10*zf1010.'-Rf14*zf1014.'-Rf19*zf1019.';
EC10=Rf10*zf1110.'+Rf12*zf1112.'-Rf11*zf1111.'-Rf21*zf1121.';
EC11=Rf16*zf1416.'+Rf15*zf1415.'+Rf19*zf1419.'+Rf18*zf1418.';
EC12=Rf14*zf1314.'+Rf13*zf1313.'+Rf21*zf1321.'-Rf20*zf1320.';

EC13=RD1*zd21.'-RD12*zd212.';
EC14=RD1*zd21.'-RD20*zd220.';
EC15=RD1*zd21.'-RD2*zd22.';

EC16=RD2*zd32.'-RD13*zd313.';
EC17=RD2*zd32.'-RD18*zd318.';
EC18=RD2*zd32.'-RD3*zd33.';

EC19=RD3*zd43.'-RD15*zd415.';
EC20=RD3*zd43.'-RD4*zd44.';

EC21=RD4*zd54.'-RD17*zd517.';
EC22=RD4*zd54.'-RD5*zd55.';

EC23=RD5*zd65.'-RD6*zd66.';
EC24=RD6*zd76.'-RD7*zd77.';

EC25=RD7*zd87.'-RD8*zd88.';
EC26=RD17*zd817.'-RD8*zd88.';

EC27=RD8*zd98.'-RD9*zd99.';
EC28=RD8*zd98.'-RD16*zd916.';

EC29=RD9*zd109.'-RD10*zd1010.';
EC30=RD9*zd109.'-RD14*zd1014.';
EC31=RD9*zd109.'-RD19*zd1019.';

EC32=RD10*zd1110.'-RD11*zd1111.';
EC33=RD10*zd1110.'-RD21*zd1121.';
EC34=RD10*zd1110.'-RD12*zd1112.';

EC35=RD15*zd1415.'-RD16*zd1416.';
EC36=RD15*zd1415.'-RD19*zd1419.';
EC37=RD15*zd1415.'-RD18*zd1418.';

EC38=RD13*zd1313.'-RD14*zd1314.';
EC39=RD13*zd1313.'-RD21*zd1321.';
EC40=RD13*zd1313.'-RD20*zd1320.';

EC41= z21.'-L1*z1.'; 
EC42= z32.'-L2*z22.';
EC43= z43.'-L3*Q3*L3*z33.';
EC44= z54.'-L4*z44.';
EC45= z65.'-L5*z55.';
EC46= z76.'-L6*Q6*L6*z66.';
EC47= z87.'-L7*z77.';
EC48= z98.'-L8*z88.';
EC49= z109.'-L9*Q9*L9*z99.';
EC50= z1110.'-L10*z1010.';
EC51= z1111.'-L11*z12.';
EC52= z1112.'-L12*Q12*L12*z212.';
EC53= z1313.'-L13*Q13*L13*z313.';
EC54= z1314.'-L14*Q14*L14*z1014.' ;
EC55= z1415.'-L15*Q15*L15*z415.';
EC56= z1416.'-L16*Q16*L16*z916.';
EC57= z817.'-L17*Q17*L17*z517.';
EC58= z1418.'-L18*Q18*L18*z318.';
EC59= z1419.'-L19*Q19*L19*z1019.';
EC60= z1320.'-L20*Q20*L20*z220.';
EC61= z1321.'-L21*Q21*L21*z1121.';


ECa1=Rfa1*zfa21.'-Rfa12*zfa212.'-Rfa20*zfa220.'-Rfa2*zfa22.';
ECa2=Rfa2*zfa32.'-Rfa13*zfa313.'-Rfa18*zfa318.'-Rfa3*zfa33.';
ECa3=Rfa3*zfa43.'-Rfa15*zfa415.'-Rfa4*zfa44.';
ECa4=Rfa4*zfa54.'-Rfa17*zfa517.'-Rfa5*zfa55.';
ECa5=Rfa5*zfa65.'-Rfa6*zfa66.';
ECa6=Rfa6*zfa76.'-Rfa7*zfa77.';
ECa7=Rfa17*zfa817.'+Rfa7*zfa87.'-Rfa8*zfa88.';
ECa8=Rfa8*zfa98.'-Rfa9*zfa99.'-Rfa16*zfa916.';
ECa9=Rfa9*zfa109.'-Rfa10*zfa1010.'-Rfa14*zfa1014.'-Rfa19*zfa1019.';
ECa10=Rfa10*zfa1110.'+Rfa12*zfa1112.'-Rfa11*zfa1111.'-Rfa21*zfa1121.';
ECa11=Rfa16*zfa1416.'+Rfa15*zfa1415.'+Rfa19*zfa1419.'+Rfa18*zfa1418.';
ECa12=Rfa14*zfa1314.'+Rfa13*zfa1313.'+Rfa21*zfa1321.'-Rfa20*zfa1320.';

ECa13=RDa1*zda21.'-RDa12*zda212.';
ECa14=RDa1*zda21.'-RDa20*zda220.';
ECa15=RDa1*zda21.'-RDa2*zda22.';

ECa16=RDa2*zda32.'-RDa13*zda313.';
ECa17=RDa2*zda32.'-RDa18*zda318.';
ECa18=RDa2*zda32.'-RDa3*zda33.';

ECa19=RDa3*zda43.'-RDa15*zda415.';
ECa20=RDa3*zda43.'-RDa4*zda44.';

ECa21=RDa4*zda54.'-RDa17*zda517.';
ECa22=RDa4*zda54.'-RDa5*zda55.';

ECa23=RDa5*zda65.'-RDa6*zda66.';
ECa24=RDa6*zda76.'-RDa7*zda77.';

ECa25=RDa7*zda87.'-RDa8*zda88.';
ECa26=RDa17*zda817.'-RDa8*zda88.';

ECa27=RDa8*zda98.'-RDa9*zda99.';
ECa28=RDa8*zda98.'-RDa16*zda916.';

ECa29=RDa9*zda109.'-RDa10*zda1010.';
ECa30=RDa9*zda109.'-RDa14*zda1014.';
ECa31=RDa9*zda109.'-RDa19*zda1019.';

ECa32=RDa10*zda1110.'-RDa11*zda1111.';
ECa33=RDa10*zda1110.'-RDa21*zda1121.';
ECa34=RDa10*zda1110.'-RDa12*zda1112.';

ECa35=RDa15*zda1415.'-RDa16*zda1416.';
ECa36=RDa15*zda1415.'-RDa19*zda1419.';
ECa37=RDa15*zda1415.'-RDa18*zda1418.';

ECa38=RDa13*zda1313.'-RDa14*zda1314.';
ECa39=RDa13*zda1313.'-RDa21*zda1321.';
ECa40=RDa13*zda1313.'-RDa20*zda1320.';

ECa41= za21.'-La1*Qa1*za1.'; 
ECa42= za32.'-La2*Qa2*za22.';
ECa43= za43.'-La3*za33.';
ECa44= za54.'-La4*za44.';
ECa45= za65.'-La5*za55.';
ECa46= za76.'-La6*za66.';
ECa47= za87.'-La7*za77.';
ECa48= za98.'-La8*za88.';
ECa49= za109.'-La9*za99.';
ECa50= za1110.'-La10*Qa10*za1010.';
ECa51= za1111.'-La11*Qa11*za12.';
ECa52= za1112.'-La12*za212.';
ECa53= za1313.'-La13*za313.';
ECa54= za1314.'-La14*za1014.' ;
ECa55= za1415.'-La15*za415.';
ECa56= za1416.'-La16*za916.';
ECa57= za817.'-La17*za517.';
ECa58= za1418.'-La18*za318.';
ECa59= za1419.'-La19*za1019.';
ECa60= za1320.'-La20*za220.';
ECa61= za1321.'-La21*za1121.';

HH=solve(EC1(1),EC1(2),EC1(3),EC2(1),EC2(2),EC2(3),EC3(1),EC3(2),EC3(3),EC4(1),EC4(2),EC4(3),EC5(1),EC5(2),EC5(3),EC6(1),EC6(2),EC6(3),EC7(1),EC7(2),EC7(3),EC8(1),EC8(2),EC8(3),EC9(1),EC9(2),EC9(3),EC10(1),EC10(2),EC10(3),EC11(1),EC11(2),EC11(3),EC12(1),EC12(2),EC12(3),EC13(1),EC13(2),EC13(3),EC14(1),EC14(2),EC14(3),EC15(1),EC15(2),EC15(3),EC16(1),EC16(2),EC16(3),EC17(1),EC17(2),EC17(3),EC18(1),EC18(2),EC18(3),EC19(1),EC19(2),EC19(3),EC20(1),EC20(2),EC20(3),EC21(1),EC21(2),EC21(3),EC22(1),EC22(2),EC22(3),EC23(1),EC23(2),EC23(3),EC24(1),EC24(2),EC24(3),EC25(1),EC25(2),EC25(3),EC26(1),EC26(2),EC26(3),EC27(1),EC27(2),EC27(3),EC28(1),EC28(2),EC28(3),EC29(1),EC29(2),EC29(3),EC30(1),EC30(2),EC30(3),EC31(1),EC31(2),EC31(3),EC32(1),EC32(2),EC32(3),EC33(1),EC33(2),EC33(3),EC34(1),EC34(2),EC34(3),EC35(1),EC35(2),EC35(3),EC36(1),EC36(2),EC36(3),EC37(1),EC37(2),EC37(3),EC38(1),EC38(2),EC38(3),EC39(1),EC39(2),EC39(3),EC40(1),EC40(2),EC40(3),EC41(1),EC41(2),EC41(3),EC41(4),EC41(5),EC41(6),EC42(1),EC42(2),EC42(3),EC42(4),EC42(5),EC42(6),EC43(1),EC43(2),EC43(3),EC43(4),EC43(5),EC43(6),EC44(1),EC44(2),EC44(3),EC44(4),EC44(5),EC44(6),EC45(1),EC45(2),EC45(3),EC45(4),EC45(5),EC45(6),EC46(1),EC46(2),EC46(3),EC46(4),EC46(5),EC46(6),EC47(1),EC47(2),EC47(3),EC47(4),EC47(5),EC47(6),EC48(1),EC48(2),EC48(3),EC48(4),EC48(5),EC48(6),EC49(1),EC49(2),EC49(3),EC49(4),EC49(5),EC49(6),EC50(1),EC50(2),EC50(3),EC50(4),EC50(5),EC50(6),EC51(1),EC51(2),EC51(3),EC51(4),EC51(5),EC51(6),EC52(1),EC52(2),EC52(3),EC52(4),EC52(5),EC52(6),EC53(1),EC53(2),EC53(3),EC53(4),EC53(5),EC53(6),EC54(1),EC54(2),EC54(3),EC54(4),EC54(5),EC54(6),EC55(1),EC55(2),EC55(3),EC55(4),EC55(5),EC55(6),EC56(1),EC56(2),EC56(3),EC56(4),EC56(5),EC56(6),EC57(1),EC57(2),EC57(3),EC57(4),EC57(5),EC57(6),EC58(1),EC58(2),EC58(3),EC58(4),EC58(5),EC58(6),EC59(1),EC59(2),EC59(3),EC59(4),EC59(5),EC59(6),EC60(1),EC60(2),EC60(3),EC60(4),EC60(5),EC60(6),EC61(1),EC61(2),EC61(3),EC61(4),EC61(5),EC61(6), 'A1', 'M1', 'V1','delta21', 'y21', 'teta21', 'A21' ,'M21' ,'V21','delta22','y22','teta22', 'A22' ,'M22', 'V22','delta32','y32', 'teta32','A32', 'M32', 'V32','delta43','y43','teta43', 'A43', 'M43', 'V43','delta33', 'y33', 'teta33' ,'A33', 'M33', 'V33','delta54','y54','teta54', 'A54', 'M54', 'V54','delta44','y44','teta44','A44','M44', 'V44','delta65','y65', 'teta65','A65', 'M65', 'V65', 'delta55','y55','teta55', 'A55','M55', 'V55','delta76', 'y76', 'teta76', 'A76', 'M76', 'V76','delta66', 'y66', 'teta66', 'A66','M66', 'V66','delta87', 'y87' ,'teta87', 'A87', 'M87', 'V87','delta77','y77','teta77','A77','M77','V77','delta98', 'y98','teta98', 'A98', 'M98', 'V98','delta88', 'y88', 'teta88', 'A88', 'M88', 'V88','delta109', 'y109', 'teta109', 'A109', 'M109', 'V109'                             ,'delta99', 'y99', 'teta99', 'A99','M99', 'V99','delta1110', 'y1110', 'teta1110', 'A1110', 'M1110', 'V1110','delta1010', 'y1010', 'teta1010', 'A1010', 'M1010', 'V1010', 'delta1111', 'y1111', 'teta1111', 'A1111', 'M1111', 'V1111',  'A12', 'M12', 'V12','delta1112', 'y1112','teta1112','A1112','M1112', 'V1112','delta212', 'y212', 'teta212', 'A212', 'M212', 'V212','delta313', 'y313', 'teta313', 'A313', 'M313', 'V313','delta1313', 'y1313', 'teta1313', 'A1313', 'M1313', 'V1313','delta1314', 'y1314' ,'teta1314', 'A1314', 'M1314', 'V1314','delta1014', 'y1014', 'teta1014', 'A1014', 'M1014', 'V1014','delta1415', 'y1415', 'teta1415', 'A1415', 'M1415', 'V1415','delta415', 'y415','teta415', 'A415', 'M415', 'V415','delta1416', 'y1416', 'teta1416', 'A1416', 'M1416', 'V1416', 'delta916', 'y916', 'teta916', 'A916', 'M916', 'V916','delta817', 'y817', 'teta817', 'A817', 'M817', 'V817','delta517', 'y517', 'teta517', 'A517', 'M517', 'V517','delta1418', 'y1418', 'teta1418', 'A1418', 'M1418', 'V1418','delta318', 'y318', 'teta318', 'A318', 'M318', 'V318','delta1419', 'y1419', 'teta1419', 'A1419', 'M1419', 'V1419','delta1019', 'y1019', 'teta1019', 'A1019', 'M1019', 'V1019','delta1320', 'y1320', 'teta1320', 'A1320', 'M1320', 'V1320','delta220', 'y220', 'teta220', 'A220', 'M220', 'V220','delta1321', 'y1321', 'teta1321', 'A1321', 'M1321', 'V1321','delta1121', 'y1121', 'teta1121', 'A1121', 'M1121', 'V1121');

HHa=solve(ECa1(1),ECa1(2),ECa1(3),ECa2(1),ECa2(2),ECa2(3),ECa3(1),ECa3(2),ECa3(3),ECa4(1),ECa4(2),ECa4(3),ECa5(1),ECa5(2),ECa5(3),ECa6(1),ECa6(2),ECa6(3),ECa7(1),ECa7(2),ECa7(3),ECa8(1),ECa8(2),ECa8(3),ECa9(1),ECa9(2),ECa9(3),ECa10(1),ECa10(2),ECa10(3),ECa11(1),ECa11(2),ECa11(3),ECa12(1),ECa12(2),ECa12(3),ECa13(1),ECa13(2),ECa13(3),ECa14(1),ECa14(2),ECa14(3),ECa15(1),ECa15(2),ECa15(3),ECa16(1),ECa16(2),ECa16(3),ECa17(1),ECa17(2),ECa17(3),ECa18(1),ECa18(2),ECa18(3),ECa19(1),ECa19(2),ECa19(3),ECa20(1),ECa20(2),ECa20(3),ECa21(1),ECa21(2),ECa21(3),ECa22(1),ECa22(2),ECa22(3),ECa23(1),ECa23(2),ECa23(3),ECa24(1),ECa24(2),ECa24(3),ECa25(1),ECa25(2),ECa25(3),ECa26(1),ECa26(2),ECa26(3),ECa27(1),ECa27(2),ECa27(3),ECa28(1),ECa28(2),ECa28(3),ECa29(1),ECa29(2),ECa29(3),ECa30(1),ECa30(2),ECa30(3),ECa31(1),ECa31(2),ECa31(3),ECa32(1),ECa32(2),ECa32(3),ECa33(1),ECa33(2),ECa33(3),ECa34(1),ECa34(2),ECa34(3),ECa35(1),ECa35(2),ECa35(3),ECa36(1),ECa36(2),ECa36(3),ECa37(1),ECa37(2),ECa37(3),ECa38(1),ECa38(2),ECa38(3),ECa39(1),ECa39(2),ECa39(3),ECa40(1),ECa40(2),ECa40(3),ECa41(1),ECa41(2),ECa41(3),ECa41(4),ECa41(5),ECa41(6),ECa42(1),ECa42(2),ECa42(3),ECa42(4),ECa42(5),ECa42(6),ECa43(1),ECa43(2),ECa43(3),ECa43(4),ECa43(5),ECa43(6),ECa44(1),ECa44(2),ECa44(3),ECa44(4),ECa44(5),ECa44(6),ECa45(1),ECa45(2),ECa45(3),ECa45(4),ECa45(5),ECa45(6),ECa46(1),ECa46(2),ECa46(3),ECa46(4),ECa46(5),ECa46(6),ECa47(1),ECa47(2),ECa47(3),ECa47(4),ECa47(5),ECa47(6),ECa48(1),ECa48(2),ECa48(3),ECa48(4),ECa48(5),ECa48(6),ECa49(1),ECa49(2),ECa49(3),ECa49(4),ECa49(5),ECa49(6),ECa50(1),ECa50(2),ECa50(3),ECa50(4),ECa50(5),ECa50(6),ECa51(1),ECa51(2),ECa51(3),ECa51(4),ECa51(5),ECa51(6),ECa52(1),ECa52(2),ECa52(3),ECa52(4),ECa52(5),ECa52(6),ECa53(1),ECa53(2),ECa53(3),ECa53(4),ECa53(5),ECa53(6),ECa54(1),ECa54(2),ECa54(3),ECa54(4),ECa54(5),ECa54(6),ECa55(1),ECa55(2),ECa55(3),ECa55(4),ECa55(5),ECa55(6),ECa56(1),ECa56(2),ECa56(3),ECa56(4),ECa56(5),ECa56(6),ECa57(1),ECa57(2),ECa57(3),ECa57(4),ECa57(5),ECa57(6),ECa58(1),ECa58(2),ECa58(3),ECa58(4),ECa58(5),ECa58(6),ECa59(1),ECa59(2),ECa59(3),ECa59(4),ECa59(5),ECa59(6),ECa60(1),ECa60(2),ECa60(3),ECa60(4),ECa60(5),ECa60(6),ECa61(1),ECa61(2),ECa61(3),ECa61(4),ECa61(5),ECa61(6), 'Aa1', 'Ma1', 'Va1','deltaa21', 'ya21', 'tetaa21', 'Aa21' ,'Ma21' ,'Va21','deltaa22','ya22','tetaa22', 'Aa22' ,'Ma22', 'Va22','deltaa32','ya32', 'tetaa32','Aa32', 'Ma32', 'Va32','deltaa43','ya43','tetaa43', 'Aa43', 'Ma43', 'Va43','deltaa33', 'ya33', 'tetaa33' ,'Aa33', 'Ma33', 'Va33','deltaa54','ya54','tetaa54', 'Aa54', 'Ma54', 'Va54','deltaa44','ya44','tetaa44','Aa44','Ma44', 'Va44','deltaa65','ya65', 'tetaa65','Aa65', 'Ma65', 'Va65', 'deltaa55','ya55','tetaa55', 'Aa55','Ma55', 'Va55','deltaa76', 'ya76', 'tetaa76', 'Aa76', 'Ma76', 'Va76','deltaa66', 'ya66', 'tetaa66', 'Aa66','Ma66', 'Va66','deltaa87', 'ya87' ,'tetaa87', 'Aa87', 'Ma87', 'Va87','deltaa77','ya77','tetaa77','Aa77','Ma77','Va77','deltaa98', 'ya98','tetaa98', 'Aa98', 'Ma98', 'Va98','deltaa88', 'ya88', 'tetaa88', 'Aa88', 'Ma88', 'Va88','deltaa109', 'ya109', 'tetaa109', 'Aa109', 'Ma109', 'Va109'                             ,'deltaa99', 'ya99', 'tetaa99', 'Aa99','Ma99', 'Va99','deltaa1110', 'ya1110', 'tetaa1110', 'Aa1110', 'Ma1110', 'Va1110','deltaa1010', 'ya1010', 'tetaa1010', 'Aa1010', 'Ma1010', 'Va1010', 'deltaa1111', 'ya1111', 'tetaa1111', 'Aa1111', 'Ma1111', 'Va1111',  'Aa12', 'Ma12', 'Va12','deltaa1112', 'ya1112','tetaa1112','Aa1112','Ma1112', 'Va1112','deltaa212', 'ya212', 'tetaa212', 'Aa212', 'Ma212', 'Va212','deltaa313', 'ya313', 'tetaa313', 'Aa313', 'Ma313', 'Va313','deltaa1313', 'ya1313', 'tetaa1313', 'Aa1313', 'Ma1313', 'Va1313','deltaa1314', 'ya1314' ,'tetaa1314', 'Aa1314', 'Ma1314', 'Va1314','deltaa1014', 'ya1014', 'tetaa1014', 'Aa1014', 'Ma1014', 'Va1014','deltaa1415', 'ya1415', 'tetaa1415', 'Aa1415', 'Ma1415', 'Va1415','deltaa415', 'ya415','tetaa415', 'Aa415', 'Ma415', 'Va415','deltaa1416', 'ya1416', 'tetaa1416', 'Aa1416', 'Ma1416', 'Va1416', 'deltaa916', 'ya916', 'tetaa916', 'Aa916', 'Ma916', 'Va916','deltaa817', 'ya817', 'tetaa817', 'Aa817', 'Ma817', 'Va817','deltaa517', 'ya517', 'tetaa517', 'Aa517', 'Ma517', 'Va517','deltaa1418', 'ya1418', 'tetaa1418', 'Aa1418', 'Ma1418', 'Va1418','deltaa318', 'ya318', 'tetaa318', 'Aa318', 'Ma318', 'Va318','deltaa1419', 'ya1419', 'tetaa1419', 'Aa1419', 'Ma1419', 'Va1419','deltaa1019', 'ya1019', 'tetaa1019', 'Aa1019', 'Ma1019', 'Va1019','deltaa1320', 'ya1320', 'tetaa1320', 'Aa1320', 'Ma1320', 'Va1320','deltaa220', 'ya220', 'tetaa220', 'Aa220', 'Ma220', 'Va220','deltaa1321', 'ya1321', 'tetaa1321', 'Aa1321', 'Ma1321', 'Va1321','deltaa1121', 'ya1121', 'tetaa1121', 'Aa1121', 'Ma1121', 'Va1121');


% COMPORTAMIENTO DEL ELEMENTO 1, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A1=double(HH.A1);
AXIAL(1)=A1;
M1=double(HH.M1);
MOMENTO(1)=M1;
V1=double(HH.V1);
CORTANTE(1)=V1;
delta21=double(HH.delta21);
y21=double(HH.y21);
teta21=double(HH.teta21);
DELTA(1)=delta21;
Y(1)=y21;
TETA(1)=teta21;

Aa1=double(HHa.Aa1);
AXIALa(1)=Aa1;
Ma1=double(HHa.Ma1);
MOMENTOa(1)=Ma1;
Va1=double(HHa.Va1);
CORTANTEa(1)=Va1;
deltaa21=double(HHa.deltaa21);
ya21=double(HHa.ya21);
tetaa21=double(HHa.tetaa21);
DELTAa(1)=deltaa21;
Ya(1)=ya21;
TETAa(1)=tetaa21;

A21=double(HH.A21);
AXIAL(2)=A21;
M21=double(HH.M21);
MOMENTO(2)=M21;
V21=double(HH.V21);
CORTANTE(2)=V21;
delta22=double(HH.delta22);
y22=double(HH.y22);
teta22=double(HH.teta22);
DELTA(2)=delta22;
Y(2)=y22;
TETA(2)=teta22;

Aa21=double(HHa.Aa21);
AXIALa(2)=Aa21;
Ma21=double(HHa.Ma21);
MOMENTOa(2)=Ma21;
Va21=double(HHa.Va21);
CORTANTEa(2)=Va21;
deltaa22=double(HHa.deltaa22);
ya22=double(HHa.ya22);
tetaa22=double(HHa.tetaa22);
DELTAa(2)=deltaa22;
Ya(2)=ya22;
TETAa(2)=tetaa22;
                  
% COMPORTAMIENTO DEL ELEMENTO 2, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A22=double(HH.A22);
AXIAL(3)=A22;
M22=double(HH.M22);
MOMENTO(3)=M22;
V22=double(HH.V22);
CORTANTE(3)=V22;
delta32=double(HH.delta32);
y32=double(HH.y32);
teta32=double(HH.teta32);
DELTA(3)=delta32;
Y(3)=y32;
TETA(3)=teta32;

Aa22=double(HHa.Aa22);
AXIALa(3)=Aa22;
Ma22=double(HHa.Ma22);
MOMENTOa(3)=Ma22;
Va22=double(HHa.Va22);
CORTANTEa(3)=Va22;
deltaa32=double(HHa.deltaa32);
ya32=double(HHa.ya32);
tetaa32=double(HHa.tetaa32);
DELTAa(3)=deltaa32;
Ya(3)=ya32;
TETAa(3)=tetaa32;

A32=double(HH.A32);
AXIAL(4)=A32;
M32=double(HH.M32);
MOMENTO(4)=M32;
V32=double(HH.V32);
CORTANTE(4)=V32;
delta43=double(HH.delta43);
y43=double(HH.y43);
teta43=double(HH.teta43);
DELTA(4)=delta43;
Y(4)=y43;
TETA(4)=teta43;

Aa32=double(HHa.Aa32);
AXIALa(4)=Aa32;
Ma32=double(HHa.Ma32);
MOMENTOa(4)=Ma32;
Va32=double(HHa.Va32);
CORTANTEa(4)=Va32;
deltaa43=double(HHa.deltaa43);
ya43=double(HHa.ya43);
tetaa43=double(HHa.tetaa43);
DELTAa(4)=deltaa43;
Ya(4)=ya43;
TETAa(4)=tetaa43;

% COMPORTAMIENTO DEL ELEMENTO 3, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A33=double(HH.A33);
AXIAL(6)=A33;
M33=double(HH.M33);
MOMENTO(6)=M33;
V33=double(HH.V33);
CORTANTE(6)=V33;
delta54=double(HH.delta54);
y54=double(HH.y54);
teta54=double(HH.teta54);
DELTA(6)=delta54;
Y(6)=y54;
TETA(6)=teta54;

Aa33=double(HHa.Aa33);
AXIALa(6)=Aa33;
Ma33=double(HHa.Ma33);
MOMENTOa(6)=Ma33;
Va33=double(HHa.Va33);
CORTANTEa(6)=Va33;
deltaa54=double(HHa.deltaa54);
ya54=double(HHa.ya54);
tetaa54=double(HHa.tetaa54);
DELTAa(6)=deltaa54;
Ya(6)=ya54;
TETAa(6)=tetaa54;

A43=double(HH.A43);
AXIAL(5)=A43;
M43=double(HH.M43);,
MOMENTO(5)=M43;
V43=double(HH.V43);
CORTANTE(5)=V43;
delta33=double(HH.delta33);
y33=double(HH.y33);
teta33=double(HH.teta33);
DELTA(5)=delta33;
Y(5)=y33;
TETA(5)=teta33;

Aa43=double(HHa.Aa43);
AXIALa(5)=Aa43;
Ma43=double(HHa.Ma43);
MOMENTOa(5)=Ma43;
Va43=double(HHa.Va43);
CORTANTEa(5)=Va43;
deltaa33=double(HHa.deltaa33);
ya33=double(HHa.ya33);
tetaa33=double(HHa.tetaa33);
DELTAa(5)=deltaa33;
Ya(5)=ya33;
TETAa(5)=tetaa33;

% COMPORTAMIENTO DEL ELEMENTO 4, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A44=double(HH.A44);
AXIAL(8)=A44;
M44=double(HH.M44);
MOMENTO(8)=M44;
V44=double(HH.V44);
CORTANTE(8)=V44;
delta65=double(HH.delta65);
y65=double(HH.y65);
teta65=double(HH.teta65);
DELTA(8)=delta65;
Y(8)=y65;
TETA(8)=teta65;

Aa44=double(HHa.Aa44);
AXIALa(8)=Aa44;
Ma44=double(HHa.Ma44);
MOMENTOa(8)=Ma44;
Va44=double(HHa.Va44);
CORTANTEa(8)=Va44;
deltaa65=double(HHa.deltaa65);
ya65=double(HHa.ya65);
tetaa65=double(HHa.tetaa65);
DELTAa(8)=deltaa65;
Ya(8)=ya65;
TETAa(8)=tetaa65;

A54=double(HH.A54);
AXIAL(7)=A54;
M54=double(HH.M54);
MOMENTO(7)=M54;
V54=double(HH.V54);
CORTANTE(7)=V54;
delta44=double(HH.delta44);
y44=double(HH.y44);
teta44=double(HH.teta44);
DELTA(7)=delta44;
Y(7)=y44;
TETA(7)=teta44;

Aa54=double(HHa.Aa54);
AXIALa(7)=Aa54;
Ma54=double(HHa.Ma54);
MOMENTOa(7)=Ma54;
Va54=double(HHa.Va54);
CORTANTEa(7)=Va54;
deltaa44=double(HHa.deltaa44);
ya44=double(HHa.ya44);
tetaa44=double(HHa.tetaa44);
DELTAa(7)=deltaa44;
Ya(7)=ya44;
TETAa(7)=tetaa44;

% COMPORTAMIENTO DEL ELEMENTO 5, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A55=double(HH.A55);
AXIAL(10)=A55;
M55=double(HH.M55);
MOMENTO(10)=M55;
V55=double(HH.V55);
CORTANTE(10)=V55;
delta76=double(HH.delta76);
y76=double(HH.y76);
teta76=double(HH.teta76);
DELTA(10)=delta76;
Y(10)=y76;
TETA(10)=teta76;

Aa55=double(HHa.Aa55);
AXIALa(10)=Aa55;
Ma55=double(HHa.Ma55);
MOMENTOa(10)=Ma55;
Va55=double(HHa.Va55);
CORTANTEa(10)=Va55;
deltaa76=double(HHa.deltaa76);
ya76=double(HHa.ya76);
tetaa76=double(HHa.tetaa76);
DELTAa(10)=deltaa76;
Ya(10)=ya76;
TETAa(10)=tetaa76;

A65=double(HH.A65);
AXIAL(9)=A65;
M65=double(HH.M65);
MOMENTO(9)=M65;
V65=double(HH.V65);
CORTANTE(9)=V65;
delta55=double(HH.delta55);
y55=double(HH.y55);
teta55=double(HH.teta55);
DELTA(9)=delta55;
Y(9)=y55;
TETA(9)=teta55;

Aa65=double(HHa.Aa65);
AXIALa(9)=Aa65;
Ma65=double(HHa.Ma65);
MOMENTOa(9)=Ma65;
Va65=double(HHa.Va65);
CORTANTEa(9)=Va65;
deltaa55=double(HHa.deltaa55);
ya55=double(HHa.ya55);
tetaa55=double(HHa.tetaa55);
DELTAa(9)=deltaa55;
Ya(9)=ya55;
TETAa(9)=tetaa55;

% COMPORTAMIENTO DEL ELEMENTO 6, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A66=double(HH.A66);
AXIAL(12)=A66;
M66=double(HH.M66);
MOMENTO(12)=M66;
V66=double(HH.V66);
CORTANTE(12)=V66;
delta87=double(HH.delta87);
y87=double(HH.y87);
teta87=double(HH.teta87);
DELTA(12)=delta87;
Y(12)=y87;
TETA(12)=teta87;

Aa66=double(HHa.Aa66);
AXIALa(12)=Aa66;
Ma66=double(HHa.Ma66);
MOMENTOa(12)=Ma66;
Va66=double(HHa.Va66);
CORTANTEa(12)=Va66;
deltaa87=double(HHa.deltaa87);
ya87=double(HHa.ya87);
tetaa87=double(HHa.tetaa87);
DELTAa(12)=deltaa87;
Ya(12)=ya87;
TETAa(12)=tetaa87;

A76=double(HH.A76);
AXIAL(11)=A76;
M76=double(HH.M76);
MOMENTO(11)=M76;
V76=double(HH.V76);
CORTANTE(11)=V76;
delta66=double(HH.delta66);
y66=double(HH.y66);
teta66=double(HH.teta66);
DELTA(11)=delta66;
Y(11)=y66;
TETA(11)=teta66;

Aa76=double(HHa.Aa76);
AXIALa(11)=Aa76;
Ma76=double(HHa.Ma76);
MOMENTOa(11)=Ma76;
Va76=double(HHa.Va76);
CORTANTEa(11)=Va76;
deltaa66=double(HHa.deltaa66);
ya66=double(HHa.ya66);
tetaa66=double(HHa.tetaa66);
DELTAa(11)=deltaa66;
Ya(11)=ya66;
TETAa(11)=tetaa66;

% COMPORTAMIENTO DEL ELEMENTO 7, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A77=double(HH.A77);
AXIAL(14)=A77;
M77=double(HH.M77);
MOMENTO(14)=M77;
V77=double(HH.V77);
CORTANTE(14)=V77;
delta98=double(HH.delta98);
y98=double(HH.y98);
teta98=double(HH.teta98);
DELTA(14)=delta98;
Y(14)=y98;
TETA(14)=teta98;

Aa77=double(HHa.Aa77);
AXIALa(14)=Aa77;
Ma77=double(HHa.Ma77);
MOMENTOa(14)=Ma77;
Va77=double(HHa.Va77);
CORTANTEa(14)=Va77;
deltaa98=double(HHa.deltaa98);
ya98=double(HHa.ya98);
tetaa98=double(HHa.tetaa98);
DELTAa(14)=deltaa98;
Ya(14)=ya98;
TETAa(14)=tetaa98;

A87=double(HH.A87);
AXIAL(13)=A87;
M87=double(HH.M87);
MOMENTO(13)=M87;
V87=double(HH.V87);
CORTANTE(13)=V87;
delta77=double(HH.delta77);
y77=double(HH.y77);
teta77=double(HH.teta77);
DELTA(13)=delta77;
Y(13)=y77;
TETA(13)=teta77;

Aa87=double(HHa.Aa87);
AXIALa(13)=Aa87;
Ma87=double(HHa.Ma87);
MOMENTOa(13)=Ma87;
Va87=double(HHa.Va87);
CORTANTEa(13)=Va87;
deltaa77=double(HHa.deltaa77);
ya77=double(HHa.ya77);
tetaa77=double(HHa.tetaa77);
DELTAa(13)=deltaa77;
Ya(13)=ya77;
TETAa(13)=tetaa77;

% COMPORTAMIENTO DEL ELEMENTO 8, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A88=double(HH.A88);
AXIAL(16)=A88;
M88=double(HH.M88);
MOMENTO(16)=M88;
V88=double(HH.V88);
CORTANTE(16)=V88;
delta109=double(HH.delta109);
y109=double(HH.y109);
teta109=double(HH.teta109);
DELTA(16)=delta109;
Y(16)=y109;
TETA(16)=teta109;

Aa88=double(HHa.Aa88);
AXIALa(16)=Aa88;
Ma88=double(HHa.Ma88);
MOMENTOa(16)=Ma88;
Va88=double(HHa.Va88);
CORTANTEa(16)=Va88;
deltaa109=double(HHa.deltaa109);
ya109=double(HHa.ya109);
tetaa109=double(HHa.tetaa109);
DELTAa(16)=deltaa109;
Ya(16)=ya109;
TETAa(16)=tetaa109;

A98=double(HH.A98);
AXIAL(15)=A98;
M98=double(HH.M98);
MOMENTO(15)=M98;
V98=double(HH.V98);
CORTANTE(15)=V98;
delta88=double(HH.delta88);
y88=double(HH.y88);
teta88=double(HH.teta88);
DELTA(15)=delta88;
Y(15)=y88;
TETA(15)=teta88;

Aa98=double(HHa.Aa98);
AXIALa(15)=Aa98;
Ma98=double(HHa.Ma98);
MOMENTOa(15)=Ma98;
Va98=double(HHa.Va98);
CORTANTEa(15)=Va98;
deltaa88=double(HHa.deltaa88);
ya88=double(HHa.ya88);
tetaa88=double(HHa.tetaa88);
DELTAa(15)=deltaa88;
Ya(15)=ya88;
TETAa(15)=tetaa88;

% COMPORTAMIENTO DEL ELEMENTO 9, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A99=double(HH.A99);
AXIAL(18)=A99;
M99=double(HH.M99);
MOMENTO(18)=M99;
V99=double(HH.V99);
CORTANTE(18)=V99;
delta1110=double(HH.delta1110);
y1110=double(HH.y1110);
teta1110=double(HH.teta1110);
DELTA(18)=delta1110;
Y(18)=y1110;
TETA(18)=teta1110;

Aa99=double(HHa.Aa99);
AXIALa(18)=Aa99;
Ma99=double(HHa.Ma99);
MOMENTOa(18)=Ma99;
Va99=double(HHa.Va99);
CORTANTEa(18)=Va99;
deltaa1110=double(HHa.deltaa1110);
ya1110=double(HHa.ya1110);
tetaa1110=double(HHa.tetaa1110);
DELTAa(18)=deltaa1110;
Ya(18)=ya1110;
TETAa(18)=tetaa1110;

A109=double(HH.A109);
AXIAL(17)=A109;
M109=double(HH.M109);
MOMENTO(17)=M109;
V109=double(HH.V109);
CORTANTE(17)=V109;
delta99=double(HH.delta99);
y99=double(HH.y99);
teta99=double(HH.teta99);
DELTA(17)=delta99;
Y(17)=y99;
TETA(17)=teta99;

Aa109=double(HHa.Aa109);
AXIALa(17)=Aa109;
Ma109=double(HHa.Ma109);
MOMENTOa(17)=Ma109;
Va109=double(HHa.Va109);
CORTANTEa(17)=Va109;
deltaa99=double(HHa.deltaa99);
ya99=double(HHa.ya99);
tetaa99=double(HHa.tetaa99);
DELTAa(17)=deltaa99;
Ya(17)=ya99;
TETAa(17)=tetaa99;

% COMPORTAMIENTO DEL ELEMENTO 10, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A1010=double(HH.A1010);
AXIAL(20)=A1010;
M1010=double(HH.M1010);
MOMENTO(20)=M1010;
V1010=double(HH.V1010);
CORTANTE(20)=V1010;
delta1111=double(HH.delta1111);
y1111=double(HH.y1111);
teta1111=double(HH.teta1111);
DELTA(20)=delta1111;
Y(20)=y1111;
TETA(20)=teta1111;

Aa1010=double(HHa.Aa1010);
AXIALa(20)=Aa1010;
Ma1010=double(HHa.Ma1010);
MOMENTOa(20)=Ma1010;
Va1010=double(HHa.Va1010);
CORTANTEa(20)=Va1010;
deltaa1111=double(HHa.deltaa1111);
ya1111=double(HHa.ya1111);
tetaa1111=double(HHa.tetaa1111);
DELTAa(20)=deltaa1111;
Ya(20)=ya1111;
TETAa(20)=tetaa1111;

A1110=double(HH.A1110);
AXIAL(19)=A1110;
M1110=double(HH.M1110);
MOMENTO(19)=M1110;
V1110=double(HH.V1110);
CORTANTE(19)=V1110;
delta1010=double(HH.delta1010);
y1010=double(HH.y1010);
teta1010=double(HH.teta1010);
DELTA(19)=delta1010;
Y(19)=y1010;
TETA(19)=teta1010;

Aa1110=double(HHa.Aa1110);
AXIALa(19)=Aa1110;
Ma1110=double(HHa.Ma1110);
MOMENTOa(19)=Ma1110;
Va1110=double(HHa.Va1110);
CORTANTEa(19)=Va1110;
deltaa1010=double(HHa.deltaa1010);
ya1010=double(HHa.ya1010);
tetaa1010=double(HHa.tetaa1010);
DELTAa(19)=deltaa1010;
Ya(19)=ya1010;
TETAa(19)=tetaa1010;

% COMPORTAMIENTO DEL ELEMENTO 11, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A12=double(HH.A12);
AXIAL(22)=A12;
M12=double(HH.M12);
MOMENTO(22)=M12;
V12=double(HH.V12);
CORTANTE(22)=V12;
delta1112=double(HH.delta1112);
y1112=double(HH.y1112);
teta1112=double(HH.teta1112);
DELTA(21)=delta1112;
Y(21)=y1112;
TETA(21)=teta1112;

Aa12=double(HHa.Aa12);
AXIALa(22)=Aa12;
Ma12=double(HHa.Ma12);
MOMENTOa(22)=Ma12;
Va12=double(HHa.Va12);
CORTANTEa(22)=Va12;

deltaa1112=double(HHa.deltaa1112);
ya1112=double(HHa.ya1112);
tetaa1112=double(HHa.tetaa1112);
DELTAa(21)=deltaa1112;
Ya(21)=ya1112;
TETAa(21)=tetaa1112;

A1111=double(HH.A1111);
AXIAL(21)=A1111;
M1111=double(HH.M1111);
MOMENTO(21)=M1111;
V1111=double(HH.V1111);
CORTANTE(21)=V1111;

Aa1111=double(HHa.Aa1111);
AXIALa(21)=Aa1111;
Ma1111=double(HHa.Ma1111);
MOMENTOa(21)=Ma1111;
Va1111=double(HHa.Va1111);
CORTANTEa(21)=Va1111;

% COMPORTAMIENTO DEL ELEMENTO 12, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A212=double(HH.A212);
AXIAL(24)=A212;
M212=double(HH.M212);
MOMENTO(24)=M212;
V212=double(HH.V212);
CORTANTE(24)=V212;
delta313=double(HH.delta313);
y313=double(HH.y313);
teta313=double(HH.teta313);
DELTA(23)=delta313;
Y(23)=y313;
TETA(23)=teta313;

Aa212=double(HHa.Aa212);
AXIALa(24)=Aa212;
Ma212=double(HHa.Ma212);
MOMENTOa(24)=Ma212;
Va212=double(HHa.Va212);
CORTANTEa(24)=Va212;
deltaa313=double(HHa.deltaa313);
ya313=double(HHa.ya313);
tetaa313=double(HHa.tetaa313);
DELTAa(23)=deltaa313;
Ya(23)=ya313;
TETAa(23)=tetaa313;

A1112=double(HH.A1112);
AXIAL(23)=A1112;
M1112=double(HH.M1112);
MOMENTO(23)=M1112;
V1112=double(HH.V1112);
CORTANTE(23)=V1112;
delta212=double(HH.delta212);
y212=double(HH.y212);
teta212=double(HH.teta212);
DELTA(22)=delta212;
Y(22)=y212;
TETA(22)=teta212;

Aa1112=double(HHa.Aa1112);
AXIALa(23)=Aa1112;
Ma1112=double(HHa.Ma1112);
MOMENTOa(23)=Ma1112;
Va1112=double(HHa.Va1112);
CORTANTEa(23)=Va1112;
deltaa212=double(HHa.deltaa212);
ya212=double(HHa.ya212);
tetaa212=double(HHa.tetaa212);
DELTAa(22)=deltaa212;
Ya(22)=ya212;
TETAa(22)=tetaa212;

% COMPORTAMIENTO DEL ELEMENTO 13, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A313=double(HH.A313);
AXIAL(25)=A313;
M313=double(HH.M313);
MOMENTO(25)=M313;
V313=double(HH.V313);
CORTANTE(25)=V313;
delta1313=double(HH.delta1313);
y1313=double(HH.y1313);
teta1313=double(HH.teta1313);
DELTA(24)=delta1313;
Y(24)=y1313;
TETA(24)=teta1313;

Aa313=double(HHa.Aa313);
AXIALa(25)=Aa313;
Ma313=double(HHa.Ma313);
MOMENTOa(25)=Ma313;
Va313=double(HHa.Va313);
CORTANTEa(25)=Va313;
deltaa1313=double(HHa.deltaa1313);
ya1313=double(HHa.ya1313);
tetaa1313=double(HHa.tetaa1313);
DELTAa(24)=deltaa1313;
Ya(24)=ya1313;
TETAa(24)=tetaa1313;

A1313=double(HH.A1313);
AXIAL(26)=A1313;
M1313=double(HH.M1313);
MOMENTO(26)=M1313;
V1313=double(HH.V1313);
CORTANTE(26)=V1313;
delta1314=double(HH.delta1314);
y1314=double(HH.y1314);
teta1314=double(HH.teta1314);
DELTA(25)=delta1314;
Y(25)=y1314;
TETA(25)=teta1314;

Aa1313=double(HHa.Aa1313);
AXIALa(26)=Aa1313;
Ma1313=double(HHa.Ma1313);
MOMENTOa(26)=Ma1313;
Va1313=double(HHa.Va1313);
CORTANTEa(26)=Va1313;
deltaa1314=double(HHa.deltaa1314);
ya1314=double(HHa.ya1314);
tetaa1314=double(HHa.tetaa1314);
DELTAa(25)=deltaa1314;
Ya(25)=ya1314;
TETAa(25)=tetaa1314;

% COMPORTAMIENTO DEL ELEMENTO 14, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A1014=double(HH.A1014);
AXIAL(28)=A1014;
M1014=double(HH.M1014);
MOMENTO(28)=M1014;
V1014=double(HH.V1014);
CORTANTE(28)=V1014;
delta1415=double(HH.delta1415);
y1415=double(HH.y1415);
teta1415=double(HH.teta1415);
DELTA(27)=delta1415;
Y(27)=y1415;
TETA(27)=teta1415;

Aa1014=double(HHa.Aa1014);
AXIALa(28)=Aa1014;
Ma1014=double(HHa.Ma1014);
MOMENTOa(28)=Ma1014;
Va1014=double(HHa.Va1014);
CORTANTEa(28)=Va1014;
deltaa1415=double(HHa.deltaa1415);
ya1415=double(HHa.ya1415);
tetaa1415=double(HHa.tetaa1415);
DELTAa(27)=deltaa1415;
Ya(27)=ya1415;
TETAa(27)=tetaa1415;

A1314=double(HH.A1314);
AXIAL(27)=A1314;
M1314=double(HH.M1314);
MOMENTO(27)=M1314;
V1314=double(HH.V1314);
CORTANTE(27)=V1314;
delta1014=double(HH.delta1014);
y1014=double(HH.y1014);
teta1014=double(HH.teta1014);
DELTA(26)=delta1014;
Y(26)=y1014;
TETA(26)=teta1014;

Aa1314=double(HHa.Aa1314);
AXIALa(27)=Aa1314;
Ma1314=double(HHa.Ma1314);
MOMENTOa(27)=Ma1314;
Va1314=double(HHa.Va1314);
CORTANTEa(27)=Va1314;
deltaa1014=double(HHa.deltaa1014);
ya1014=double(HHa.ya1014);
tetaa1014=double(HHa.tetaa1014);
DELTAa(26)=deltaa1014;
Ya(26)=ya1014;
TETAa(26)=tetaa1014;

% COMPORTAMIENTO DEL ELEMENTO 15, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A415=double(HH.A415);
AXIAL(30)=A415;
M415=double(HH.M415);
MOMENTO(30)=M415;
V415=double(HH.V415);
CORTANTE(30)=V415;
delta1416=double(HH.delta1416);
y1416=double(HH.y1416);
teta1416=double(HH.teta1416);
DELTA(29)=delta1416;
Y(29)=y1416;
TETA(29)=teta1416;

Aa415=double(HHa.Aa415);
AXIALa(30)=Aa415;
Ma415=double(HHa.Ma415);
MOMENTOa(30)=Ma415;
Va415=double(HHa.Va415);
CORTANTEa(30)=Va415;
deltaa1416=double(HHa.deltaa1416);
ya1416=double(HHa.ya1416);
tetaa1416=double(HHa.tetaa1416);
DELTAa(29)=deltaa1416;
Ya(29)=ya1416;
TETAa(29)=tetaa1416;

A1415=double(HH.A1415);
AXIAL(29)=A1415;
M1415=double(HH.M1415);
MOMENTO(29)=M1415;
V1415=double(HH.V1415);
CORTANTE(29)=V1415;
delta415=double(HH.delta415);
y415=double(HH.y415);
teta415=double(HH.teta415);
DELTA(28)=delta415;
Y(28)=y415;
TETA(28)=teta415;

Aa1415=double(HHa.Aa1415);
AXIALa(29)=Aa1415;
Ma1415=double(HHa.Ma1415);
MOMENTOa(29)=Ma1415;
Va1415=double(HHa.Va1415);
CORTANTEa(29)=Va1415;
deltaa415=double(HHa.deltaa415);
ya415=double(HHa.ya415);
tetaa415=double(HHa.tetaa415);
DELTAa(28)=deltaa415;
Ya(28)=ya415;
TETAa(28)=tetaa415;

% COMPORTAMIENTO DEL ELEMENTO 16, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A916=double(HH.A916);
AXIAL(32)=A916;
M916=double(HH.M916);
MOMENTO(32)=M916;
V916=double(HH.V916);
CORTANTE(32)=V916;
delta817=double(HH.delta817);
y817=double(HH.y817);
teta817=double(HH.teta817);
DELTA(31)=delta817;
Y(31)=y817;
TETA(31)=teta817;

Aa916=double(HHa.Aa916);
AXIALa(32)=Aa916;
Ma916=double(HHa.Ma916);
MOMENTOa(32)=Ma916;
Va916=double(HHa.Va916);
CORTANTEa(32)=Va916;
deltaa817=double(HHa.deltaa817);
ya817=double(HHa.ya817);
tetaa817=double(HHa.tetaa817);
DELTAa(31)=deltaa817;
Ya(31)=ya817;
TETAa(31)=tetaa817;

A1416=double(HH.A1416);
AXIAL(31)=A1416;
M1416=double(HH.M1416);
MOMENTO(31)=M1416;
V1416=double(HH.V1416);
CORTANTE(31)=V1416;
delta916=double(HH.delta916);
y916=double(HH.y916);
teta916=double(HH.teta916);
DELTA(30)=delta916;
Y(30)=y916;
TETA(30)=teta916;

Aa1416=double(HHa.Aa1416);
AXIALa(31)=Aa1416;
Ma1416=double(HHa.Ma1416);
MOMENTOa(31)=Ma1416;
Va1416=double(HHa.Va1416);
CORTANTEa(31)=Va1416;
deltaa916=double(HHa.deltaa916);
ya916=double(HHa.ya916);
tetaa916=double(HHa.tetaa916);
DELTAa(30)=deltaa916;
Ya(30)=ya916;
TETAa(30)=tetaa916;

% COMPORTAMIENTO DEL ELEMENTO 17, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A517=double(HH.A517);
AXIAL(34)=A517;
M517=double(HH.M517);
MOMENTO(34)=M517;
V517=double(HH.V517);
CORTANTE(34)=V517;
delta1418=double(HH.delta1418);
y1418=double(HH.y1418);
teta1418=double(HH.teta1418);
DELTA(33)=delta1418;
Y(33)=y1418;
TETA(33)=teta1418;

Aa517=double(HHa.Aa517);
AXIALa(34)=Aa517;
Ma517=double(HHa.Ma517);
MOMENTOa(34)=Ma517;
Va517=double(HHa.Va517);
CORTANTEa(34)=Va517;
deltaa1418=double(HHa.deltaa1418);
ya1418=double(HHa.ya1418);
tetaa1418=double(HHa.tetaa1418);
DELTAa(33)=deltaa1418;
Ya(33)=ya1418;
TETAa(33)=tetaa1418;

A817=double(HH.A817);
AXIAL(33)=A817;
M817=double(HH.M817);
MOMENTO(33)=M817;
V817=double(HH.V817);
CORTANTE(33)=V817;
delta517=double(HH.delta517);
y517=double(HH.y517);
teta517=double(HH.teta517);
DELTA(32)=delta517;
Y(32)=y517;
TETA(32)=teta517;

Aa817=double(HHa.Aa817);
AXIALa(33)=Aa817;
Ma817=double(HHa.Ma817);
MOMENTOa(33)=Ma817;
Va817=double(HHa.Va817);
CORTANTEa(33)=Va817;
deltaa517=double(HHa.deltaa517);
ya517=double(HHa.ya517);
tetaa517=double(HHa.tetaa517);
DELTAa(32)=deltaa517;
Ya(32)=ya517;
TETAa(32)=tetaa517;

% COMPORTAMIENTO DEL ELEMENTO 18, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A318=double(HH.A318);
AXIAL(36)=A318;
M318=double(HH.M318);
MOMENTO(36)=M318;
V318=double(HH.V318);
CORTANTE(36)=V318;
delta1419=double(HH.delta1419);
y1419=double(HH.y1419);
teta1419=double(HH.teta1419);
DELTA(35)=delta1419;
Y(35)=y1419;
TETA(35)=teta1419;

Aa318=double(HHa.Aa318);
AXIALa(36)=Aa318;
Ma318=double(HHa.Ma318);
MOMENTOa(36)=Ma318;
Va318=double(HHa.Va318);
CORTANTEa(36)=Va318;
deltaa1419=double(HHa.deltaa1419);,
ya1419=double(HHa.ya1419);
tetaa1419=double(HHa.tetaa1419);
DELTAa(35)=deltaa1419;
Ya(35)=ya1419;
TETAa(35)=tetaa1419;

A1418=double(HH.A1418);
AXIAL(35)=A1418;
M1418=double(HH.M1418);
MOMENTO(35)=M1418;
V1418=double(HH.V1418);
CORTANTE(35)=V1418;
delta318=double(HH.delta318);
y318=double(HH.y318);
teta318=double(HH.teta318);
DELTA(34)=delta318;
Y(34)=y318;
TETA(34)=teta318;

Aa1418=double(HHa.Aa1418);
AXIALa(35)=Aa1418;
Ma1418=double(HHa.Ma1418);
MOMENTOa(35)=Ma1418;
Va1418=double(HHa.Va1418);
CORTANTEa(35)=Va1418;
deltaa318=double(HHa.deltaa318);
ya318=double(HHa.ya318);
tetaa318=double(HHa.tetaa318);
DELTAa(34)=deltaa318;
Ya(34)=ya318;
TETAa(34)=tetaa318;

% COMPORTAMIENTO DEL ELEMENTO 19, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A1019=double(HH.A1019);
AXIAL(38)=A1019;
M1019=double(HH.M1019);
MOMENTO(38)=M1019;
V1019=double(HH.V1019);
CORTANTE(38)=V1019;
delta1320=double(HH.delta1320);
y1320=double(HH.y1320);
teta1320=double(HH.teta1320);
DELTA(37)=delta1320;
Y(37)=y1320;
TETA(37)=teta1320;

Aa1019=double(HHa.Aa1019);
AXIALa(38)=Aa1019;
Ma1019=double(HHa.Ma1019);
MOMENTOa(38)=Ma1019;
Va1019=double(HHa.Va1019);
CORTANTEa(38)=Va1019;
deltaa1320=double(HHa.deltaa1320);
ya1320=double(HHa.ya1320);
tetaa1320=double(HHa.tetaa1320);
DELTAa(37)=deltaa1320;
Ya(37)=ya1320;
TETAa(37)=tetaa1320;

A1419=double(HH.A1419);
AXIAL(37)=A1419;
M1419=double(HH.M1419);
MOMENTO(37)=M1419;
V1419=double(HH.V1419);
CORTANTE(37)=V1419;
delta1019=double(HH.delta1019);
y1019=double(HH.y1019);
teta1019=double(HH.teta1019);
DELTA(36)=delta1019;
Y(36)=y1019;
TETA(36)=teta1019;

Aa1419=double(HHa.Aa1419);
AXIALa(37)=Aa1419;
Ma1419=double(HHa.Ma1419);
MOMENTOa(37)=Ma1419;
Va1419=double(HHa.Va1419);
CORTANTEa(37)=Va1419;
deltaa1019=double(HHa.deltaa1019);
ya1019=double(HHa.ya1019);
tetaa1019=double(HHa.tetaa1019);
DELTAa(36)=deltaa1019;
Ya(36)=ya1019;
TETAa(36)=tetaa1019;

% COMPORTAMIENTO DEL ELEMENTO 20, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A220=double(HH.A220);
AXIAL(40)=A220;
M220=double(HH.M220);
MOMENTO(40)=M220;
V220=double(HH.V220);
CORTANTE(40)=V220;
delta1321=double(HH.delta1321);
y1321=double(HH.y1321);
teta1321=double(HH.teta1321);
DELTA(39)=delta1321;
Y(39)=y1321;
TETA(39)=teta1321;

Aa220=double(HHa.Aa220);
AXIALa(40)=Aa220;
Ma220=double(HHa.Ma220);
MOMENTOa(40)=Ma220;
Va220=double(HHa.Va220);
CORTANTEa(40)=Va220;
deltaa1321=double(HHa.deltaa1321);
ya1321=double(HHa.ya1321);
tetaa1321=double(HHa.tetaa1321);
DELTAa(39)=deltaa1321;
Ya(39)=ya1321;
TETAa(39)=tetaa1321;

A1320=double(HH.A1320);
AXIAL(39)=A1320;
M1320=double(HH.M1320);
MOMENTO(39)=M1320;
V1320=double(HH.V1320);
CORTANTE(39)=V1320;
delta220=double(HH.delta220);
y220=double(HH.y220);
teta220=double(HH.teta220);
DELTA(38)=delta220;
Y(38)=y220;
TETA(38)=teta220;

Aa1320=double(HHa.Aa1320);
AXIALa(39)=Aa1320;
Ma1320=double(HHa.Ma1320);
MOMENTOa(39)=Ma1320;
Va1320=double(HHa.Va1320);
CORTANTEa(39)=Va1320;
deltaa220=double(HHa.deltaa220);
ya220=double(HHa.ya220);
tetaa220=double(HHa.tetaa220);
DELTAa(38)=deltaa220;
Ya(38)=ya220;
TETAa(38)=tetaa220;

% COMPORTAMIENTO DEL ELEMENTO 21, POR EFECTO DE CARGAS EN EL ''PLANO YZ'' Y ''PLANO XZ''

A1121=double(HH.A1121);
AXIAL(42)=A1121;
M1121=double(HH.M1121);
MOMENTO(42)=M1121;
V1121=double(HH.V1121);
CORTANTE(42)=V1121;

Aa1121=double(HHa.Aa1121);
AXIALa(42)=Aa1121;
Ma1121=double(HHa.Ma1121);
MOMENTOa(42)=Ma1121;
Va1121=double(HHa.Va1121);
CORTANTEa(42)=Va1121;

A1321=double(HH.A1321);
AXIAL(41)=A1321;
M1321=double(HH.M1321);
MOMENTO(41)=M1321;
V1321=double(HH.V1321);
CORTANTE(41)=V1321;
delta1121=double(HH.delta1121);
y1121=double(HH.y1121);
teta1121=double(HH.teta1121);
DELTA(40)=delta1121;
Y(40)=y1121;
TETA(40)=teta1121;

Aa1321=double(HHa.Aa1321);
AXIALa(41)=Aa1321;
Ma1321=double(HHa.Ma1321);
MOMENTOa(41)=Ma1321;
Va1321=double(HHa.Va1321);
CORTANTEa(41)=Va1321;
deltaa1121=double(HHa.deltaa1121);
ya1121=double(HHa.ya1121);
tetaa1121=double(HHa.tetaa1121);
DELTAa(40)=deltaa1121;
Ya(40)=ya1121;
TETAa(40)=tetaa1121;


%Construccion de arreglo conformado por variables de estado totales, para
%posterior graficacion.

At(1)=sqrt(A1*A1+Aa1*Aa1);
At(2)=sqrt(A21*A21+Aa21*Aa21);
At(3)=sqrt(A22*A22+Aa22*Aa22);
At(4)=sqrt(A32*A32+Aa32*Aa32);
At(5)=sqrt(A43*A43+Aa43*Aa43);
At(6)=sqrt(A33*A33+Aa33*Aa33);
At(7)=sqrt(A54*A54+Aa54*Aa54);
At(8)=sqrt(A44*A44+Aa44*Aa44);
At(9)=sqrt(A65*A65+Aa65*Aa65);
At(10)=sqrt(A55*A55+Aa55*Aa55);
At(11)=sqrt(A76*A76+Aa76*Aa76);
At(12)=sqrt(A66*A66+Aa66*Aa66);
At(13)=sqrt(A87*A87+Aa87*Aa87);
At(14)=sqrt(A77*A77+Aa77*Aa77);
At(15)=sqrt(A98*A98+Aa98*Aa98);
At(16)=sqrt(A88*A88+Aa88*Aa88);
At(17)=sqrt(A109*A109+Aa109*Aa109);
At(18)=sqrt(A99*A99+Aa99*Aa99);
At(19)=sqrt(A1110*A1110+Aa1110*Aa1110);
At(20)=sqrt(A1010*A1010+Aa1010*Aa1010);
At(21)=sqrt(A1111*A1111+Aa1111*Aa1111);
At(22)=sqrt(A12*A12+Aa12*Aa12);
At(23)=sqrt(A1112*A1112+Aa1112*Aa1112);
At(24)=sqrt(A212*A212+Aa212*Aa212);
At(25)=sqrt(A313*A313+Aa313*Aa313);
At(26)=sqrt(A1313*A1313+Aa1313*Aa1313);
At(27)=sqrt(A1314*A1314+Aa1314*Aa1314);
At(28)=sqrt(A1014*A1014+Aa1014*Aa1014);
At(29)=sqrt(A1415*A1415+Aa1415*Aa1415);
At(30)=sqrt(A415*A415+Aa415*Aa415);
At(31)=sqrt(A1416*A1416+Aa1416*Aa1416);
At(32)=sqrt(A916*A916+Aa916*Aa916);
At(33)=sqrt(A817*A817+Aa817*Aa817);
At(34)=sqrt(A517*A517+Aa517*Aa517);
At(35)=sqrt(A1418*A1418+Aa1418*Aa1418);
At(36)=sqrt(A318*A318+Aa318*Aa318);
At(37)=sqrt(A1419*A1419+Aa1419*Aa1419);
At(38)=sqrt(A1019*A1019+Aa1019*Aa1019);
At(39)=sqrt(A1320*A1320+Aa1320*Aa1320);
At(40)=sqrt(A220*A220+Aa220*Aa220);
At(41)=sqrt(A1321*A1321+Aa1321*Aa1321);
At(42)=sqrt(A1121*A1121+Aa1121*Aa1121);

Vt(1)=sqrt(V1*V1+Va1*Va1);
Vt(2)=sqrt(V21*V21+Va21*Va21);
Vt(3)=sqrt(V22*V22+Va22*Va22);
Vt(4)=sqrt(V32*V32+Va32*Va32);
Vt(5)=sqrt(V43*V43+Va43*Va43);
Vt(6)=sqrt(V33*V33+Va33*Va33);
Vt(7)=sqrt(V54*V54+Va54*Va54);
Vt(8)=sqrt(V44*V44+Va44*Va44);
Vt(9)=sqrt(V65*V65+Va65*Va65);
Vt(10)=sqrt(V55*V55+Va55*Va55);
Vt(11)=sqrt(V76*V76+Va76*Va76);
Vt(12)=sqrt(V66*V66+Va66*Va66);
Vt(13)=sqrt(V87*V87+Va87*Va87);
Vt(14)=sqrt(V77*V77+Va77*Va77);
Vt(15)=sqrt(V98*V98+Va98*Va98);
Vt(16)=sqrt(V88*V88+Va88*Va88);
Vt(17)=sqrt(V109*V109+Va109*Va109);
Vt(18)=sqrt(V99*V99+Va99*Va99);
Vt(19)=sqrt(V1110*V1110+Va1110*Va1110);
Vt(20)=sqrt(V1010*V1010+Va1010*Va1010);
Vt(21)=sqrt(V1111*V1111+Va1111*Va1111);
Vt(22)=sqrt(V12*V12+Va12*Va12);
Vt(23)=sqrt(V1112*V1112+Va1112*Va1112);
Vt(24)=sqrt(V212*V212+Va212*Va212);
Vt(25)=sqrt(V313*V313+Va313*Va313);
Vt(26)=sqrt(V1313*V1313+Va1313*Va1313);
Vt(27)=sqrt(V1314*V1314+Va1314*Va1314);
Vt(28)=sqrt(V1014*V1014+Va1014*Va1014);
Vt(29)=sqrt(V1415*V1415+Va1415*Va1415);
Vt(30)=sqrt(V415*V415+Va415*Va415);
Vt(31)=sqrt(V1416*V1416+Va1416*Va1416);
Vt(32)=sqrt(V916*V916+Va916*Va916);
Vt(33)=sqrt(V817*V817+Va817*Va817);
Vt(34)=sqrt(V517*V517+Va517*Va517);
Vt(35)=sqrt(V1418*V1418+Va1418*Va1418);
Vt(36)=sqrt(V318*V318+Va318*Va318);
Vt(37)=sqrt(V1419*V1419+Va1419*Va1419);
Vt(38)=sqrt(V1019*V1019+Va1019*Va1019);
Vt(39)=sqrt(V1320*V1320+Va1320*Va1320);
Vt(40)=sqrt(V220*V220+Va220*Va220);
Vt(41)=sqrt(V1321*V1321+Va1321*Va1321);
Vt(42)=sqrt(V1121*V1121+Va1121*Va1121);

Mt(1)=sqrt(M1*M1+Ma1*Ma1);
Mt(2)=sqrt(M21*M21+Ma21*Ma21);
Mt(3)=sqrt(M22*M22+Ma22*Ma22);
Mt(4)=sqrt(M32*M32+Ma32*Ma32);
Mt(5)=sqrt(M43*M43+Ma43*Ma43);
Mt(6)=sqrt(M33*M33+Ma33*Ma33);
Mt(7)=sqrt(M54*M54+Ma54*Ma54);
Mt(8)=sqrt(M44*M44+Ma44*Ma44);
Mt(9)=sqrt(M65*M65+Ma65*Ma65);
Mt(10)=sqrt(M55*M55+Ma55*Ma55);
Mt(11)=sqrt(M76*M76+Ma76*Ma76);
Mt(12)=sqrt(M66*M66+Ma66*Ma66);
Mt(13)=sqrt(M87*M87+Ma87*Ma87);
Mt(14)=sqrt(M77*M77+Ma77*Ma77);
Mt(15)=sqrt(M98*M98+Ma98*Ma98);
Mt(16)=sqrt(M88*M88+Ma88*Ma88);
Mt(17)=sqrt(M109*M109+Ma109*Ma109);
Mt(18)=sqrt(M99*M99+Ma99*Ma99);
Mt(19)=sqrt(M1110*M1110+Ma1110*Ma1110);
Mt(20)=sqrt(M1010*M1010+Ma1010*Ma1010);
Mt(21)=sqrt(M1111*M1111+Ma1111*Ma1111);
Mt(22)=sqrt(M12*M12+Ma12*Ma12);
Mt(23)=sqrt(M1112*M1112+Ma1112*Ma1112);
Mt(24)=sqrt(M212*M212+Ma212*Ma212);
Mt(25)=sqrt(M313*M313+Ma313*Ma313);
Mt(26)=sqrt(M1313*M1313+Ma1313*Ma1313);
Mt(27)=sqrt(M1314*M1314+Ma1314*Ma1314);
Mt(28)=sqrt(M1014*M1014+Ma1014*Ma1014);
Mt(29)=sqrt(M1415*M1415+Ma1415*Ma1415);
Mt(30)=sqrt(M415*M415+Ma415*Ma415);
Mt(31)=sqrt(M1416*M1416+Ma1416*Ma1416);
Mt(32)=sqrt(M916*M916+Ma916*Ma916);
Mt(33)=sqrt(M817*M817+Ma817*Ma817);
Mt(34)=sqrt(M517*M517+Ma517*Ma517);
Mt(35)=sqrt(M1418*M1418+Ma1418*Ma1418);
Mt(36)=sqrt(M318*M318+Ma318*Ma318);
Mt(37)=sqrt(M1419*M1419+Ma1419*Ma1419);
Mt(38)=sqrt(M1019*M1019+Ma1019*Ma1019);
Mt(39)=sqrt(M1320*M1320+Ma1320*Ma1320);
Mt(40)=sqrt(M220*M220+Ma220*Ma220);
Mt(41)=sqrt(M1321*M1321+Ma1321*Ma1321);
Mt(42)=sqrt(M1121*M1121+Ma1121*Ma1121);

yt(1)=sqrt(y1*y1+ya1*ya1);
yt(2)=sqrt(y21*y21+ya21*ya21);
yt(3)=sqrt(y22*y22+ya22*ya22);
yt(4)=sqrt(y32*y32+ya32*ya32);
yt(5)=sqrt(y43*y43+ya43*ya43);
yt(6)=sqrt(y33*y33+ya33*ya33);
yt(7)=sqrt(y54*y54+ya54*ya54);
yt(8)=sqrt(y44*y44+ya44*ya44);
yt(9)=sqrt(y65*y65+ya65*ya65);
yt(10)=sqrt(y55*y55+ya55*ya55);
yt(11)=sqrt(y76*y76+ya76*ya76);
yt(12)=sqrt(y66*y66+ya66*ya66);
yt(13)=sqrt(y87*y87+ya87*ya87);
yt(14)=sqrt(y77*y77+ya77*ya77);
yt(15)=sqrt(y98*y98+ya98*ya98);
yt(16)=sqrt(y88*y88+ya88*ya88);
yt(17)=sqrt(y109*y109+ya109*ya109);
yt(18)=sqrt(y99*y99+ya99*ya99);
yt(19)=sqrt(y1110*y1110+ya1110*ya1110);
yt(20)=sqrt(y1010*y1010+ya1010*ya1010);
yt(21)=sqrt(y1111*y1111+ya1111*ya1111);
yt(22)=sqrt(y12*y12+ya12*ya12);
yt(23)=sqrt(y1112*y1112+ya1112*ya1112);
yt(24)=sqrt(y212*y212+ya212*ya212);
yt(25)=sqrt(y313*y313+ya313*ya313);
yt(26)=sqrt(y1313*y1313+ya1313*ya1313);
yt(27)=sqrt(y1314*y1314+ya1314*ya1314);
yt(28)=sqrt(y1014*y1014+ya1014*ya1014);
yt(29)=sqrt(y1415*y1415+ya1415*ya1415);
yt(30)=sqrt(y415*y415+ya415*ya415);
yt(31)=sqrt(y1416*y1416+ya1416*ya1416);
yt(32)=sqrt(y916*y916+ya916*ya916);
yt(33)=sqrt(y817*y817+ya817*ya817);
yt(34)=sqrt(y517*y517+ya517*ya517);
yt(35)=sqrt(y1418*y1418+ya1418*ya1418);
yt(36)=sqrt(y318*y318+ya318*ya318);
yt(37)=sqrt(y1419*y1419+ya1419*ya1419);
yt(38)=sqrt(y1019*y1019+ya1019*ya1019);
yt(39)=sqrt(y1320*y1320+ya1320*ya1320);
yt(40)=sqrt(y220*y220+ya220*ya220);
yt(41)=sqrt(y1321*y1321+ya1321*ya1321);
yt(42)=sqrt(y1121*y1121+ya1121*ya1121);

deltat(1)=sqrt(delta1*delta1+deltaa1*deltaa1);
deltat(2)=sqrt(delta21*delta21+deltaa21*deltaa21);
deltat(3)=sqrt(delta22*delta22+deltaa22*deltaa22);
deltat(4)=sqrt(delta32*delta32+deltaa32*deltaa32);
deltat(5)=sqrt(delta43*delta43+deltaa43*deltaa43);
deltat(6)=sqrt(delta33*delta33+deltaa33*deltaa33);
deltat(7)=sqrt(delta54*delta54+deltaa54*deltaa54);
deltat(8)=sqrt(delta44*delta44+deltaa44*deltaa44);
deltat(9)=sqrt(delta65*delta65+deltaa65*deltaa65);
deltat(10)=sqrt(delta55*delta55+deltaa55*deltaa55);
deltat(11)=sqrt(delta76*delta76+deltaa76*deltaa76);
deltat(12)=sqrt(delta66*delta66+deltaa66*deltaa66);
deltat(13)=sqrt(delta87*delta87+deltaa87*deltaa87);
deltat(14)=sqrt(delta77*delta77+deltaa77*deltaa77);
deltat(15)=sqrt(delta98*delta98+deltaa98*deltaa98);
deltat(16)=sqrt(delta88*delta88+deltaa88*deltaa88);
deltat(17)=sqrt(delta109*delta109+deltaa109*deltaa109);
deltat(18)=sqrt(delta99*delta99+deltaa99*deltaa99);
deltat(19)=sqrt(delta1110*delta1110+deltaa1110*deltaa1110);
deltat(20)=sqrt(delta1010*delta1010+deltaa1010*deltaa1010);
deltat(21)=sqrt(delta1111*delta1111+deltaa1111*deltaa1111);
deltat(22)=sqrt(delta12*delta12+deltaa12*deltaa12);
deltat(23)=sqrt(delta1112*delta1112+deltaa1112*deltaa1112);
deltat(24)=sqrt(delta212*delta212+deltaa212*deltaa212);
deltat(25)=sqrt(delta313*delta313+deltaa313*deltaa313);
deltat(26)=sqrt(delta1313*delta1313+deltaa1313*deltaa1313);
deltat(27)=sqrt(delta1314*delta1314+deltaa1314*deltaa1314);
deltat(28)=sqrt(delta1014*delta1014+deltaa1014*deltaa1014);
deltat(29)=sqrt(delta1415*delta1415+deltaa1415*deltaa1415);
deltat(30)=sqrt(delta415*delta415+deltaa415*deltaa415);
deltat(31)=sqrt(delta1416*delta1416+deltaa1416*deltaa1416);
deltat(32)=sqrt(delta916*delta916+deltaa916*deltaa916);
deltat(33)=sqrt(delta817*delta817+deltaa817*deltaa817);
deltat(34)=sqrt(delta517*delta517+deltaa517*deltaa517);
deltat(35)=sqrt(delta1418*delta1418+deltaa1418*deltaa1418);
deltat(36)=sqrt(delta318*delta318+deltaa318*deltaa318);
deltat(37)=sqrt(delta1419*delta1419+deltaa1419*deltaa1419);
deltat(38)=sqrt(delta1019*delta1019+deltaa1019*deltaa1019);
deltat(39)=sqrt(delta1320*delta1320+deltaa1320*deltaa1320);
deltat(40)=sqrt(delta220*delta220+deltaa220*deltaa220);
deltat(41)=sqrt(delta1321*delta1321+deltaa1321*deltaa1321);
deltat(42)=sqrt(delta1121*delta1121+deltaa1121*deltaa1121);

for i=1:42
    Despt(i)=sqrt(yt(i)*yt(i)+deltat(i)*deltat(i));
end;

%Instrucciones de graficacion
x=linspace(1,42,42);
xx=linspace(1,42,200);
figure(1)
plot(x,At,'bs-')
grid on
title('Fuerza Axial en las Diferentes Variables de Estado')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.1)')
ylabel('Fuerza Axial [Nw]')

figure(2)
plot(x,Vt,'ks-')
grid on
title('Fuerza Cortante en las Diferentes Variables de Estado')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.2)')
ylabel('Fuerza Cortante [Nw]')

figure(3)
plot(x,Mt,'ms-')
grid on
title('Momento Flexionante en las Diferentes Variables de Estado')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.3)')
ylabel('Momento Flexionante [Nw.m]')

figure(4)
plot(x,Despt,'rs-')
grid on
title('Desplazamiento en las Diferentes Variables de Estado')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.4)')
ylabel('Desplazamiento [m]')

%Calculo de esfuerzos axiales y de flexion
for i=1:22
    EA(i)=At(i)/Aa;
end;
for i=23:42
    EA(i)=At(i)/Ab;
end;

%Calculo de esfuerzos de flexion en eje menor 
for i=1:22
    EFme(i)=Mt(i)/svigay;
end;
for i=23:42
    EFme(i)=Mt(i)/stub;
end;
%Calculo de esfuerzos de flexion en eje mayor 
for i=1:22
    EFma(i)=Mt(i)/svigax;
end;
for i=23:42
    EFma(i)=Mt(i)/stub;
end;
%Calculo de esfuerzos cortante 
for i=1:22
    ECma(i)=(Vt(i)*(tf*bf*(d/2-tf/2)+(d/2-tf)*tw*(d/2-tf)/2))/(I2*tw);
end;
for i=23:42
    ECma(i)=(Vt(i)*(pi*De*De*0.212*De/8-pi*Di*Di*0.212*Di/8))/(I3*2*e);
end;





% Criterios de Diseño
    %Comprobacion de Esfuerzos Axiales, Traccion y Flexion 
gammatraccion=0.75;
gammaflexion=0.7;
for i=1:42
    Relacion1(i)=EA(i)/(gammatraccion*EApermisible)   ;
    if Relacion1(i)>0.2
        Comprobacion1(i)=Relacion1(i)+8/9*(EFma(i)/(gammaflexion*EApermisible)+EFme(i)/(gammaflexion*EApermisible));
    end;
    if Relacion1(i)<0.2
        Comprobacion1(i)=Relacion1(i)+(EFma(i)/(gammaflexion*EApermisible)+EFme(i)/(gammaflexion*EApermisible));
    end;
end;
    %Comprobacion de Esfuerzos Cortante
gammacortante=0.9;
for i=1:42
    Comprobacion2(i)=ECma(i)/(gammacortante*EApermisible);
end;

for i=1:42
    if Comprobacion1(i)>1
        nn=1;
    end;
    if Comprobacion2(i)>1
        nn=1;    
    end;
        %Comprobacion de que desplazamientos sean menores a 0,014m. (Codigo ASTM)
    if Despt(i)>0.014 
        nn=1;
    end;
end;

%Graficacion de la Comprobacion de Esfuerzos Axiales, Traccion y Flexion 
figure(5)
plot(x,Comprobacion1,'bs-',xx,1,'r')
text(10,1.05,'Límite Máximo de Diseño Seguro')
grid on
title('Chequeo del Diseño por Medio del Código AISC (Esfuerzo Axial y de Flexión)')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.1)')
ylabel('Razón de Diseño')
axis([0 43 -0.1 1.2])
%Graficacion de la Comprobacion de Esfuerzos Cortante
figure(6)
plot(x,Comprobacion2,'bs-')
text(10,0.065,'Donde 1 es el Límite Máximo de Diseño Seguro')
grid on
title('Chequeo del Diseño por Medio del Código AISC (Esfuerzo Cortante)')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.2)')
ylabel('Razón de Diseño')
axis([0 43 -0.02 0.07])
%Graficacion de la Comprobacion de que desplazamientos sean menores a 0,014m. (Codigo ASTM)
figure(7)
plot(x,Despt,'bs-',xx,0.014,'r')
text(10,0.0145,'Límite Máximo de Diseño Seguro')
grid on
title('Chequeo del Diseño por Medio del Código ASTM')
xlabel('Identificación de la Variable de Estado (Véase Tabla C.4)')
ylabel('Desplazamiento [m]')
axis([0 43 -0.001 0.015])

%SSSSSOOOOOOLLLLLLDDDDDAAAAADDDDDUUUUURRRRRAAAAAA

%Vease Seccion de Ensambles Soldados, Metodo para Tratar la Soldadura como
%una Linea

% Z 220
aw=2*(2*0.168+2*0.32+2*0.141);
zw=2*(0.461*0.336+0.336*0.336/6);
fc=Vt(40)/aw;
fa=At(40)/aw;
ff=Mt(40)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w220=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(1)=w220;


% Z 1121
aw=2*(2*0.168+2*0.32+2*0.141);
zw=2*(0.461*0.336+0.336*0.336/6);
fc=Vt(42)/aw;
fa=At(42)/aw;
ff=Mt(42)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1121=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(2)=w1121;

% Z 212
aw=2*(2*0.168+2*0.18+2*0.15);
zw=2*(0.33*0.336+0.336*0.336/6);
fc=Vt(24)/aw;
fa=At(24)/aw;
ff=Mt(24)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w212=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(3)=w212;

% Z 1112
aw=2*(2*0.168+2*0.18+2*0.15);
zw=2*(0.33*0.336+0.336*0.336/6);
fc=Vt(23)/aw;
fa=At(23)/aw;
ff=Mt(23)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1112=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(4)=w1112;

% Z 1320
aw=2*(2*0.168+2*0.275+2*0.235);
zw=2*(0.51*0.336+0.336*0.336/6);
fc=Vt(39)/aw;
fa=At(39)/aw;
ff=Mt(39)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1320=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(5)=w1320;

% Z 1321
aw=2*(2*0.168+2*0.275+2*0.235);
zw=2*(0.51*0.336+0.336*0.336/6);
fc=Vt(41)/aw;
fa=At(41)/aw;
ff=Mt(41)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1321=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(6)=w1321;

% Z 318
aw=2*(2*0.168+2*0.3+2*0.089);
zw=2*(0.389*0.336+0.336*0.336/6);
fc=Vt(36)/aw;
fa=At(36)/aw;
ff=Mt(36)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w318=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(7)=w318;

% Z 1019
aw=2*(2*0.168+2*0.3+2*0.089);
zw=2*(0.389*0.336+0.336*0.336/6);
fc=Vt(38)/aw;
fa=At(38)/aw;
ff=Mt(38)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1019=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(8)=w1019;

% Z 313
aw=2*(2*0.168+2*0.18+2*0.14);
zw=2*(0.32*0.336+0.336*0.336/6);
fc=Vt(25)/aw;
fa=At(25)/aw;
ff=Mt(25)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w313=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(30)=w313;

% Z 1014
aw=2*(2*0.168+2*0.18+2*0.14);
zw=2*(0.32*0.336+0.336*0.336/6);
fc=Vt(28)/aw;
fa=At(28)/aw;
ff=Mt(28)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1014=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(9)=w1014;

% Z 1418
aw=2*(2*0.168+2*0.3+2*0.2);
zw=2*(0.5*0.336+0.336*0.336/6);
fc=Vt(35)/aw;
fa=At(35)/aw;
ff=Mt(35)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1418=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(10)=w1418;

% Z 1419
aw=2*(2*0.168+2*0.3+2*0.2);
zw=2*(0.5*0.336+0.336*0.336/6);
fc=Vt(37)/aw;
fa=At(37)/aw;
ff=Mt(37)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1419=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(11)=w1419;

% Z 415
aw=2*(2*0.168+2*0.2+2*0.177);
zw=2*(0.377*0.336+0.336*0.336/6);
fc=Vt(30)/aw;
fa=At(30)/aw;
ff=Mt(30)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w415=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(12)=w415;

% Z 916
aw=2*(2*0.168+2*0.2+2*0.177);
zw=2*(0.377*0.336+0.336*0.336/6);
fc=Vt(32)/aw;
fa=At(32)/aw;
ff=Mt(32)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w916=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(13)=w916;

% Z 517
aw=2*(2*0.168+2*0.2+2*0.177);
zw=2*(0.377*0.336+0.336*0.336/6);
fc=Vt(34)/aw;
fa=At(34)/aw;
ff=Mt(34)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w517=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(14)=w517;

% Z 817
aw=2*(2*0.168+2*0.2+2*0.177);
zw=2*(0.377*0.336+0.336*0.336/6);
fc=Vt(33)/aw;
fa=At(33)/aw;
ff=Mt(33)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w817=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(15)=w817;

% Z 1
aw=2*(2*0.3+2*0.49);
zw=2*(0.3*0.49+(0.49^2)/3);
fc=Vt(1)/aw;
fa=At(1)/aw;
ff=Mt(1)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w1=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(16)=w1;

% Z 12
aw=2*(2*0.3+2*0.49);
zw=2*(0.3*0.49+(0.49^2)/3);
fc=Vt(22)/aw;
fa=At(22)/aw;
ff=Mt(22)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w12=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(17)=w12;

% Z 65
aw=2*(2*0.3+2*0.49);
zw=2*(0.3*0.49+(0.49^2)/3);
fc=Vt(9)/aw;
fa=At(9)/aw;
ff=Mt(9)/zw;
fr=(fc^2+fa^2)^(.5);
w65=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(18)=w65;

% Z 77
aw=2*(2*0.3+2*0.49);
zw=2*(0.3*0.49+(0.49^2)/3);
fc=Vt(14)/aw;
fa=At(14)/aw;
ff=Mt(14)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w77=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(19)=w77;

% Cartela en Z2
aw=2*(2*0.952+2*0.0127);
zw=2*((0.952^2)/3);
fc=((Vt(3)^2+Vt(2)^2)^.5)/aw;
fa=((At(3)^2+At(2)^2)^.5)/aw;
ff=((Mt(3)^2+Mt(2)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w2cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(20)=w2cart;

% Cartela en Z11
aw=2*(2*0.952+2*0.0127);
zw=2*((0.952^2)/3);
fc=((Vt(19)^2+Vt(21)^2)^.5)/aw;
fa=((At(19)^2+At(21)^2)^.5)/aw;
ff=((Mt(19)^2+Mt(21)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w11cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(21)=w11cart;

% Cartela en Z3
aw=2*(2*0.952+2*0.0127);
zw=2*((0.952^2)/3);
fc=((Vt(4)^2+Vt(6)^2)^.5)/aw;
fa=((At(4)^2+At(6)^2)^.5)/aw;
ff=((Mt(4)^2+Mt(6)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w3cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(22)=w3cart;

% Cartela en Z10
aw=2*(2*0.952+2*0.0127);
zw=2*((0.952^2)/3);
fc=((Vt(17)^2+Vt(20)^2)^.5)/aw;
fa=((At(17)^2+At(20)^2)^.5)/aw;
ff=((Mt(17)^2+Mt(20)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w10cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(23)=w10cart;

% Cartela en Z4
aw=2*(2*0.746+2*0.0127);
zw=2*((0.746^2)/3);
fc=((Vt(8)^2+Vt(5)^2)^.5)/aw;
fa=((At(8)^2+At(5)^2)^.5)/aw;
ff=((Mt(8)^2+Mt(5)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w4cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(24)=w4cart;

% Cartela en Z9
aw=2*(2*0.746+2*0.0127);
zw=2*((0.746^2)/3);
fc=((Vt(15)^2+Vt(18)^2)^.5)/aw;
fa=((At(15)^2+At(18)^2)^.5)/aw;
ff=((Mt(15)^2+Mt(18)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w9cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(25)=w9cart;

% Cartela en Z5
aw=2*(2*0.746+2*0.0127);
zw=2*((0.746^2)/3);
fc=((Vt(10)^2+Vt(7)^2)^.5)/aw;
fa=((At(10)^2+At(7)^2)^.5)/aw;
ff=((Mt(10)^2+Mt(7)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w5cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(26)=w5cart;

% Cartela en Z8
aw=2*(2*0.746+2*0.0127);
zw=2*((0.746^2)/3);
fc=((Vt(13)^2+Vt(16)^2)^.5)/aw;
fa=((At(13)^2+At(16)^2)^.5)/aw;
ff=((Mt(13)^2+Mt(16)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w8cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(27)=w8cart;

% Cartela en Z13
aw=2*(2*0.79+2*0.0127);
zw=2*((0.79^2)/3);
fc=((Vt(26)^2+Vt(27)^2)^.5)/aw;
fa=((At(26)^2+At(27)^2)^.5)/aw;
ff=((Mt(26)^2+Mt(27)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w13cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(28)=w13cart;

% Cartela en Z14
aw=2*(2*0.79+2*0.0127);
zw=2*((0.79^2)/3);
fc=((Vt(29)^2+Vt(31)^2)^.5)/aw;
fa=((At(29)^2+At(31)^2)^.5)/aw;
ff=((Mt(29)^2+Mt(31)^2)^.5)/zw;
fr=(fc^2+fa^2+ff^2)^(.5);
w14cart=(fr/(1.67e7))*1000;  %Esta expresado en mm
W(29)=w14cart;

%PPPPPEEEEERRRRRNNNNNOOOOOSSSSS
%Vease Ensambles Atornillados

%            PERNOS DE SUJECION EN Z1

%SE SELECCIONAN 4 PERNOS DISPUESTOS COMO LO MUESTRA EL PLANO NO. 2
% FUERZA DE CORTE EN CADA PERNO
%SE SUPONDRA QUE EL ACERO AISI 1020, ES DE PROPIEDADES SIMILAR AL A325, POR
%TANTO EL ESFUERZO DE CORTE (121e6 Pa)
V1P=Vt(1)*cos(10*pi/180)/4 + At(1)*cos(80*pi/180)/4;
R=0.3889;
SUMAR2=4*R^2;
F=Mt(1)*R/SUMAR2;
FH=F*cos(45*pi/180);
FV=FH;
FR=sqrt((FH+V1P)^2+FV^2);
A=FR/121e6;
D1=sqrt(4*A/pi);
D1mm=D1*1000; % EXPRESADA EN mm
DPP(1)=D1mm;

%            PERNOS DE SUJECION EN Z12

%SE SELECCIONAN 4 PERNOS DISPUESTOS COMO LO MUESTRA EL PLANO NO. 2
% FUERZA DE CORTE EN CADA PERNO
%SE SUPONDRA QUE EL ACERO AISI 1020, ES DE PROPIEDADES SIMILAR AL A325, POR
%TANTO EL ESFUERZO DE CORTE (121e6 Pa)
V12P=Vt(22)*cos(10*pi/180)/4 + At(22)*cos(80*pi/180)/4;
R=0.3889;
SUMAR2=4*R^2;
F=Mt(22)*R/SUMAR2;
FH=F*cos(45*pi/180);
FV=FH;
FR=sqrt((FH+V12P)^2+FV^2);
A=FR/121e6;
D12=sqrt(4*A/pi);
D12mm=D12*1000; % EXPRESADA EN mm
DPP(2)=D12mm;

% Muestreo de longitud del cateto mayor de la soldadura de filete

catetomaxmm=max(W);

% Muestreo de diametro mayor requerido para el perno

diampernomax=max(DPP);

if nn==0
    fprintf('\n')    
    fprintf('\n')
    fprintf('     Variables de Estado en Apoyos de Fundaciones (*)\n')
    fprintf('       *************************************************\n')
    fprintf('\n')
    fprintf('         --------------------------------------------------------\n')
    fprintf('                 A [N]               V [N]             M [Nm]\n')
    fprintf('         ========================================================\n')
    fprintf('   Z1(**)')
    fprintf('       %g',At(1))
    fprintf('              %g',Vt(1))
    fprintf('            %g\n',Mt(1))
    fprintf(' ----------------------------------------------------------------\n')
    fprintf('   Z12(**)')
    fprintf('      %g',At(22))
    fprintf('               %g',Vt(22))
    fprintf('          %g\n',Mt(22))
    fprintf(' ----------------------------------------------------------------\n')
    fprintf(' (*) Información requerida para construcción de fundaciones.\n')
    fprintf(' (**) Véase ilustración 42.\n')
    fprintf('\n')    
    fprintf('\n')
    fprintf('        Diámetros Mínimos Requeridos para Pernos de Anclaje\n')
    fprintf('        ***************************************************\n')
    fprintf('\n')
    fprintf(' Diámetro mínimo requerido para perno 1  [mm] = %g\n',D1mm)
    fprintf(' Diámetro mínimo requerido para perno 12 [mm] = %g\n',D12mm)
    fprintf('\n')    
    fprintf('\n')
    fprintf('        Cateto Mínimo que Deben Poseer las Soldaduras de Filete\n')
    fprintf('        ********************************************************\n')
    fprintf('\n')
    fprintf(' Cateto mínimo que deben poseer las soldaduras de filete [mm] = %g\n',catetomaxmm)
    fprintf('\n')    
    fprintf('\n')
end;

if nn==1
    fprintf('\n')    
    fprintf('\n')
    fprintf('La viga elegida no satisface los criterios de diseño,\n')
    fprintf('por favor elija un perfil de mayor calibre.\n')
end;
fprintf('\n')
fprintf(' Autor = Leonardo Cárdenas González\n')
fprintf(' E-mail= leonardocg@cantv.net\n')
fprintf('\n')    
fprintf('\n')