You are on page 1of 3

Question 1:-A one-dimensional bar is fixed at both the ends.

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

The finite code is given here

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)

Answer =The maximum displacement is 0.0432

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

The finite difference code on matlab is given by


clc
clear all
L = 2; % length of the bar
E = 2; % young modulus of the bar
nelem = 4;
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,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)

Answer :-The deflection at the free end is 0.2900.

You might also like