Azzera filtri
Azzera filtri

Averaging Hysteresis Data - how to do it?

18 visualizzazioni (ultimi 30 giorni)
Hi All,
below damper Force Vs Velocity for a typical 2-way adjustment damper is shown and as expected a typical hysteresis shape is obtained. We could imagine the data as the sum of 2 curves: one curve is given when the velocity goes from NEGATIVE to POSITIVE and the other is obtained when the velocity goes from POSITIVE to NEGATIVE
I want to use this damper data on my vehicle dynamics model and in order to speed up the processing time (as there are 4 dampers) I would like to extrapolate a curve with the following features
  • Only one line
  • This line should pass the middle of the two curves (a sort of average, an ideal damper with no hysteresis)
I would appreciate some suggestions on how to tackle this problem. how would you do that?
Many thanks for you help
(DATA attached)
Thanks in advance
G

Risposta accettata

Mischa Kim
Mischa Kim il 4 Gen 2014
Hello Guiseppe, try to use curve fitting. In MATLAB, go to the Apps tab and find the Curve Fitting app (in the math, statistics and optimization folder). Select as X and Y data Velocity and Force, respectively. Smooth Splines will probably work pretty well, you can also adjust the smoothness/roughness of the fit.
  3 Commenti
Giuseppe Naselli
Giuseppe Naselli il 9 Gen 2014
ok so I foundthe way of creating the variable with only the fitted data
Basically I used the following script
load('Force-Velocity.mat'); % Load the data to fit
Fit_of_the_Data = fit(Velocity, Force, 'smoothingspline', 'SmoothingParam', 0.025) % Create a smoothing spline fit with the parameter I specified
Data_fitted = feval(Data_Fit,Velocity);
The Data_fitted variable is what I was looking for.
NOw the last step is to find how I can say to the command "fit" to generate a curve which goes to zero
Help please :)
G
Fede
Fede il 7 Feb 2024
Ciao @Giuseppe Naselli, I found a way to do this without curve fitting toolox, as follows:
Let's assume you have your datain (x,f) format, meaning displacement and force:
% First, I calculate the index at which the data turns, to separate up and down curves:
% hystereis turning point:
[x_turning, idx] = max(x_data);
x_up = x_data(1:idx);
f_up = f_data(1:idx);
x_down = x_data(idx:end);
f_down = f_data(idx:end);
% plot(x_up, f_up, 'o')
% plot(x_down, f_down, 'x')
% Then, Filter to only keep unique values:
%Keep unique values:
[x_up,ia,~] = unique(x_up);
f_up = f_up(ia);
% plot(x_up,f_up, '.');
[x_down,ia,~] = unique(x_down);
f_down = f_down(ia);
% plot(x_down,f_down, '.');
% Fit curves for each segment:
nQueryPoints= 100;
xx_up = linspace(min(x_up), max(x_up), nQueryPoints); % Generating points for smooth curve
yy_up = interp1(x_up,f_up,xx_up);
% plot(xx_up, yy_up, 'r');
xx_down = xx_up; % Note: I take the same query points as xx_up, to be ale to later calculate average value :)
yy_down = interp1(x_down,f_down,xx_down);
% plot(xx_down, yy_down, 'g');
% Calculate Average value:
xx_avg = xx_up;
yy_avg = (yy_up+yy_down)./2;
plot(xx_avg, yy_avg, '--b');
It doesn't give you a spline, but it's something!

Accedi per commentare.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by