find the intersection of the four corner and trim the value out of the corner
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Star Strider
le 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
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Stress and Strain dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!