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

 採用された回答

Star Strider
Star Strider 2023 年 10 月 4 日
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 件のコメント

james
james 2023 年 10 月 4 日
Many thanks, this helped loads
Star Strider
Star Strider 2023 年 10 月 4 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2023 年 10 月 4 日

コメント済み:

2023 年 10 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by