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

 Respuesta aceptada

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
.

2 comentarios

Many thanks, this helped loads
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 4 de Oct. de 2023

Comentada:

el 4 de Oct. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by