Logarithmic Decrement and Damp Ratio

59 次查看(过去 30 天)
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 个评论
Agus Danish
Agus Danish 2021-12-16
Hello, the error said "Index in position 2 exceeds array bounds. Index must not exceed 1.". What does it means?
Mathieu NOE
Mathieu NOE 2021-12-17
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

请先登录,再进行评论。

回答(2 个)

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

Mathieu NOE
Mathieu NOE 2021-12-1
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

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by