How to find inflection point of a curve
83 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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
inflpty = interp1(x, y, inflptx) % Find Inflection Point Y-Value
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 件のコメント
Star Strider
2022 年 10 月 6 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!