Dificulty plotting graph of function for basic bending moment graph

Have been having issues making a system that creates bending moment graphs,
The graph appears to be the correct shape, but i cannot figure out, how to only plot the graph from 0 to the beam lengh
clc
%bending moments calculator
syms X
%force 1
F1=50
F1 = 50
%total beam lengh
LT=4
LT = 4
%f1 distaance from left support (b)
L1=1
L1 = 1
%reactions right support (a)
REND= (L1*F1)/LT
REND = 12.5000
%reactions at left support (c)
RST= ((LT-L1)*F1)/LT
RST = 37.5000
%FROM A TO B
M1=RST*X
M1 = 
%FROM B TO C
M2=RST*X-F1*(X-(L1))
M2 = 
fplot(M1)
hold on
fplot(M2)
hold off

 Accepted Answer

Use the second argument to fplot to limit the independent variable range —
%bending moments calculator
syms X
%force 1
F1=50
F1 = 50
%total beam lengh
LT=4
LT = 4
%f1 distaance from left support (b)
L1=1
L1 = 1
%reactions right support (a)
REND= (L1*F1)/LT
REND = 12.5000
%reactions at left support (c)
RST= ((LT-L1)*F1)/LT
RST = 37.5000
%FROM A TO B
M1=RST*X
M1 = 
%FROM B TO C
M2=RST*X-F1*(X-(L1))
M2 = 
figure
fplot(M1,[0 LT])
hold on
fplot(M2,[0 LT])
hold off
.

More Answers (0)

Categories

Find more on Graphics Objects 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!