How to find inflection point of a curve

83 ビュー (過去 30 日間)
harith larabi
harith larabi 2022 年 10 月 4 日
コメント済み: Star Strider 2022 年 10 月 6 日
Hello guys.
I am looking for some information.
Maybe you can help me ?
I need to find the inflection point of a curve.
I know that I can use the second derivative or use the tangent but I don't know how to applicate or calculte it in matlab ?
Here you'll fin the curve
it represent the transition from elastic to plastic domain.
Thank you.
Regards
Harith

採用された回答

Star Strider
Star Strider 2022 年 10 月 4 日
編集済み: Star Strider 2022 年 10 月 4 日
First, use the sgolayfilt function to eliminiate as much of the noise as possible, since taking the derivative will amplify it. The use the gradient function to calculate the numerical derivative, for example:
framelen = 101;
ys = sgolayfilt(y, 3, framelen);
dydx = gradient(ys) ./ gradient(x);
Choose the appropriate value for ‘framelen’ to get the desired result.
EDIT — (4 Oct 2022 at 20:40)
Example —
x = linspace(0.9,1.8, 250); % Create Data
y = exp(-(x-1.3).^2*50)/8 + x +0.005*randn(size(x)); % Create Data
% figure
% plot(x, y)
% grid
ydt = detrend(y,1); % Detrend 'y' To Facilitate Analysis
framelen = 101; % Choose Appropriate Value
ydts = sgolayfilt(ydt, 3, framelen); % Denoise Signal
dydx = gradient(ydts) ./ gradient(x); % Calculate Numerical Derivative
[maxdydx,idxmax] = max(dydx); % Interpolation Index Lower Limit
[mindydx,idxmin] = min(dydx); % Interpolation Index Upper Limit
idxrng = idxmax : idxmin;
inflptx = interp1(dydx(idxrng), x(idxrng), 0) % Find Inflection Point X-Value
inflptx = 1.3014
inflpty = interp1(x, y, inflptx) % Find Inflection Point Y-Value
inflpty = 1.4191
figure
plot(x, y, 'DisplayName','Data')
hold on
plot(inflptx, inflpty, '+r', 'MarkerSize',10, 'DisplayName','Inflection Point')
hold off
grid
xlabel('X')
ylabel('Y')
legend('Location','best')
.
  8 件のコメント
harith larabi
harith larabi 2022 年 10 月 6 日
編集済み: harith larabi 2022 年 10 月 6 日
Thank you for these really clear answer.
Now it's time for me to find a way, other than matlab to find this point, in Excel for example.
The point of inflection that we found is in my case is the transition from elastic to plastic domain of a material called (RP0.2)
Was a pleasure to talk with you, learned a lot from.
Thank you,
Harith
Star Strider
Star Strider 2022 年 10 月 6 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by