Professional Documents
Culture Documents
% Length of The Bar % Young Modulus of The Bar: For If
% Length of The Bar % Young Modulus of The Bar: For If
It is subjected to a
body force x per unit length. Calculate the free end deflection of the bar.
Fig
A bar element is shown in fig which is fixed at both side
Initial condition
u(0)=0
u(L)=0
by using the governing equation
clc
clear all
L = 2; % length of the bar
E = 2; % young modulus of the bar
nelem = 8;
nnod = 1+nelem;
k = zeros(nnod-2,nnod-2);
for i =1:nnod-2
k(i,i)=2
if i<nnod-2
k(i,i+1)=1
k(i+1,i)=1
end
end
deltax=L/nnod
A=1;
E=2;
b=1
f=zeros(1,nnod-2)
for j=1:nnod-2
f(1,j)=(b/(A*E))*deltax^2*(0.5*j)
end
k
f
t=inv(k)
u=f*t
U=max(u)
Question -2
A one-dimensional bar is fixed at one end and free at the other. It is subjected to a
body force x per unit length. Calculate the free end deflection of the bar.
The initial condition is given by
1. u(0)=0
2. d(u)/dxat L=0
deltax=L/nnod
A=1;
E=2;
b=1
f=zeros(1,3);
f(1,1)=(b/(A*E))*deltax^2-0.5;
f(1,2)=(b/(A*E))*deltax^2;
f(1,3)=(b/(A*E))*deltax^2+0.5;
k
f
t=inv(k)
u=f*t
U=u(1,3)