find the intersection of the four corner and trim the value out of the corner
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Stress and Strain에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!