Logarithmic Decrement and Damp Ratio

160 views (last 30 days)
Luka David Dilas
Luka David Dilas on 4 Apr 2018
Commented: Mathieu NOE on 17 Dec 2021
I have a velocity vs time input data on which I had to apply butterworth filter but now I have issues with application of the log decrement method for damping calculation. The log decrement formula is depicted in the picture and I have implemented it as following:
%INPUTS%
%Veloc - Veloc vector
%n_peaks - No. of peaks of interest
%Time - Actual time series
%OUTPUTS%
%damp_ratio_logdec - Damping ratio
z=importdata('P1veloc.txt');
Time = z(:,1);
Veloc = z(:,2);
n_peaks=10
%Vector length of interest
t_new = Time(imax(1:n_peaks));
y_new = ymax(1:n_peaks);
t_new(1)=[];%Remove first point - Due to impact
y_new(1)=[];
%---Calculate Logarithmic Decrement
Log_Dec = zeros(length(n_peaks));
for nn = 1:n_peaks-2 %We go to '-2' because length(n_peaks) = since we ignore first one
Log_Dec(nn)= log(y_new(nn)/y_new(nn+1));
end
Mean_dec = mean(Log_Dec); %Calculate Average Logarithmic Decrement
%Damping
damp_ratio_logdec = 1/sqrt(1+((2*pi/(Mean_dec))^2)); %Assesses Damping Constant
I have also put a .txt file with velocity and time columns. I started the code but I am not doing well so I would appreciate any help, since I just started using Matlab as part of my thesis and I have to process data in this way.
  2 Comments
Mathieu NOE
Mathieu NOE on 17 Dec 2021
hello
to which code / data are you refering ?
this was my suggestion (see below) :
clc
clear all
close all
z=importdata('P1veloc.txt');
ind = 1:100;
Time = z(ind,1);
Veloc = z(ind,2);
ind = 1:20;
[Ypk,Xpk,Wpk,Ppk] = findpeaks(Veloc(ind));
plot(Time,Veloc,Time(Xpk),Ypk,'dr');
n_peaks=numel(Xpk);
%Vector length of interest
t_new = Time(Xpk);
y_new = Ypk;
%---Calculate Logarithmic Decrement, undamped natural frequency, damped natural frequency, damping ratio
Log_Dec = zeros(length(n_peaks));
for nn = 1:n_peaks-1 %
Log_Dec(nn)= log(y_new(nn)/y_new(nn+1)); % computed with n = 1 periods apart
end
Mean_dec = mean(Log_Dec); %Calculate Average Logarithmic Decrement
%Damping
damp_ratio_logdec = 1/sqrt(1+((2*pi/(Mean_dec))^2)); %Assesses Damping Constant

Sign in to comment.

Answers (2)

A K M Kamrul Hasan
A K M Kamrul Hasan on 7 Jan 2020
Can you please explain, what is imax and ymax?

Mathieu NOE
Mathieu NOE on 1 Dec 2021
hello
a very late answer to this question - siply because this code was reused in another post
FWIW, this is the answer I already provided
clc
clear all
close all
% z = csvread('G03.csv');
z=importdata('P1veloc.txt');
ind = 1:100;
Time = z(ind,1);
Veloc = z(ind,2);
ind = 1:20;
[Ypk,Xpk,Wpk,Ppk] = findpeaks(Veloc(ind));
plot(Time,Veloc,Time(Xpk),Ypk,'dr');
n_peaks=numel(Xpk);
%Vector length of interest
t_new = Time(Xpk);
y_new = Ypk;
%---Calculate Logarithmic Decrement, undamped natural frequency, damped natural frequency, damping ratio
Log_Dec = zeros(length(n_peaks));
for nn = 1:n_peaks-1 %
Log_Dec(nn)= log(y_new(nn)/y_new(nn+1)); % computed with n = 1 periods apart
end
Mean_dec = mean(Log_Dec); %Calculate Average Logarithmic Decrement
%Damping
damp_ratio_logdec = 1/sqrt(1+((2*pi/(Mean_dec))^2)); %Assesses Damping Constant

Community Treasure Hunt

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

Start Hunting!