find the intersection of the four corner and trim the value out of the corner

2 ビュー (過去 30 日間)
Mark
Mark 2021 年 10 月 22 日
コメント済み: Star Strider 2021 年 10 月 22 日
I have used the four lines to plot the figure below. I would like to know how to find the intersection and trim the value out of the corner. Please see my code below
clc
clear
grid on
syms stress1 stress2 shear12
SL_Ts=1800;
SL_Cm=1400;
ST_Ts=40;
ST_Cm=230;
SLT=100;
y1=((stress1-SL_Ts)/0.3);
y2=0.01875*stress1+ST_Ts;
y3=((stress1+SL_Cm)/0.3);
y4=0.01875*stress1-ST_Cm;
figure(1)
hold on
fplot(y1,[1700,1900],'b','LineWidth',1.5)
fplot(y2,[-1500,1900],'b','LineWidth',1.5)
fplot(y3,[-1500,-1200],'b','LineWidth',1.5)
fplot(y4,[-1500,1900],'b','LineWidth',1.5)
ylim([-400 200])
xlim([-2000 3800])

採用された回答

Star Strider
Star Strider 2021 年 10 月 22 日
Solve for the intersections, then plot to those limits —
grid on
syms stress1 stress2 shear12
SL_Ts=1800;
SL_Cm=1400;
ST_Ts=40;
ST_Cm=230;
SLT=100;
y1=((stress1-SL_Ts)/0.3);
y2=0.01875*stress1+ST_Ts;
y3=((stress1+SL_Cm)/0.3);
y4=0.01875*stress1-ST_Cm;
y1y2 = double(solve(y1 == y2)) % 'y1' 'y2' Intersection
y1y2 = 1.8223e+03
y1y4 = double(solve(y1 == y4)) % 'y1' 'y4' Intersection
y1y4 = 1.7408e+03
y2y3 = double(solve(y2 == y3)) % 'y1' 'y4' Intersection
y2y3 = -1.3959e+03
y3y4 = double(solve(y3 == y4)) % 'y1' 'y4' Intersection
y3y4 = -1.4773e+03
figure(1)
hold on
fplot(y1,[y1y4 y1y2],'b','LineWidth',1.5)
fplot(y2,[y2y3,y1y2],'b','LineWidth',1.5)
fplot(y3,[y3y4,y2y3],'b','LineWidth',1.5)
fplot(y4,[y3y4,y1y4],'b','LineWidth',1.5)
ylim([-400 200])
xlim([-2000 3800])
Success!
.
  2 件のコメント
Mark
Mark 2021 年 10 月 22 日
Thanks a lot! Your way is really useful!
Star Strider
Star Strider 2021 年 10 月 22 日
As always, my pleasure!
Thank you!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by