Need to find "Knees" in Stress Strain curves where slope change abruptly

21 views (last 30 days)
I have stress strain curve which is basically peicewise linear. I need to find everytime there is a sudden change in the slope, the point at which it occurs and the corresponding magnitude. If it were a true local maximum, I can use some tool like "peakFinder" and get the information. But nto all are true peaks but some of them are slope changes. How do I find those. I am attaching a picture here. Thanks in advance.
  7 Comments
Pappu Murthy
Pappu Murthy on 21 Jan 2022
Attached text file contains the data. First column is Strain and Second column is Stress. If you plot them you will see a picture like the one attached earlier.

Sign in to comment.

Accepted Answer

Mathieu NOE
Mathieu NOE on 21 Jan 2022
hello
this would be my first suggestion
of course the results may be sensitive to the threshold used in my method (based on the area of a triangle made of 3successive points => we are looking at the points where the triangle hasan area above a given threshold , meaning the two successive segments have a certain angle)
clc
clearvars
data = readmatrix('Test.txt'); % First column is Strain and Second column is Stress
Strain = data(:,1);
Stress = data(:,2);
[A,curv] = compute_curv(Strain,Stress);
% ind = find(curv>1e-5);
ind = find(A>8e-4);
% remove first and last indices which are obviously not to keep
ind = ind(2:end-1);
figure(1)
plot(Strain,Stress,'-+',Strain(ind),Stress(ind),'dr');
function [A,curvature] = compute_curv(x,y)
% run along the curve and find the radius of curvature at each location.
numberOfPoints = length(x);
curvature = zeros(1, numberOfPoints);
for t = 1 : numberOfPoints
if t == 1
index1 = numberOfPoints;
index2 = t;
index3 = t + 1;
elseif t >= numberOfPoints
index1 = t-1;
index2 = t;
index3 = 1;
else
index1 = t-1;
index2 = t;
index3 = t + 1;
end
% Get the 3 points.
x1 = x(index1);
y1 = y(index1);
x2 = x(index2);
y2 = y(index2);
x3 = x(index3);
y3 = y(index3);
a = sqrt((x1-x2)^2+(y1-y2)^2); % The three sides
b = sqrt((x2-x3)^2+(y2-y3)^2);
c = sqrt((x3-x1)^2+(y3-y1)^2);
A(t) = 1/2*abs((x1-x2)*(y3-y2)-(y1-y2)*(x3-x2)); % Area of triangle
curvature(t) = 4*A(t)/(a*b*c); % Curvature of circumscribing circle
end
end
  3 Comments
Pappu Murthy
Pappu Murthy on 24 Jan 2022
Thanks for the clarification. I thought so as well. Also, I realized there is a "polyarea" function available with in the Matlab and one can use that to compute area of triangles instead of going through the actual process of finding sides etc. But if you need "curv" as well then your approach is the best. Again thanks for all the help. I have learnt some useful tricks.

Sign in to comment.

More Answers (0)

Categories

Find more on Stress and Strain in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!