필터 지우기
필터 지우기

I have no idea what to do

조회 수: 2 (최근 30일)
정연
정연 2023년 11월 8일
답변: Mann Baidi 2023년 11월 8일
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-축
%=========================================

답변 (1개)

Mann Baidi
Mann Baidi 2023년 11월 8일
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!

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by