FEM Beam problem

버전 1.0.0.0 (2.14 KB) 작성자: Sajeer Modavan
This code may help you to calculate the displacement and support reactions of Beam using FEM
다운로드 수: 1.6K
업데이트 날짜: 2015/12/1

라이선스 보기

% This Matlab code help you to calculate the displacements and reactions of
% Beam. You may Need to change the boundary conditions for different cases
% of Beam. If you are changing the number of elements, you may need to
% change the force vectors (F_udl & F_pl) in line 16 and 17.
clc; clear; close all;

L = 1; % Length in m
E = 2.1*10^8; % Modulus of Elasticity KN/m2
I = 2120/100^4; % Moment of Inertia m4
w = 1000; % Uniformly Distributed Load kN/m
wp = 1000; % Concentrated Load kN

BC = [1 2 5]; % Boundary Condition

F_udl = w*[-L/2;(L^2)/48-(L^2/48);(L^2/48)];
F_pl = wp*[-1;-0.05;0];

Ne = input('Type Number of element or press "Enter" to use default 2 Element ');
if (isempty(Ne))
Ne = 2;
else
end

Ndof = 2*(Ne+1);
Dof = 1:1:Ndof;

le = L/Ne;

% Compute the stiffness matrix for the structure
Kj = zeros(4,4);
Kj(1,1) = 6;
Kj(1,2) = 3*le;
Kj(1,3) = -6;
Kj(1,4) = 3*le;
Kj(2,2) = 2*le^2;
Kj(2,3) = -3*le;
Kj(2,4) = le^2;
Kj(3,3) = 6;
Kj(3,4) = -3*le;
Kj(4,4) = 2*le^2;

for ii = 2:4,
for jj = 1:ii,
Kj(ii,jj) = Kj(jj,ii);
end
end
Ke = (2*E*I/le^3).*Kj;

KG = zeros(Ndof,Ndof);
for ii = 1:Ne
aa = 2*ii-1;
KG(aa:aa+3,aa:aa+3) = KG(aa:aa+3,aa:aa+3)+Ke;
end

K_temp = KG;
for jj = 1:length(BC)
K_temp(:,BC(jj)) = 0;
K_temp(BC(jj),:) = 0;
end
K_temp(~any(K_temp,2),:) = [];
K_temp(:,~any(K_temp,1)) = [];
KR = K_temp;

FR = F_udl+F_pl;

UR = KR\FR;
UG = [0 0 UR(1) UR(2) 0 UR(3)]';
Rc = KG*(UG);

clc
disp('Displacement in mm & rad')
UR = [UR(1)*1000;UR(2);UR(3)];
disp(UR)
disp('Reaction in kN')
Reaction = [Rc(1)+w*L/4; Rc(2)+w*(L/2)^2/12; Rc(5)+w*L/4];
disp(Reaction)

인용 양식

Sajeer Modavan (2024). FEM Beam problem (https://www.mathworks.com/matlabcentral/fileexchange/54257-fem-beam-problem), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Structural Mechanics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0