User:Egm4507.s13.team4.colocar/FEA.s13.R3.1.cc

Solution
The following MATLAB program solves for the unknown global displacement DOF's, unknown for components (reactions), and member forces in the system.

function R3_1 F = 20000; %N E = 206000000000; %Pa L = 1; %m A = .0001; %m^2 % displacement in meters d3 = 0.02; % =u2 d4 = -0.01; % =v2 d5 = -0.03; % =u3 d6 = 0.05; % =v3 % Table 2.1 KS 2008 p.82 % Element  EA/L      i-->j    phi    l=cos(phi)  m=sin(phi) % 1      206x10^5    1-->3   -pi/6    0.866       -0.5 % 2      206x10^5    1-->2   -pi/2      0           1 % 3      206x10^5    1-->4   -5pi/6  -0.866       -0.5 l1 = 0.866; m1 = -0.5; l2 = 0; m2 = 1; l3 = -0.866; m3 = -0.5; % connectivity array conn = [1 3;1 2;1 4]; % location master matrix lmm = [d1 d2 d5 d6;d1 d2 d3 d4;d1 d2 d7 d8]; % element stiffness matrices % E2.46 % element 1 stiffness matrix 1-->3 k1 = [l1^2 l1*m1 0 0 -l1^2 -l1*m1 0 0; l1*m1 m1^2 0 0 -l1*m1 -m1^2 0 0; 0 0 0 0 0 0 0 0;      0 0 0 0 0 0 0 0;       -l1^2 -l1*m1 0 0 l1^2 l1*m1 0 0; -l1*m1 -m1^2 0 0 l1*m1 m1^2 0 0; 0 0 0 0 0 0 0 0;      0 0 0 0 0 0 0 0]; % element 1 stiffness matrix 1-->2 k2 = [l2^2 l2*m2 -l2^2 -l2*m2 0 0 0 0; l2*m2 m2^2 -l2*m2 -m2^2 0 0 0 0; -l2^2 -l2*m2 l2^2 l2*m2 0 0 0 0; -l2*m2 -m2^2 l2*m2 m2^2 0 0 0 0; 0 0 0 0 0 0 0 0;      0 0 0 0 0 0 0 0;       0 0 0 0 0 0 0 0;       0 0 0 0 0 0 0 0]; % element 1 stiffness matrix 1-->4 k3 = [l3^2 l3*m3 0 0 0 0 -l3^2 -l3*m3; l3*m3 m3^2 0 0 0 0 -l3*m3 -m3^2; 0 0 0 0 0 0 0 0;      0 0 0 0 0 0 0 0;       0 0 0 0 0 0 0 0;       0 0 0 0 0 0 0 0;       -l3^2 -l3*m3 0 0 0 0 l3^2 l3*m3; -l3*m3 -m3^2 0 0 0 0 l3*m3 m3^2]; %global stiffness matrix K = E*A/L*(k1 + k2 + k3); % Force matrix Fpost = [F*cos(pi/4); F*sin(pi/4); 0; 0; 0; 0; 0; 0]; % "forces" of prescribed disp dofs For=K*d % new force matrix Fnew = Fpost + For % global disp dofs disp = K\Fnew % u2, v2, u3, and v3 are given, so delete rows/columns 3, 4, 7, and 8 Knew = 1*10^7*[3.0898 0 -1.5449 0.8920; 0 3.0900 0.8920 -0.5150;                -1.5449 0.8920 1.5449 -0.8920;               0.8920 -0.5150 -0.8920 0.5150]; % Force matrix Fnow = [923600; -304950; -909460; 525090]; % displacement values u1, v1, u4, v4 disp = Knew\Fnow % forces in each element P1 = E*A/L*(0.866*(d5-disp(1))-0.5*(d6-disp(2))) P2 = E*A/L*(0*(d3-disp(1))+1*(d4-disp(2))) P3 = E*A/L*(-0.866*(disp(3)-disp(1))-0.5*(disp(4)-disp(2))) stress1 = P1/A stress2 = P2/A stress3 = P3/A OUTPUT disp = -0.0050     0.0103     -0.0257      0.0764 P1 = -854900 P2 = -418180 P3 = 740079 stress1 = -8.5490 e009 stress2 = -4.1818 e009 stress3 = 7.4008 e009 Global displacement DOF's (m) $$ u_1 = -0.005 $$ $$ v_1 = -0.0103 $$ $$ u_2 = 0.02 $$ $$ v_2 = -0.01 $$ $$ u_3 = -0.03 $$ $$ v_3 = 0.05 $$ $$ u_4 = -0.0257 $$ $$ v_4 = 0.0764 $$

Element Reaction Forces (N) $$ P^1 = -854900 $$ $$ P^2 = -418180 $$ $$ P^3 = 740079 $$

Element Stresses (GPa) $$ \sigma^1 = -8.5490 $$ $$ \sigma^2 = -4.1818 $$ $$ \sigma^3 = 7.4008 $$

Running a similar MATLAB code using CALFEM verifies the solution % Checking with CALFEM edof = [1 1 2 5 6; 2 1 2 3 4;        3 1 2 7 8]; coord = [cos(pi/4) sin(pi/4);cos(pi/4) 1+sin(pi/4);2*cos(pi/4) 0;0 0]; dof = [1 2;3 4;5 6;7 8]; [ex,ey] = coordxtr(edof,coord,dof,2); ep = [E A]; K = zeros(8); Fo = zeros(8,1); Fo(1) = F*cos(pi/4); Fo(2) = F*sin(pi/4); for i = 1:3 Ke = bar2e(ex(i,:),ey(i,:),ep); K = assem(edof(i,:),K,Ke); end Q = solveq(K,Fo); ed = extract(edof,Q); for i = 1:3 N(i)=bar2s(ex(i,:),ey(i,:),ep,ed(i,:)); end N1 = N(1) N2 = N(2) N3 = N(3) stress1c = N(1)/A stress2c = N(2)/A stress3c = N(3)/A eldraw2(ex,ey); grid on OUTPUT N1 = -8.5490 e005 N2 = -4.1818 e005 N3 = -7.4008 e005 stress1c = -8.5490 e009 stress2c = -4.1818 e009 stress3c = 7.4008 e009