Curve fitting of growing measurement data set
1 回表示 (過去 30 日間)
古いコメントを表示
I follow fatigue tests live and record measurement data at defined time intervals. In the end, there is always a curve that can be divided into three areas. See in the picture.
For the various tests, they only differ in terms of the total service life and the gradient in the middle range.
Problem: The complete measurement data can be fitted reasonably well
with a 6th degree polynomial, but this does not work with an incomplete data set.
My question now is: how can I smooth / fit the values during the measurement data acquisition with the boundary condition that a curve of this shape comes out at the end?
0 件のコメント
採用された回答
その他の回答 (1 件)
Mathieu NOE
2021 年 4 月 22 日
hello
this little code snipset in case it fills your needs
% dummy data
n = 200;
x = 1:n;
y = 1-exp(-x/5);
yf = -fliplr(y)+1;
y = y + yf + 0.0025*x + 0.1 * randn(1,n);
figure(1);
plot(x,y);
hold on
% animated plot simulating data acquisition + smoothing (by polynomial fit)
%// initiallize plot. Get a handle to graphic object
p1 = plot(0,0,'b',0,0,'dr');
title('Data Acquisition')
xlabel('Strain');
ylabel('Force');
axis([0 n 0 3]);%// freeze axes to their final size, to prevent Matlab from rescaling them dynamically
x_acq = []; % init
y_acq = []; % init
for ci = 1:n
% simulate data acquisition and buffer fill
x_acq = [x_acq x(ci)];
y_acq = [y_acq y(ci)];
% poly fit
p = polyfit(x_acq,y_acq,6);
yf = polyval(p,x_acq);
% update the plot
pause(0.05)
set(p1, 'XData', x_acq, 'YData', yf );
end
hold off
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fit Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!