Dear @Jason.Jonkman ,
The matlab function I’m using for the damping is the following:
function [B, Td, locs, pks] = CompDamping_v2(t, th, fsamp, Method, Npks, manual)
if Method == 0
% Find main signal period
[Y, ~, freq] = fft_trasform(detrend(th, 'constant'), length(th), 1/fsamp);
[pksH, pksF] = findpeaks(Y, freq);
[~, maxI] = max(pksH);
pksF = pksF(maxI);
Th = 1/pksF;
% Exclude initial part
if th(1) > 0
th = -th;
end
% Find peaks in the selected time history
Ths = 0.85 * Th; % Minimum distance between consecutive peaks
[pks, locs] = findpeaks(th, t, 'MinPeakDistance', Ths);
% Discards local minima and keep only maxima
logical = pks < 0;
pks(logical) = [];
locs(logical) = [];
% Start selecting peaks from the middle
% Startpoint = floor(length(pks) / 8 );
if length(pks) < Npks
Npks = length(pks);
end
pks = pks(1 : Npks);
locs = locs(1 : Npks);
% Average signal period [s]
Td = mean(diff(locs));
omd = 2 * pi / Td; % Damped frequency [rad/s]
% Linear
delta = 1 / Npks * log(pks(1) / pks(end));
h = 1 / sqrt(1 + (2 * pi / delta)^2);
% Natural period
omn = omd / sqrt(1 - h^2);
Tn = 2 * pi / omn;
% Linear and quadratic
if Npks > 2
delta = zeros(1, Npks - 1);
p = zeros(1, Npks - 1);
for ii = 2:Npks
delta(ii - 1) = log(pks(ii) / pks(ii - 1));
p(ii - 1) = -(4 * pi / Tn) * delta(ii - 1) / sqrt(pi^2 + delta(ii - 1)^2);
end
PP = polyfit(16 / 3 * pks(2:Npks) / Td, p, 1);
p1 = PP(2); % Intercept, linear
p2 = PP(1); % Slope, quadratic
else
p1 = 0;
p2 = 0;
end
% Output damping
B = [h p1 p2]';
if th(1) < 0
pks = -pks;
th = -th;
end
figure(100); plot(t, th); hold on; plot(locs, pks, 'or');
else
ss_time = 30;
y_inf = mean(th(end - ss_time * fsamp:end));
y_inf_std = std(th(end - ss_time * fsamp:end));
figure(100)
plot(t, th)
hold on
yline(y_inf, '--');
yline(y_inf + y_inf_std, '-.');
yline(y_inf - y_inf_std, '-.');
Yes the results depend slightly on the amplitude of oscillation: ex with 10 m/s, if the initial platform pitch is -1.5deg the damping is 15.59%, if 6deg 15.77% and if 15deg 16.92%.
Concerning my model, the damping term has been extracted always with the same method: free decay with no waves and no wind and initial pitch condition and the function I’ve shared. So it should have both radiation and quadratic drag terms.
Best regards,