Logarithmic Decrement and Damp Ratio
조회 수: 169 (최근 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
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
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개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Vibration Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!