0% found this document useful (0 votes)
21 views5 pages

5/2/16 11:52 AM C:/U... /aerostructure - WH - 27.m 1 of 5: %MECE 412 Homework 5.1

This MATLAB code analyzes the reactions, member forces, and displacements of a 2D truss structure. It defines the geometry of the truss, calculates the reactions at pins A and E by summing forces and moments. It then calculates the member forces at pins C, D, and B. Finally, it sets up and solves a system of equations to determine the displacements dBx, dBy, dCx, dCy, dDx, and dDy.

Uploaded by

Guilherme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

5/2/16 11:52 AM C:/U... /aerostructure - WH - 27.m 1 of 5: %MECE 412 Homework 5.1

This MATLAB code analyzes the reactions, member forces, and displacements of a 2D truss structure. It defines the geometry of the truss, calculates the reactions at pins A and E by summing forces and moments. It then calculates the member forces at pins C, D, and B. Finally, it sets up and solves a system of equations to determine the displacements dBx, dBy, dCx, dCy, dDx, and dDy.

Uploaded by

Guilherme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

5/2/16 11:52 AM C:\U...\Aerostructure_WH_27.

m 1 of 5

%MECE 412 Homework 5.1


clc, clear, format compact, format shortg, close

MyName = 'Guilherme Mollica ;';


Course = 'MECE 412 ; ';
HWNo = '5.1';
Namestr = strcat('Name :',MyName,' Course :',Course,' Problem :',HWNo);
fprintf('--------------------------------------------------------------
\n')
disp(Namestr)
fprintf('------------------------------------------------------------
\n')
fprintf('Date: '),disp(date)
fprintf('Directory :'),disp(pwd)
fprintf('------------------------------------------------------------
\n')

%%
A = [0,0,0]; B = [1080,810,0]; C = [3000,810,0]; D = [1080,2250,0];
E = [0,2250,0];

%% reactions
Fc = [0,-10,0];
rAE = E-A; rAC = C - A;

syms Ax Ay Ex

Fa = [Ax,Ay,0]; Fe = [Ex,0,0];
sumF = Fa + Fe + Fc;
sumMA = cross(rAE,Fe)+cross(rAC,Fc);

sol = solve(sumF(1),sumF(2),sumMA(3));
Ax = subs(sol.Ax);
Ay = subs(sol.Ay);
Ex = subs(sol.Ex);
Ey = 0;
fprintf('Reactions \n')
fprintf('Ax: '),disp(Ax)
fprintf('Ay: '),disp(Ay)
5/2/16 11:52 AM C:\U...\Aerostructure_WH_27.m 2 of 5

fprintf('Ex: '),disp(Ex)
fprintf('EY: '),disp(Ey)
fprintf('------------------------------------------------------------
\n')

Fa = subs(Fa);
Fe = subs(Fe);

%% member forces

% pin C

syms Fcd Fcb

rCD = D-C; rCB = B-C;


eCD = rCD/norm(rCD); eCB = rCB/norm(rCB);
sumC = Fc + Fcd*eCD + Fcb*eCB ;
solC = solve(sumC(1),sumC(2));
Fcd = subs(solC.Fcd);
Fcb = subs(solC.Fcb);

fprintf('Member Forces \n')


fprintf('Fcd: '),disp(Fcd)
fprintf('Fcb: '),disp(Fcb)

% pin D

syms Fde Fdb

rDC = C-D; rDE = E - D; rDB = B - D;


eDC = rDC/norm(rDC); eDE = rDE/norm(rDE); eDB = rDB/norm(rDB);
sumD = Fcd*eDC + Fde*eDE + Fdb*eDB;
solD = solve(sumD(1),sumD(2));
Fde = subs(solD.Fde);
Fdb = subs(solD.Fdb);

fprintf('Fde: '),disp(Fde)
5/2/16 11:52 AM C:\U...\Aerostructure_WH_27.m 3 of 5

fprintf('Fdb: '),disp(Fdb)

%pin B

syms Fbe Fba

rBA = A-B; rBE = E - B; rBD = D-B; rBC = C -B;


eBA = rBA/norm(rBA); eBE = rBE/norm(rBE); eBD = rBD/norm(rBD); eBC =
rBC/norm(rBC);
sumB = Fba*eBA + Fbe*eBE + Fcb*eBC + Fdb*eBD;
solB = solve(sumB(1),sumB(2));
Fbe = subs(solB.Fbe);
Fba = subs(solB.Fba);

fprintf('Fbe: '),disp(Fbe)
fprintf('Fba: '),disp(Fba)
fprintf('------------------------------------------------------------
\n')

%% calculating displacements

% L/AE = 1/20
const = 1/20;

syms dBx dBy dCx dCy dDx dDy

dA = [0,0,0]; dE = [0,0,0]; dB = [dBx,dBy,0];


dC = [dCx,dCy,0]; dD = [dDx,dDy,0];

% member AB
rAB = [B-A]; eAB = rAB/norm(rAB);
Eq(1) = dot(dB,eAB) - dot(dA,eAB) - Fba*const;

% member EB
rEB = [B-E]; eEB = rEB/norm(rEB);
Eq(2) = dot(dB,eEB) - dot(dE,eEB) - Fbe*const;
5/2/16 11:52 AM C:\U...\Aerostructure_WH_27.m 4 of 5

% member BC
rBC = [C-B]; eBC = rBC/norm(rBC);
Eq(3) = dot(dC,eBC) - dot(dB,eBC) - Fcb*const;

% member CD
rCD = [D-C]; eCD = rCD/norm(rCD);
Eq(4) = dot(dD,eCD) - dot(dC,eCD) - Fcd*const;

% member ED
rED = [D-E]; eED = rED/norm(rED);
Eq(5) = dot(dD,eED) - dot(dE,eED) - Fde*const;

% member DB
rDB = [B-D]; eDB = rDB/norm(rDB);
Eq(6) = dot(dB,eDB) - dot(dD,eDB) - Fdb*const;

Eq';

solDp = solve(Eq);
dBx = double(solDp.dBx);
dBy = double(solDp.dBy);
dCx = double(solDp.dCx);
dCy = double(solDp.dCy);
dDx = double(solDp.dDx);
dDy = double(solDp.dDy);

fprintf('Displacements \n')
fprintf('dBx: '),disp(dBx)
fprintf('dBy: '),disp(dBy)
fprintf('dCx: '),disp(dCx)
fprintf('dCy: '),disp(dCy)
fprintf('dDx: '),disp(dDx)
fprintf('dDy: '),disp(dDy)
fprintf('------------------------------------------------------------
\n')
5/2/16 11:52 AM C:\U...\Aerostructure_WH_27.m 5 of 5

You might also like