Plotting deflection of beam using macaulay functions

50 views (last 30 days)
I am trying to plot the deflection of a beam under bending forces. My understanding is to use the heaviside function but i am having trouble plotting these points. An example of this function would be: slope=(1/(E*I))*(146.5*<x>^2+315<x-0.12>^2-70.24*,x.^3)
  3 Comments
Benjamin
Benjamin on 30 Jul 2024
This code does not allow for the macaulay function to be considered, I managed to plot my shear force and bending moment diagrams fine but not the deflection and slope diagrams. What I plan to do is derive equations for each section of the beam on the same set if axes so the macaula functions wont be needed however to plot this in one plot function would be way preffered.
Umar
Umar on 30 Jul 2024
@Benjamin, if you still have any further questions, please let me know.

Sign in to comment.

Answers (1)

William Rose
William Rose on 18 Aug 2024
You wrote:
"An example of this function would be: slope=(1/(E*I))*(146.5*<x>^2+315<x-0.12>^2-70.24*,x.^3)"
I interpret that to mean
I am not sure where you want to apply the heaviside function, and I do not know the range for x.
Example: A beam of length 1 is supported at x=0, x=0.4, and x=1. The deflection is given by
y=(x-0.2)^2-0.04 for x=0 to 0.4
and by
y=2*(x-0.7)^2-0.09 for x=0.4 to 1.0.
Plot the deflection (y) versus position (x), the easy way, and using heaviside functions.
Easy way:
x1=0:.01:.4;
y1=(x1-0.2).^2-0.04;
x2=0.4:0.01:1.0;
y2=(x2-0.7).^2-0.09;
figure;
subplot(211), plot(x1,y1,'-r.',x2,y2,'-b.'); xlabel('x'); ylabel('y'); grid on
Heaviside way:
x=0:.01:1;
y=heaviside(0.4-x).*((x-0.2).^2-0.04)+heaviside(x-0.4).*((x-0.7).^2-0.09);
subplot(212); plot(x,y,'-g.'); xlabel('x'); ylabel('y'); grid on
Good luck.
  1 Comment
William Rose
William Rose on 18 Aug 2024
The basic idea for using heaviside functions is:
Suppose for , and for .
Then we can write a single function for y(x) using the heaviside function, h():
which we implement in matlab with
y=fR(x).*heaviside(xc-x)+fL(x).*heaviside(x-xc);
where x is a vector covering the full range of x.
If y has three functions, which apply in three different regions, then proceed as above, and use two heaviside functions in the middle region, to turn on and turn off the middle function at the appropriate values of x.
For example, if is the active function from , and fL and fR apply on the left and right sides, then multiply by two heaviside functions:
y=fR(x).*heaviside(xc1-x)+...
fmid(x).*heaviside(x-xc1).*heaviside(xc2-x)+...
fL(x).*heaviside(x-xc2);
Good luck.

Sign in to comment.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!