find the intersection of the four corner and trim the value out of the corner
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mark
am 22 Okt. 2021
Kommentiert: Star Strider
am 22 Okt. 2021
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])
0 Kommentare
Akzeptierte Antwort
Star Strider
am 22 Okt. 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
y1y4 = double(solve(y1 == y4)) % 'y1' 'y4' Intersection
y2y3 = double(solve(y2 == y3)) % 'y1' 'y4' Intersection
y3y4 = double(solve(y3 == y4)) % 'y1' 'y4' Intersection
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Stress and Strain finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!