필터 지우기
필터 지우기

(Strain vs Stress Curve) to (Stress Vs Strain Curve) Switch My X-axis into Y-axis in my plot

조회 수: 7 (최근 30일)
I plotted a strain- stress curve graph however, in physical materials studies stress(y-axis)-strain(x-axis) curve is the convention in plotting. I have tried to change the graph axis but to just recive a blank plot. I have tried everything but to no avail. What am I doing wrong?
clc
clear all
close all
E1=4000; %4GPa written in 4000 MPa
E2=5000; %5GPa written in 5000 MPa
Mu= 1.2*10^5; %this measures creep
stress0.norm = 800; %this is initial stress value is in MPa
for i=1:stress0.norm
strain.normal(i)=i/E1; % This is storing the values before yielding
end
for i=stress0.norm:1500 %this is the finising stress in MPa (after yielding
strain.normal(i)=(i/E1)+((i-stress0.norm)/E2); % This is storing the values after yielding
end
% The graph with what I started off
figure ('Name', 'Linear Hardening Model', 'NumberTitle', 'off')
plot (strain.normal,'b');
hold on
plot (800,.2, 'rx', 'LineWidth', 2);
% plot (strain.normal,'b');
title ('Linear Hardening Model E2 +/- 10%');
xticks(0:100:1500);
xlabel('stress(in MPa)');
ylabel('strain');
grid on
legend('Normal','Yielding Location','Location','NorthEast')
% What I wanted to achieve but get a blank graph
figure ('Name', 'Linear Hardening Models Issue ', 'NumberTitle', 'off')
plot (strain.normal,length(strain.normal),'b');
hold on
plot (.2,800,'rx', 'LineWidth', 2);
title ('Linear Hardening Model');
axis ([0 0.6 0 1500])
yticks(0:100:1500);
xticks
xlabel('strain');
ylabel('stress(in MPa)');
grid on
legend('Normal','Yielding Location','Location','NorthEast')

채택된 답변

Tommy
Tommy 2020년 4월 15일
plot (strain.normal,length(strain.normal),'b');
In this line,
length(strain.normal)
is a scalar, so nothing is plotted, similar to
figure;plot(1:10,1)
Use this instead:
plot (strain.normal,1:length(strain.normal),'b');
  댓글 수: 2
Pablo Tejada Jr.
Pablo Tejada Jr. 2020년 4월 15일
Wow this fixed the issue. Thank you so much Tommy for your time, I am truly grateful. I wanted to ask you a question:
  • wouldn't "1:length(strain.normal)" also be considered scalar?
  • what makes
length(strain.normal)
different to
1:length(strain.normal)
I ask you this becuase I would love to understand this concept. Thank you in advance for helping me become a better Engineer.
Tommy
Tommy 2020년 4월 15일
My pleasure!
It's the same as the difference between
>> 10
ans =
10
and
>> 1:10
ans =
1 2 3 4 5 6 7 8 9 10
The former is a scalar (size 1x1), the latter is a vector (size 1x10).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by