Having Issues Plotting a Yield Strength Line with 0.20% Offset

104 ビュー (過去 30 日間)
Logan Parrish
Logan Parrish 2022 年 2 月 2 日
編集済み: VBBV 2022 年 2 月 3 日
I am trying to plot a Stress - Strain curve for a material and I am running into trouble when trying to plot my offset yield line. I am trying to plot a line that is sat 0.2% to the right of the main function, this line needs to have the same slope as the main function does in a certain region. I am having issues trying to get the offset line to be imposed onto the same plot as my original function yet the offset line just replaces the previous curve. Here is the code for this plot and below is an example of what the graph would look like with the offset yeild strength line:
% Import data
load = [0 1221 2479 3667 4903 6138 7356 8596 9783 11050 12247 13434 ...
14690 14744 15119 15710 16032 16295 16456 16585 16601 16601 16489 16489]; % lbs
delta = [0 0.0012 0.0024 0.0035 0.0048 0.0060 0.0072 0.0085 0.0096 0.0110 ...
0.0122 0.0134 0.0149 0.0150 0.0159 0.0202 0.0288 0.0581 0.0895 0.1214 ...
0.1496 0.1817 0.2278 0.2605]; % inches
diameter = 0.500; % in
length_o = 2.0; % in
stress = load ./ (pi/4*diameter^2); % Calculate the stress in the bar
strain = delta ./ length_o; % Calculate the strain
sig = stress; % save stress and strain as sigma and episilon
ep = strain;
plot(ep,sig) % Plot Stress - Strain Curve
xlabel('Strain')
ylabel('Stress')
hold on
plot(ep(24),sig(24),'ro') % Mark the fracture point on the plot
text(strain(24),stress(24),['Fracture: ', num2str(stress(24))])
E = ((sig(13)-sig(1))/(ep(13)-ep(1))); %psi
prop_lim = sig(13)/((pi/4*diameter^2)); %psi
stress_fract = stress(24); %psi
ult = sig(20); % Identify the Ultimate Strength of the Material
plot(ep(20),ult,'r*')
text(ep(20),sig(20),['Ultimate Strength: ', num2str(sig(20))])
yield_strength = E * ep; % Define the yield strength of the material
Any help would be greatly appreciated!

採用された回答

VBBV
VBBV 2022 年 2 月 3 日
編集済み: VBBV 2022 年 2 月 3 日
load = [0 1221 2479 3667 4903 6138 7356 8596 9783 11050 12247 13434 ...
14690 14744 15119 15710 16032 16295 16456 16585 16601 16601 16489 16489]; % lbs
delta = [0 0.0012 0.0024 0.0035 0.0048 0.0060 0.0072 0.0085 0.0096 0.0110 ...
0.0122 0.0134 0.0149 0.0150 0.0159 0.0202 0.0288 0.0581 0.0895 0.1214 ...
0.1496 0.1817 0.2278 0.2605]; % inches
diameter = 0.500; % in
length_o = 2.0; % in
stress = load ./ (pi/4*diameter^2); % Calculate the stress in the bar
strain = delta ./ length_o % Calculate the strain
strain = 1×24
0 0.0006 0.0012 0.0018 0.0024 0.0030 0.0036 0.0043 0.0048 0.0055 0.0061 0.0067 0.0075 0.0075 0.0080 0.0101 0.0144 0.0290 0.0447 0.0607 0.0748 0.0909 0.1139 0.1303
sig = stress; % save stress and strain as sigma and episilon
ep = strain;
plot(ep,sig,'linewidth',1.5) % Plot Stress - Strain Curve
xlabel('Strain')
ylabel('Stress')
hold all
plot(ep(24),sig(24),'ro') % Mark the fracture point on the plot
text(strain(24),stress(24),['Fracture: ', num2str(stress(24))])
E = ((sig(13)-sig(1))/(ep(13)-ep(1))); %psi
prop_lim = sig(13)/((pi/4*diameter^2)); %psi
stress_fract = stress(24); %psi
ult = sig(20); % Identify the Ultimate Strength of the Material
plot(ep(20),ult,'r*')
text(ep(20),sig(20),['UTS: ', num2str(sig(20))])
% ep = ep(ep<0.002)
yield_strength = E*ep % Define the yield strength of the material
yield_strength = 1×24
1.0e+06 * 0 0.0060 0.0121 0.0176 0.0241 0.0301 0.0362 0.0427 0.0482 0.0552 0.0613 0.0673 0.0748 0.0753 0.0798 0.1014 0.1446 0.2917 0.4494 0.6096 0.7512 0.9123 1.1438 1.3080
plot(ep+0.002,yield_strength,'r--','linewidth',1.5)
axis([0 0.14 0 0.95e5])
legend('Stress-strain','Fracture','UTS','0.2% offset yield line','location','southeast')
specify the offset and plot it as above

その他の回答 (1 件)

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 2 日
Using hold is the right approach. I do not think I see a plot command that attempts to plot the dashed line. Here is one possible approach, using ginput to pull of the line endpoints manually. In general you want to add a "hold off" at the end of a plotting script so the figure is back to its original state for plotting.
>> [x, y] = ginput(2)
x =
0.0018
0.0098
y =
1.0e+04 *
0.1181
7.5437
>> plot(x, y, 'r--');

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by