User:Eml4500.f08.bottle.ranto/HW7

Electric Pylon Analysis
Our team was asked to modify the pylon analysis code to use frame analysis. The properties of the pylon are as follows:

Material = 300 M Steel Height = 60 m Moment of Intertia = 1.3333e-8 Young's Modulus = 200 GPa Area = 4 cm2 Density = 7.8 g/cm3

MATLAB was implemented in solving for the maximum bending moment, shear stress, eigenvalues, and vibrational periods.

Code
The code implemented is as follows:

%********************************************************************* % Filename: pylon2.m % % PURPOSE: % FEA Frame Analysis % %  %  Team Bottle % EML 4500 %*********************************************************************  clear; close; dof = 2; % Node coordinates n_node = 46;            % number of nodes n_elem = 91;            % number of elements total_dof = 2 * n_node; % total dof of system position(:, 1) = [ 1.5; 0]; position(:, 2) = [ 4.53; 0]; position(:, 3) = [ 1.88; 1.18]; position(:, 4) = [ 3.03; 1.18]; position(:, 5) = [ 4.17; 1.18]; position(:, 6) = [ 2.2; 2.181]; position(:, 7) = [ 3.03; 2.181]; position(:, 8) = [ 3.85; 2.181]; position(:, 9) = [ 2.53; 3.181]; position(:, 10) = [ 3.53; 3.181]; position(:, 11) = [ 2.34; 3.681]; position(:, 12) = [ 3.03; 3.681]; position(:, 13) = [ 3.71; 3.681]; position(:, 14) = [ 2.16; 4.181]; position(:, 15) = [ 2.62; 4.181]; position(:, 16) = [ 3.44; 4.181]; position(:, 17) = [ 3.89; 4.181]; position(:, 18) = [ 2.36; 4.5]; position(:, 19) = [ 3.7; 4.5]; position(:, 20) = [ 1.8; 5.172]; position(:, 21) = [ 4.25; 5.172]; position(:, 22) = [ 0; 6]; position(:, 23) = [ 1.06; 6]; position(:, 24) = [ 1.5; 6]; position(:, 25) = [ 1.82; 6]; position(:, 26) = [ 2.22; 6]; position(:, 27) = [ 2.71; 6]; position(:, 28) = [ 3.34; 6]; position(:, 29) = [ 3.84; 6]; position(:, 30) = [ 4.23; 6]; position(:, 31) = [ 4.55; 6]; position(:, 32) = [ 5; 6]; position(:, 33) = [ 6.05; 6]; position(:, 34) = [ .8; 6.23]; position(:, 35) = [ 5.25; 6.23]; position(:, 36) = [ 1.24; 6.355]; position(:, 37) = [ 4.82; 6.355]; position(:, 38) = [ 1.5; 6.43]; position(:, 39) = [ 2; 6.43]; position(:, 40) = [ 2.48; 6.43]; position(:, 41) = [ 3.03; 6.43]; position(:, 42) = [ 3.58; 6.43]; position(:, 43) = [ 4.05; 6.43]; position(:, 44) = [ 4.55; 6.43]; position(:, 45) = [ 1.5; 7.43]; position(:, 46) = [ 4.55; 7.43]; scale = 8.0753701211306; for i = 1 : n_node; x(i) = scale * position(1,i); y(i) = scale * position(2,i); end node_connect(1, 1) = 1;  % element 1 node_connect(2, 1) = 3; node_connect(1, 2) = 1;  % element 2 node_connect(2, 2) = 4; node_connect(1, 3) = 3;  % element 5 node_connect(2, 3) = 4; node_connect(1, 4) = 4;  % element 3 node_connect(2, 4) = 2; node_connect(1, 5) = 4;  % element 6 node_connect(2, 5) = 5; node_connect(1, 6) = 2;  % element 4 node_connect(2, 6) = 5; node_connect(1, 7) = 3;  % element 8 node_connect(2, 7) = 7; node_connect(1, 8) = 5;  % element 9 node_connect(2, 8) = 7; node_connect(1, 9) = 3;  % element 7 node_connect(2, 9) = 6; node_connect(1, 10) = 5;  % element 10 node_connect(2, 10) = 8; node_connect(1, 11) = 6;  % element 11 node_connect(2, 11) = 7; node_connect(1, 12) = 7;  % element 12 node_connect(2, 12) = 8; node_connect(1, 13) = 6;  % element 13 node_connect(2, 13) = 9; node_connect(1, 14) = 7;  % element 14 node_connect(2, 14) = 9; node_connect(1, 15) = 7;  % element 15 node_connect(2, 15) = 10; node_connect(1, 16) = 8;  % element 16 node_connect(2, 16) = 10; node_connect(1, 17) = 9;  % element 17 node_connect(2, 17) = 10; node_connect(1, 18) = 9;  % element 18 node_connect(2, 18) = 11; node_connect(1, 19) = 9;  % element 19 node_connect(2, 19) = 12; node_connect(1, 20) = 10;  % element 20 node_connect(2, 20) = 12; node_connect(1, 21) = 10;  % element 21 node_connect(2, 21) = 13; node_connect(1, 22) = 11;  % element 22 node_connect(2, 22) = 12; node_connect(1, 23) = 12;  % element 23 node_connect(2, 23) = 13; node_connect(1, 24) = 11;  % element 24 node_connect(2, 24) = 14; node_connect(1, 25) = 11;  % element 25 node_connect(2, 25) = 15; node_connect(1, 26) = 12;  % element 26 node_connect(2, 26) = 15; node_connect(1, 27) = 12;  % element 27 node_connect(2, 27) = 16; node_connect(1, 28) = 13;  % element 28 node_connect(2, 28) = 16; node_connect(1, 29) = 13;  % element 29 node_connect(2, 29) = 17; node_connect(1, 30) = 14;  % element 30 node_connect(2, 30) = 15; node_connect(1, 31) = 15;  % element 31 node_connect(2, 31) = 16; node_connect(1, 32) = 16;  % element 32 node_connect(2, 32) = 17; node_connect(1, 33) = 14;  % element 33 node_connect(2, 33) = 20; node_connect(1, 34) = 14;  % element 34 node_connect(2, 34) = 18; node_connect(1, 35) = 15;  % element 35 node_connect(2, 35) = 18; node_connect(1, 36) = 16;  % element 36 node_connect(2, 36) = 19; node_connect(1, 37) = 17;  % element 37 node_connect(2, 37) = 19; node_connect(1, 38) = 17;  % element 38 node_connect(2, 38) = 21; node_connect(1, 39) = 18;  % element 39 node_connect(2, 39) = 20; node_connect(1, 40) = 19;  % element 40 node_connect(2, 40) = 21; node_connect(1, 41) = 20;  % element 41 node_connect(2, 41) = 24; node_connect(1, 42) = 20;  % element 42 node_connect(2, 42) = 26; node_connect(1, 43) = 21;  % element 43 node_connect(2, 43) = 29; node_connect(1, 44) = 21;  % element 44 node_connect(2, 44) = 31; node_connect(1, 45) = 22;  % element 45 node_connect(2, 45) = 23; node_connect(1, 46) = 23;  % element 46 node_connect(2, 46) = 24; node_connect(1, 47) = 24;  % element 47 node_connect(2, 47) = 25; node_connect(1, 48) = 25;  % element 48 node_connect(2, 48) = 26; node_connect(1, 49) = 26;  % element 49 node_connect(2, 49) = 27; node_connect(1, 50) = 27;  % element 50 node_connect(2, 50) = 28; node_connect(1, 51) = 28;  % element 51 node_connect(2, 51) = 29; node_connect(1, 52) = 29;  % element 52 node_connect(2, 52) = 30; node_connect(1, 53) = 30;  % element 53 node_connect(2, 53) = 31; node_connect(1, 54) = 31;  % element 54 node_connect(2, 54) = 32; node_connect(1, 55) = 32;  % element 55 node_connect(2, 55) = 33; node_connect(1, 56) = 22;  % element 56 node_connect(2, 56) = 34; node_connect(1, 57) = 23;  % element 57 node_connect(2, 57) = 34; node_connect(1, 58) = 23;  % element 58 node_connect(2, 58) = 36; node_connect(1, 59) = 24;  % element 59 node_connect(2, 59) = 36; node_connect(1, 60) = 24;  % element 60 node_connect(2, 60) = 38; node_connect(1, 61) = 25;  % element 61 node_connect(2, 61) = 38; node_connect(1, 62) = 25;  % element 62 node_connect(2, 62) = 39; node_connect(1, 63) = 26;  % element 63 node_connect(2, 63) = 39; node_connect(1, 64) = 26;  % element 64 node_connect(2, 64) = 40; node_connect(1, 65) = 27;  % element 65 node_connect(2, 65) = 40; node_connect(1, 66) = 27;  % element 66 node_connect(2, 66) = 41; node_connect(1, 67) = 28;  % element 67 node_connect(2, 67) = 41; node_connect(1, 68) = 28;  % element 68 node_connect(2, 68) = 42; node_connect(1, 69) = 29;  % element 69 node_connect(2, 69) = 42; node_connect(1, 70) = 29;  % element 70 node_connect(2, 70) = 43; node_connect(1, 71) = 30;  % element 71 node_connect(2, 71) = 43; node_connect(1, 72) = 30;  % element 72 node_connect(2, 72) = 44; node_connect(1, 73) = 31;  % element 73 node_connect(2, 73) = 44; node_connect(1, 74) = 31;  % element 74 node_connect(2, 74) = 37; node_connect(1, 75) = 32;  % element 75 node_connect(2, 75) = 37; node_connect(1, 76) = 32;  % element 76 node_connect(2, 76) = 35; node_connect(1, 77) = 33;  % element 77 node_connect(2, 77) = 35; node_connect(1, 78) = 34;  % element 78 node_connect(2, 78) = 36; node_connect(1, 79) = 35;  % element 79 node_connect(2, 79) = 37; node_connect(1, 80) = 36;  % element 80 node_connect(2, 80) = 38; node_connect(1, 81) = 37;  % element 81 node_connect(2, 81) = 44; node_connect(1, 82) = 38;  % element 82 node_connect(2, 82) = 39; node_connect(1, 83) = 39;  % element 83 node_connect(2, 83) = 40; node_connect(1, 84) = 40;  % element 84 node_connect(2, 84) = 41; node_connect(1, 85) = 41;  % element 85 node_connect(2, 85) = 42; node_connect(1, 86) = 42;  % element 86 node_connect(2, 86) = 43; node_connect(1, 87) = 43;  % element 87 node_connect(2, 87) = 44; node_connect(1, 88) = 38;  % element 88 node_connect(2, 88) = 45; node_connect(1, 89) = 39;  % element 89 node_connect(2, 89) = 45; node_connect(1, 90) = 43;  % element 90 node_connect(2, 90) = 46; node_connect(1, 91) = 44;  % element 91 node_connect(2, 91) = 46;

figure(1) for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; plot(xx,yy,'--') hold on  end E = 200e9; A = 4e-4; P = -1000; dof = 2*n_node; K=zeros(dof); R = zeros(dof,1); R(66) = P;  debc = [1,2,3,4]; ebcVals = zeros(length(debc),1);

for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); location = [x(node_1),y(node_1); x(node_2),y(node_2)]; lm = [ node_1*2-1, node_1*2, node_2*2-1, node_2*2 ]; k = PlaneTrussElement(E,A,location); K(lm,lm) = K(lm,lm) + k;  end [d, reactions] = NodalSoln(K, R, debc, ebcVals) results=[]; for i=1:n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); location = [x(node_1),y(node_1); x(node_2),y(node_2)]; lm = [ node_1*2-1, node_1*2, node_2*2-1, node_2*2 ]; results = [results; PlaneTrussResults(E, A, ...      location, d(lm))]; end format short g  multiplier = 20; d = d*multiplier; for i = 1:n_node position_d(:,i) = [ position(1,i)+d(2*i-1), position(2,i)+d(2*i) ]; end for i = 1 : n_node; x(i) = scale * position_d(1,i); y(i) = scale * position_d(2,i); end

for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; plot(xx,yy,'-black') hold on  end dof = 3; % Node coordinates n_node = 46;              % number of nodes n_elem = 91;              % number of elements total_dof = dof * n_node; % total dof of system position(:, 1) = [ 1.5; 0]; position(:, 2) = [ 4.53; 0]; position(:, 3) = [ 1.88; 1.18]; position(:, 4) = [ 3.03; 1.18]; position(:, 5) = [ 4.17; 1.18]; position(:, 6) = [ 2.2; 2.181]; position(:, 7) = [ 3.03; 2.181]; position(:, 8) = [ 3.85; 2.181]; position(:, 9) = [ 2.53; 3.181]; position(:, 10) = [ 3.53; 3.181]; position(:, 11) = [ 2.34; 3.681]; position(:, 12) = [ 3.03; 3.681]; position(:, 13) = [ 3.71; 3.681]; position(:, 14) = [ 2.16; 4.181]; position(:, 15) = [ 2.62; 4.181]; position(:, 16) = [ 3.44; 4.181]; position(:, 17) = [ 3.89; 4.181]; position(:, 18) = [ 2.36; 4.5]; position(:, 19) = [ 3.7; 4.5]; position(:, 20) = [ 1.8; 5.172]; position(:, 21) = [ 4.25; 5.172]; position(:, 22) = [ 0; 6]; position(:, 23) = [ 1.06; 6]; position(:, 24) = [ 1.5; 6]; position(:, 25) = [ 1.82; 6]; position(:, 26) = [ 2.22; 6]; position(:, 27) = [ 2.71; 6]; position(:, 28) = [ 3.34; 6]; position(:, 29) = [ 3.84; 6]; position(:, 30) = [ 4.23; 6]; position(:, 31) = [ 4.55; 6]; position(:, 32) = [ 5; 6]; position(:, 33) = [ 6.05; 6]; position(:, 34) = [ .8; 6.23]; position(:, 35) = [ 5.25; 6.23]; position(:, 36) = [ 1.24; 6.355]; position(:, 37) = [ 4.82; 6.355]; position(:, 38) = [ 1.5; 6.43]; position(:, 39) = [ 2; 6.43]; position(:, 40) = [ 2.48; 6.43]; position(:, 41) = [ 3.03; 6.43]; position(:, 42) = [ 3.58; 6.43]; position(:, 43) = [ 4.05; 6.43]; position(:, 44) = [ 4.55; 6.43]; position(:, 45) = [ 1.5; 7.43]; position(:, 46) = [ 4.55; 7.43]; scale = 8.0753701211306; for i = 1 : n_node; x(i) = scale * position(1,i); y(i) = scale * position(2,i); end node_connect(1, 1) = 1;  % element 1 node_connect(2, 1) = 3; node_connect(1, 2) = 1;  % element 2 node_connect(2, 2) = 4; node_connect(1, 3) = 3;  % element 5 node_connect(2, 3) = 4; node_connect(1, 4) = 4;  % element 3 node_connect(2, 4) = 2; node_connect(1, 5) = 4;  % element 6 node_connect(2, 5) = 5; node_connect(1, 6) = 2;  % element 4 node_connect(2, 6) = 5; node_connect(1, 7) = 3;  % element 8 node_connect(2, 7) = 7; node_connect(1, 8) = 5;  % element 9 node_connect(2, 8) = 7; node_connect(1, 9) = 3;  % element 7 node_connect(2, 9) = 6; node_connect(1, 10) = 5;  % element 10 node_connect(2, 10) = 8; node_connect(1, 11) = 6;  % element 11 node_connect(2, 11) = 7; node_connect(1, 12) = 7;  % element 12 node_connect(2, 12) = 8; node_connect(1, 13) = 6;  % element 13 node_connect(2, 13) = 9; node_connect(1, 14) = 7;  % element 14 node_connect(2, 14) = 9; node_connect(1, 15) = 7;  % element 15 node_connect(2, 15) = 10; node_connect(1, 16) = 8;  % element 16 node_connect(2, 16) = 10; node_connect(1, 17) = 9;  % element 17 node_connect(2, 17) = 10; node_connect(1, 18) = 9;  % element 18 node_connect(2, 18) = 11; node_connect(1, 19) = 9;  % element 19 node_connect(2, 19) = 12; node_connect(1, 20) = 10;  % element 20 node_connect(2, 20) = 12; node_connect(1, 21) = 10;  % element 21 node_connect(2, 21) = 13; node_connect(1, 22) = 11;  % element 22 node_connect(2, 22) = 12; node_connect(1, 23) = 12;  % element 23 node_connect(2, 23) = 13; node_connect(1, 24) = 11;  % element 24 node_connect(2, 24) = 14; node_connect(1, 25) = 11;  % element 25 node_connect(2, 25) = 15; node_connect(1, 26) = 12;  % element 26 node_connect(2, 26) = 15; node_connect(1, 27) = 12;  % element 27 node_connect(2, 27) = 16; node_connect(1, 28) = 13;  % element 28 node_connect(2, 28) = 16; node_connect(1, 29) = 13;  % element 29 node_connect(2, 29) = 17; node_connect(1, 30) = 14;  % element 30 node_connect(2, 30) = 15; node_connect(1, 31) = 15;  % element 31 node_connect(2, 31) = 16; node_connect(1, 32) = 16;  % element 32 node_connect(2, 32) = 17; node_connect(1, 33) = 14;  % element 33 node_connect(2, 33) = 20; node_connect(1, 34) = 14;  % element 34 node_connect(2, 34) = 18; node_connect(1, 35) = 15;  % element 35 node_connect(2, 35) = 18; node_connect(1, 36) = 16;  % element 36 node_connect(2, 36) = 19; node_connect(1, 37) = 17;  % element 37 node_connect(2, 37) = 19; node_connect(1, 38) = 17;  % element 38 node_connect(2, 38) = 21; node_connect(1, 39) = 18;  % element 39 node_connect(2, 39) = 20; node_connect(1, 40) = 19;  % element 40 node_connect(2, 40) = 21; node_connect(1, 41) = 20;  % element 41 node_connect(2, 41) = 24; node_connect(1, 42) = 20;  % element 42 node_connect(2, 42) = 26; node_connect(1, 43) = 21;  % element 43 node_connect(2, 43) = 29; node_connect(1, 44) = 21;  % element 44 node_connect(2, 44) = 31; node_connect(1, 45) = 22;  % element 45 node_connect(2, 45) = 23; node_connect(1, 46) = 23;  % element 46 node_connect(2, 46) = 24; node_connect(1, 47) = 24;  % element 47 node_connect(2, 47) = 25; node_connect(1, 48) = 25;  % element 48 node_connect(2, 48) = 26; node_connect(1, 49) = 26;  % element 49 node_connect(2, 49) = 27; node_connect(1, 50) = 27;  % element 50 node_connect(2, 50) = 28; node_connect(1, 51) = 28;  % element 51 node_connect(2, 51) = 29; node_connect(1, 52) = 29;  % element 52 node_connect(2, 52) = 30; node_connect(1, 53) = 30;  % element 53 node_connect(2, 53) = 31; node_connect(1, 54) = 31;  % element 54 node_connect(2, 54) = 32; node_connect(1, 55) = 32;  % element 55 node_connect(2, 55) = 33; node_connect(1, 56) = 22;  % element 56 node_connect(2, 56) = 34; node_connect(1, 57) = 23;  % element 57 node_connect(2, 57) = 34; node_connect(1, 58) = 23;  % element 58 node_connect(2, 58) = 36; node_connect(1, 59) = 24;  % element 59 node_connect(2, 59) = 36; node_connect(1, 60) = 24;  % element 60 node_connect(2, 60) = 38; node_connect(1, 61) = 25;  % element 61 node_connect(2, 61) = 38; node_connect(1, 62) = 25;  % element 62 node_connect(2, 62) = 39; node_connect(1, 63) = 26;  % element 63 node_connect(2, 63) = 39; node_connect(1, 64) = 26;  % element 64 node_connect(2, 64) = 40; node_connect(1, 65) = 27;  % element 65 node_connect(2, 65) = 40; node_connect(1, 66) = 27;  % element 66 node_connect(2, 66) = 41; node_connect(1, 67) = 28;  % element 67 node_connect(2, 67) = 41; node_connect(1, 68) = 28;  % element 68 node_connect(2, 68) = 42; node_connect(1, 69) = 29;  % element 69 node_connect(2, 69) = 42; node_connect(1, 70) = 29;  % element 70 node_connect(2, 70) = 43; node_connect(1, 71) = 30;  % element 71 node_connect(2, 71) = 43; node_connect(1, 72) = 30;  % element 72 node_connect(2, 72) = 44; node_connect(1, 73) = 31;  % element 73 node_connect(2, 73) = 44; node_connect(1, 74) = 31;  % element 74 node_connect(2, 74) = 37; node_connect(1, 75) = 32;  % element 75 node_connect(2, 75) = 37; node_connect(1, 76) = 32;  % element 76 node_connect(2, 76) = 35; node_connect(1, 77) = 33;  % element 77 node_connect(2, 77) = 35; node_connect(1, 78) = 34;  % element 78 node_connect(2, 78) = 36; node_connect(1, 79) = 35;  % element 79 node_connect(2, 79) = 37; node_connect(1, 80) = 36;  % element 80 node_connect(2, 80) = 38; node_connect(1, 81) = 37;  % element 81 node_connect(2, 81) = 44; node_connect(1, 82) = 38;  % element 82 node_connect(2, 82) = 39; node_connect(1, 83) = 39;  % element 83 node_connect(2, 83) = 40; node_connect(1, 84) = 40;  % element 84 node_connect(2, 84) = 41; node_connect(1, 85) = 41;  % element 85 node_connect(2, 85) = 42; node_connect(1, 86) = 42;  % element 86 node_connect(2, 86) = 43; node_connect(1, 87) = 43;  % element 87 node_connect(2, 87) = 44; node_connect(1, 88) = 38;  % element 88 node_connect(2, 88) = 45; node_connect(1, 89) = 39;  % element 89 node_connect(2, 89) = 45; node_connect(1, 90) = 43;  % element 90 node_connect(2, 90) = 46; node_connect(1, 91) = 44;  % element 91 node_connect(2, 91) = 46; % Undeformed plot for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; plot(xx,yy,':') hold on  end % Frame analysis E = 200e9; A = 4e-4; P = -1000; I = 1.3333e-8; K = zeros(dof*n_node); R = zeros(dof*n_node,1); R(66) = P;  debc = [1,2,3,4,5,6]; ebcVals = zeros(length(debc),1); % Assemble global matrix for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); coord = [x(node_1),y(node_1); x(node_2),y(node_2)]; lm = [ node_1*3-2, node_1*3-1, node_1*3, node_2*3-2, node_2*3-1, node_2*3 ]; [ke rq] = PlaneFrameElement(E,I,A,0,0,coord); K(lm, lm) = K(lm, lm) + ke; R(lm) = R(lm) + rq; end % Compute reactions [d, reactions] = NodalSoln(K, R, debc, ebcVals) fa = []; bma = []; Va = []; for i = 1:n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); coord = [x(node_1),y(node_1); x(node_2),y(node_2)]; lm = [ node_1*3-2, node_1*3-1 node_1*3, node_2*3-2, node_2*3-1, node_2*3 ]; [f, bm, V] = PlaneFrameResults(E,I,A,0,0,location,d(lm)); fa = [fa; f]; bma = [bma; bm]; Va = [Va; V]; end % Highest bending moment moment = 0; for i = 1:n_elem*2 if abs(bma(i,3)) > moment moment = abs(bma(i,3)); momentnode = i;     end end moment if mod(momentnode,2) == 0 momentelement = momentnode/2; else momentelement = (momentnode+1)/2; end momentelement % Shear stress element shearstress = 0; for i = 1:n_elem*2 if abs(Va(i,3)) > shearstress shearstress = abs(Va(i,3)); shearstressnode = i;     end end shearstress if mod(momentnode,2) == 0 shearstresselement = shearstressnode/2; else shearstresselement = (shearstressnode+1)/2; end shearstresselement

multiplier = 20; d = d*multiplier; % Deformed positions for i = 1:n_node position_d(:,i) = [ position(1,i)+d(3*i-2), position(2,i)+d(3*i-1) ]; end for i = 1 : n_node; x(i) = scale * position_d(1,i); y(i) = scale * position_d(2,i); end for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; axis([-5 53 -5 70]) plot(xx,yy,'--') hold on  end title('Electric Pylon in Deformed and Undeformed State') xlabel('x') ylabel('y') rho = 7.8e3; M = zeros(dof); for i = 1 : n_node; x(i) = scale * position(1,i); y(i) = scale * position(2,i); end for i = 1 : n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); location = [x(node_1),y(node_1); x(node_2),y(node_2)]; L(i) = PlaneTrussLength(location); m(i) = rho*L(i)*A; end i = 1; for j = 1 : n_node mass(j) = 0; end for j = 1 : n_node for k = 1 : n_elem if node_connect(1,k) == j              mass(j) = mass(j) + m(k)/2; elseif node_connect(2,k) == j                  local_elems(j,i) = k;                   mass(j) = mass(j) + m(k)/2; end end end for i = 1 : 46 M(3*i-2,3*i-2) = mass(i); M(3*i-1,3*i-1) = mass(i); M(3*i,3*i) = 0; end M;  Mf = ReduceMassMatrix(M, R, debc, ebcVals); Kf = ReduceStiffnessMatrix(K, R, debc, ebcVals); A = pinv(Mf)*Kf; [V2,D2] = eig(A); eig = [999999999999,9999999999999,9999999999999]; for i = 1 : 132 if (eig(1) > D2(i,i) && D2(i,i) ~= 0) eig(1) = D2(i,i); column(1) = i;          end end for i = 1 : 132 if (eig(2) > D2(i,i) && D2(i,i) > eig(1) && D2(i,i) ~= 0) eig(2) = D2(i,i); column(2) = i;      end end for i = 1 : 132 if (eig(3) > D2(i,i) && D2(i,i) > eig(2) && D2(i,i) ~= 0) eig(3) = D2(i,i); column(3) = i;      end end eig % Period Calculation for i = 1 : 3 omega(i) = sqrt(eig(i)); T(i) = 2*pi/omega(i); end T % Eigenvalue plots % First eigenvalue plot figure(2) for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; plot(xx,yy,'--') hold on  end

Z = zeros(6,132); V2 = [Z;V2]; for i = 1:n_node position_d(:,i) = [ scale*position(1,i) + multiplier*V2(3*i-2,column(1)), scale*position(2,i) + multiplier*V2(3*i-1,column(1))  ]; end for i = 1 : n_node dx(i) = position_d(1,i); dy(i) = position_d(2,i); end for i = 1 : n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [dx(node_1),dx(node_2)]; yy = [dy(node_1),dy(node_2)]; plot(xx,yy,'-black') hold on  end title('Effects of the Smallest Eigenvalue') xlabel('x') ylabel('y') % Second eigenvalue plot

figure(3)

for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; axis([-5 53 -5 70]) plot(xx,yy,'--') hold on  end for i = 1:n_node position_d(:,i) = [ scale*position(1,i) + multiplier*V2(3*i-2,column(2)), scale*position(2,i) + multiplier*V2(3*i-1,column(2)) ]; end for i = 1 : n_node dx(i) = position_d(1,i); dy(i) = position_d(2,i); end for i = 1 : n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [dx(node_1),dx(node_2)]; yy = [dy(node_1),dy(node_2)]; axis([-5 53 -5 70]) plot(xx,yy,'-black') hold on  end title('Effects of the Second Smallest Eigenvalue') xlabel('x') ylabel('y') % plot eigenvectors for 3rd smallest eigenvalue multiplier = 10; figure(4) for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; plot(xx,yy,'--') hold on  end for i = 1:n_node position_d(:,i) = [ scale*position(1,i) + multiplier*V2(3*i-2,column(3)), scale*position(2,i) + multiplier*V2(3*i-1,column(3)) ]; end for i = 1 : n_node dx(i) = position_d(1,i); dy(i) = position_d(2,i); end for i = 1 : n_elem node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [dx(node_1),dx(node_2)]; yy = [dy(node_1),dy(node_2)]; plot(xx,yy,'-black') hold on  end title('Effects of the Third Smallest Eigenvalue') xlabel('x') ylabel('y')

Results
The displacement results were:

d = 0           0            0            0  -0.00019023   0.00017465   -0.0001277 -1.4074e-006 -0.00016006  -0.0002967  -0.00012671   0.00032602  -0.00012798    -0.000128  -0.00012792  -0.00054327   0.00044932   0.00030901   0.00046381  -0.00061057     0.001017   0.00064583    0.0010325  -0.00019427    0.0010502  -0.00097027    0.0017167    0.0010338    0.0017162   0.00023259    0.0016833  -0.00064959     0.001683   -0.0013293    0.0023452   0.00064079    0.0021863   -0.0010297    0.0047122    0.0023902    0.0039576   -0.0024165    0.0063605    0.0057328    0.0063605    0.0037877    0.0063605    0.0029803    0.0063614     0.002384    0.0063657    0.0016463    0.0063711   0.00086194    0.0063182  -0.00024268    0.0062289   -0.0013182    0.0061363   -0.0023672    0.0060413   -0.0033231    0.0058839   -0.0051278    0.0055152    -0.012587    0.0067826    0.0042648     0.006996   -0.0063359     0.007012    0.0034574    0.0074006   -0.0043591    0.0071505    0.0029772    0.0071478    0.0020508    0.0071421    0.0012278     0.007182   0.00032026    0.0072816  -0.00073249    0.0074073   -0.0018633    0.0075643   -0.0033872    0.0090005    0.0029772     0.010455   -0.0033872

The maximum bending moment is:

moment = 472.49

This moment occurs at:

momentelement = 45

The maximum transverse shear stress is:

shearstress = 85.852

This stress occurs at:

shearstresselement =  45

Below is a plot of the undeformed (blue) and deformed (black) pylon structure:

Effects of Eigenvectors
The lowest eigenvalues and their corresponding oscillation periods are:

eig =  132.86       2471.2       2942.6

T =  0.54511      0.12639      0.11583

Plots of the effects of the three lowest eigenvalues are shown below. The blue dashed line represents the undeformed structure while the solid black line represents the deformed structure.



Statically Determinant
The final step in this problem was to determine whether the structure can be solved using statics. Since there are only two fixed points and four bars for which reactions must be computed, it can be determined that this problem is statically indeterminate.