Filter löschen
Filter löschen

I have no idea what to do

1 Ansicht (letzte 30 Tage)
정연
정연 am 8 Nov. 2023
Beantwortet: Mann Baidi am 8 Nov. 2023
I would like to change this code as shown in the following image. I've drawn it up to this point, but what should I do with the details?
Sig_x = 3
Sig_y = 0
Tau_xy = 2
% R:Radius of a Circle ==================
R = sqrt((Sig_x- Sig_y)^2/4+Tau_xy^2);
% Center of the Mohr's Stress Circle ====
Sig_xc =(Sig_x+ Sig_y)/2
Sig_yc = 0
Theta = atand(Tau_xy/(Sig_x-Sig_xc))/2
% Principal stresses ====================
Sig_1 = Sig_xc + R
Sig_2 = Sig_xc - R
% Max shear stress ======================
Tau_max = R
%===== Making Mohr's Circle =============
x=-pi:pi/180:pi;
x1 = R*cos(x)+Sig_xc;
y1 = R*sin(x)+Sig_yc;
plot(x1,y1)
title('Make a Mohr stress Circle with R')
xlabel('Normal stresses \sigma')
ylabel('Shear stress \tau')
grid on
axis ([Sig_xc-R, Sig_xc+R, -2-R, 2+R])
axis equal, hold on
% =========================================
plot([0 0], [-2-R, 2+R]) % y-축
plot([Sig_xc-2*R Sig_xc+2*R], [0 0]) % x-축
%=========================================

Antworten (1)

Mann Baidi
Mann Baidi am 8 Nov. 2023
Hi,
I understand that you would like to add figures and text over the plot.
For adding symbols or text on a figure, you can use the "text" function in MATLAB.
You can customize the text and symbols by referring to the following link.
For marking the specific points in the graph, you can add the following code to your script
plot(0,0,"ro","MarkerFaceColor","red","MarkerSize",4)
And lastly, for adding the square in your graph, you can add the following code in the graph.
hold on
rectangle('Position',[4 -4 2 2]) % the first two values are the position of the bottom left corner followed by length and width
Here is a modified version of your code
Sig_x = 3
Sig_x = 3
Sig_y = 0
Sig_y = 0
Tau_xy = 2
Tau_xy = 2
% R:Radius of a Circle ==================
R = sqrt((Sig_x- Sig_y)^2/4+Tau_xy^2);
% Center of the Mohr's Stress Circle ====
Sig_xc =(Sig_x+ Sig_y)/2
Sig_xc = 1.5000
Sig_yc = 0
Sig_yc = 0
Theta = atand(Tau_xy/(Sig_x-Sig_xc))/2
Theta = 26.5651
% Principal stresses ====================
Sig_1 = Sig_xc + R
Sig_1 = 4
Sig_2 = Sig_xc - R
Sig_2 = -1
% Max shear stress ======================
Tau_max = R
Tau_max = 2.5000
%===== Making Mohr's Circle =============
x=-pi:pi/180:pi;
x1 = R*cos(x)+Sig_xc;
y1 = R*sin(x)+Sig_yc;
plot(x1,y1)
hold on
plot(0,0,"ro","MarkerFaceColor","red","MarkerSize",4)
text(0.2,0,"Origin")
title('Make a Mohr stress Circle with R')
xlabel('Normal stresses \sigma')
ylabel('Shear stress \tau')
grid on
axis ([Sig_xc-R, Sig_xc+R, -2-R, 2+R])
axis equal,
hold on
% =========================================
plot([0 0], [-2-R, 2+R]) % y-축
plot([Sig_xc-2*R Sig_xc+2*R], [0 0]) % x-축
%=========================================
hold on
rectangle('Position',[4 -4 2 2])
Hope this will help in resolving your query!

Kategorien

Mehr zu Stress and Strain finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by