How do I add a flat line on the z-axis?
4 views (last 30 days)
Show older comments
I figured out how to code my function, but I am being asked to add the ultimate stress alongside my graph, which would be a flat line on the z axis at Z=40. I tried doing this the same way as a flat line would be added on the y axis (yline[ ]), but it does not work. Any assistance is greatly appreciated. Thank you!
Here is my code:
[x,y]=meshgrid(0:0.0001:0.004,-pi/4:0.1:pi/4)
c=cos(y).*sqrt(pi.*x)
d=cos(y).^2
e=sin(y).^2
KI2=0.78^2
KII2=1.47^2
f=(d/KI2)+(e/KII2)
g=sqrt(f)
h=c.*g
z=1./h
surf(z)
xlabel("Crack Size (a)")
ylabel("Angle (b)")
zlabel("Critical Stress")
title("Failure Envelope Surface")
0 Comments
Accepted Answer
Voss
on 5 Mar 2023
[x,y]=meshgrid(0:0.0001:0.004,-pi/4:0.1:pi/4);
c=cos(y).*sqrt(pi.*x);
d=cos(y).^2;
e=sin(y).^2;
KI2=0.78^2;
KII2=1.47^2;
f=(d/KI2)+(e/KII2);
g=sqrt(f);
h=c.*g;
z=1./h;
surf(z)
xlabel("Crack Size (a)")
ylabel("Angle (b)")
zlabel("Critical Stress")
title("Failure Envelope Surface")
hold on
surf(40*ones(size(z)),'FaceColor','r','FaceAlpha',0.3,'EdgeColor','none')
0 Comments
More Answers (0)
See Also
Categories
Find more on Stress and Strain in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!