Вы находитесь на странице: 1из 4

ENME 442 – Finite Element Analysis

Homework 2 – Solution

(100 pts)

Reading: Cook et al., Sections 2.1-6

1. Solve problem 2.4-2 from the text.


2. Use MATLAB to solve the 2D plane truss problem shown below. Use three bar elements to model the
truss and report the following results: nodal DOF {D}, nodal load vector {R}, and element stresses.
Check your solution by hand (for {R} and element stresses only) and show all work.
Note that MATLAB function [k T] = kmat(k_value, angle) is provided. This function accepts
a bar element stiffness value (k_value) and an orientation angle in degrees (angle). It returns the
4x4 element stiffness matrix (k) in terms of global DOF and the 2x4 transformation matrix (T) that can
be used to transform global DOF into local DOF (see equation 2.4-2 in the text).
From MATLAB solution...
MATLAB Code for Problem 2

clear all; close all; clc;

p = 100; % N
l = 1000; % mm
E = 70e3; % MPa
A = 5; % mm^2

% find individual kval's and element stiffness matrices


kval1 = A*E/l;
kval2 = (4/5)*A*E/l;
kval3 = (4/3)*A*E/l;
[k1 T1] = kmat(kval1,90);
[k2 T2] = kmat(kval2,atand(.75)+90);
[k3 T3] = kmat(kval3,180);

% assemble global stiffness K by placing k's correctly


% each element k is added into K only on the rows and columns matching the
% DOF for that element
K = zeros(6,6);
K(3:6,3:6) = K(3:6,3:6) + k1;
K([1 2 5 6],[1 2 5 6]) = K([1 2 5 6],[1 2 5 6]) + k2;
K(1:4,1:4) = K(1:4,1:4) + k3;

% use Kbig to approximate fixed boundary conditions


% add a Kbig on the diagonal only for each DOF that is fixed
Kbig = 1e6*max(max(K));
Kmod = K;
Kmod(3,3) = Kmod(3,3) + Kbig;
Kmod(5,5) = Kmod(5,5) + Kbig;
Kmod(6,6) = Kmod(6,6) + Kbig;

% solve for D using Kmod, and solve for R using the original K
P = [0 -p 0 0 0 0]';
D = inv(Kmod)*P
R = K*D

% use T to transform components of D into local d for each element


d1 = T1*D(3:6);
d2 = T2*D([1 2 5 6]);
d3 = T3*D(1:4);

% use Hooke's law (stress = E*strain) to find element stresses


% strain is computed as change in length over original length
S = E*[d1(2)-d1(1); (4/5)*(d2(2)-d2(1)); (4/3)*(d3(2)-d3(1))]/l

% alternate means to compute stress using equation 2.9-1 from text, which
% is based on global DOF rather than the element local DOF computed above
S_v2(1,1) = (E/l)*[(D(5)-D(3))*T1(1,1)+(D(6)-D(4))*T1(1,2)];
S_v2(2,1) = (4/5)*(E/l)*[(D(5)-D(1))*T2(1,1)+(D(6)-D(2))*T2(1,2)];
S_v2(3,1) = (4/3)*(E/l)*[(D(3)-D(1))*T3(1,1)+(D(4)-D(2))*T3(1,2)];
S_v2

function [k T] = kmat(kval,b)
% note that angle b is given in degrees!
c = cosd(b); cc = c^2;
s = sind(b); ss = s^2;
cs = c*s;
k = kval*[cc cs -cc -cs;cs ss -cs -ss;-cc -cs cc cs;-cs -ss cs ss];
T = [c s 0 0;0 0 c s];

Вам также может понравиться