Setting up a Deflection Plot

50 views (last 30 days)
Robert Staruch
Robert Staruch on 23 Oct 2020
Commented: Robert Staruch on 26 Oct 2020
Hello
I am tryinng to calculate the amount of force for a deflection of a cantilever beam of known dimensions. I would like to plot the required forces calculated onto a line graph with Force on the Y axis, and Deflection in mm on the X Axis.
I have labelled each deflection, that i set, as deflectiona, deflectionb, deflectionc etc. I wanted to plot these against the output force on one graph. To demonnstrate how the force would change with deflection.
The script used to calculate the force vs deflections currently is:
% reference to variables can be found here
%https://www.quora.com/What-is-the-formula-of-a-deflection-cantilever-beam-point-load-at-mid-span
r = 0.005 ; % [m] radius of bar
P = 0.4; % [m] load applied on the beam
l = 0.012 ; % [m] lenght of beam
a = 0.008 ; % [m] position of load on beam (note l=a for load at tip)
E = 2.24e6; % [Pa] youngs modulas in Pa
I = pi*r^4/4; % [m^4] second moment of area
w = 0; % [N/m] uniformally distributed load (note w=0 for no loading);
delta_point_load = P*a^2*(3*l-a)/(6*E*I);
delta_UDL = w*l^4/(8*E*I);
total_delta = delta_point_load + delta_UDL; % Note that loads can be added together as the system is linear
fprintf('deflection from point load = %.16f mm\r',delta_point_load*1000)
fprintf('deflection from uniformly distributed load = %.16f mm\r',delta_UDL*1000)
fprintf('Total deflection = %.16f [mm] \r',total_delta*1000);
deflectiona = 0.002; %m
load_for_deflection = deflection* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflection,load_for_deflection)
deflectionb = 0.001; %m
load_for_deflection = deflection* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflection,load_for_deflection)
deflectionc = 0.0005; %m
load_for_deflection = deflection* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflection,load_for_deflection)
Can anyone help?
  1 Comment
Robert Staruch
Robert Staruch on 26 Oct 2020
This is great, thanks for this. Can one have the plots populate with the relevant appropriate units in force. I.e for values of 0.00018 the plot would populate in Micronewtons (uN) rather than newtons?
Would i just copy the code in order to get multiple different cantilever configurations to appear as seperate curves on the same plot?
Or would I need to attach the radius and length of the bars etc as seperate specifications for each calculation that could then be recalled for a plot? (i.e name area , area 1, area2, etc)

Sign in to comment.

Accepted Answer

VBBV
VBBV on 23 Oct 2020
Try this, the way to plot F vs deflection
clearvars
clc
r = 0.005 ; % [m] radius of bar
P = 0.4; % [m] load applied on the beam
l = 0.012 ; % [m] lenght of beam
a = 0.008 ; % [m] position of load on beam (note l=a for load at tip)
E = 2.24e6; % [Pa] youngs modulas in Pa
I = pi*r^4/4; % [m^4] second moment of area
w = 0; % [N/m] uniformally distributed load (note w=0 for no loading);
delta_point_load = P*a^2*(3*l-a)/(6*E*I);
delta_UDL = w*l^4/(8*E*I);
total_delta = delta_point_load + delta_UDL; % Note that loads can be added together as the system is linear
fprintf('deflection from point load = %.16f mm\r',delta_point_load*1000)
fprintf('deflection from uniformly distributed load = %.16f mm\r',delta_UDL*1000)
fprintf('Total deflection = %.16f [mm] \r',total_delta*1000);
deflectiona = 0.002; %m
load_for_deflection1 = deflectiona* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflectiona,load_for_deflection1)
deflectionb = 0.001; %m
load_for_deflection2 = deflectionb* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflectionb,load_for_deflection2)
deflectionc = 0.0005; %m
load_for_deflection3 = deflectionc* P/total_delta;
fprintf('Load for deflection of %f m = %f N\r',deflectionc,load_for_deflection3)
Force = [load_for_deflection1 load_for_deflection2 load_for_deflection3];
def = [deflectiona deflectionb deflectionc]
plot(def*1000,Force); xlabel('Deflection [mm]');ylabel('Force');grid

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!