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

21 views (last 30 days)

Show older comments

Pappu Murthy
on 20 Jan 2022

Commented: Pappu Murthy
on 24 Jan 2022

### Accepted Answer

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

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!