# Cantilever Beam Deflection problem

29 views (last 30 days)
JJ on 3 May 2021
Edited: VBBV on 3 May 2021
Hi,
I'm struggling to write a code for the deflection of a cantilever beam using nodes. I want to draw the outline of the beam and show its original shape and the deflected shape over it using nodes. I currently have this code for the basic deflection, but I am having a hard time understanding how I can use this to show the deflection in a more realistic, 2D manner, using nodes. I'm starting over as my previous work was getting messy and convoluted. Any help is really appreciated, just really struggling to get my head around this.
clc
clear
close all
E = 200e9; % Modulus of Elasticity (N/m^2)
b = 50; % beam cross section width
l = 150; % beam cross section height
I = (l*(b.^3))/12 % Second moment of area
x = [0:0.05:1]; % from 0 to max length of 1m
y= 1e6*(((55*x.^3)/3)-((52.25*x.^2)/2))/(E*I); % Equation for deflection, force = 55kN at 0.95m
plot(x,y);
grid on;

VBBV on 3 May 2021
Edited: VBBV on 3 May 2021
% drawing beam shape
x = [0 1 1 0];
y = [3 3 4.5 4.5];
patch(x,y,'b','FaceColor','blue','FaceAlpha',.1,'EdgeColor','none');axis([0 1 2 10]); hold on;% computing deflection along length
E= 200e9;
b = 50; l = 150; % assume this in mm
I = 1e-12*(l*b^3)/12; % converson factor
xx = linspace(0,1,10);
yy = 1e6*(((55*xx.^3)/3)-((52.25*xx.^2)/2))/(E*I);
plot(xx,yy,'-r') % in microns ;
xlabel('length of beam [m]');ylabel('Beam deflection : \mum/m (micron)')
axis([0 1 -30 10])
yy = yy*1e-6;
x1 = [linspace(0,0.47,5) linspace(0.5,1,5) linspace(01,0.5,5) linspace(0.47,0,5)];
y1 = [3+yy(1) 3+yy(2) 3+yy(3) 3+yy(4) 3+yy(5) 3+yy(6) 3+yy(7) 3+yy(8) 3+yy(9) 3+yy(10) ...
4.5+yy(1) 4.5+yy(2) 4.5+yy(3) 4.5+yy(4) 4.5+yy(5) 4.5+yy(6) 4.5+yy(7) 4.5+yy(8) 4.5+yy(9) 4.5+yy(10)];
hold on; plot(x1,y1,'--r','linewidth',1)
Read patch function to plot beam and overlay the deflection values
JJ on 3 May 2021
Something like this is my goal... I'm thinking of when you do FEA in solidworks and you have a scale of deflection like an exploded view so you can see the deflection even if it's very small. Is this possible?