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

2 views (last 30 days)
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])

Accepted Answer

Star Strider
Star Strider on 22 Oct 2021
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!
.

More Answers (0)

Categories

Find more on Stress and Strain in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!