Stress-strain graph

조회 수: 133 (최근 30일)
Junway
Junway 2021년 2월 9일
편집: Alfred Muchangi 2024년 4월 9일 7:28
I want to make Stress-Strain with linear regression and 0.2% off set graph.
But My code does not show me normal Stress-Strain graph.
I import excel data to matlab. I want to delete First column (start 76) but i cannot deleted.
I want to linear regression from 0 to 593 row data.
can you help me?
AluminumW = readtable("/Users/abc/Downloads/Steel Thursday.TXT");
AluminumW(1:75,:) = [];
AluminumW(593:end,:) = [];
disp = AluminumW(:,2);
force = AluminumW(:,3);
disp1 = table2array(disp);
force1 = table2array(force);
shift1 = disp1 - 0.081994;
shift2 = force1 - 0.11194;
d = 2.54;
r = d/2;
A = pi*r^2;
strain = shift1 / 12.7;
stress = shift2 / A;
figure(1)
plot(strain,stress)
xlabel('Engineering Strain')
ylabel('Engineering Stress (GPa)')
grid on
hold on
x = strain(60) - strain(1);
y = stress(60) - stress(1);
b1 = y / x;
slope = b1*strain;
plot(strain,slope,'g')
hold on
yield = strain + 0.002;
plot(yield,slope,'r')
hold off

답변 (2개)

randerss simil
randerss simil 2021년 2월 9일
편집: randerss simil 2021년 2월 9일
To delete 1st column
AluminumW(1:75,1) = []; % to delete 1st column
  댓글 수: 6
randerss simil
randerss simil 2021년 2월 10일
x = table2array(graph(:,1));
y = table2array(graph(:,2));
p = polyfit(x,y,3); % cubic polynomial fit
yfit = polyval(p,x); % poly evaluation
yres = y-yfit; % residuals
plot(x,y,x(1:50:end),yfit(1:50:end),'o','MarkerSize',2,'MarkerFaceColor','y')
grid
If you want you can plot residuals and determine the regression coefficient R
Junway
Junway 2021년 2월 10일
편집: Walter Roberson 2021년 2월 10일
How can I output like green line? I used excel file.
Two vertical lines are linear regression (Modules) 0.02 offset.
Steel = readtable(~~)
Steel(1480:end,:) = [];
Steel(1:64,:) = [];
Steel(114,:) = [];
disp = Steel(:,2);
force = Steel(:,3);
disp1 = table2array(disp);
force1 = table2array(force);
shift1 = disp1 + 0.088812;
shift2 = force1 - 0.004290;
d = 2.5;
r = d/2;
A = pi*r^2;
strain = shift1 / 14.8;
stress = shift2 / A;
figure(1)
plot(strain,stress)
xlim([-0.01,0.2])
ylim([0,.5])
xlabel('Engineering Strain')
ylabel('Engineering Stress (GPa)')
title('S v e')
grid on
hold on
x = strain(85) - strain(1);
y = stress(85) - stress(1);
b1 = y / x;
slope = b1*strain;
plot(strain,slope,'g')
hold on
yield = strain + 0.002;
plot(yield,slope,'r')
hold off

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


Alfred Muchangi
Alfred Muchangi 2024년 4월 9일 7:26
편집: Alfred Muchangi 2024년 4월 9일 7:28
Could someone please help me with matlab script for plotting stress-strain curve give the following data:Test time, Standard force, Standard travel, Strain, Nominal strain

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by