필터 지우기
필터 지우기

Estimating the period and the damping of the system

조회 수: 3 (최근 30일)
Obsidian
Obsidian 2021년 7월 19일
댓글: Obsidian 2021년 7월 19일
Hello,
I am new with MatLab. I want to Estimate the period and the damping of the system from a set of data using three values of j cycles:
j = 10 cycles, 20 cycles, 30 cycles
For each case c.I, c.II, and c.III I am supposed to use different starting peak (i.e., moving window of peaks) and calculate the median value of damping ratio and natural period for each case C.I, C.II, and C.III. and also tabulate the results.
Does anyone have a suggestion about how to approad this problem?
I appreciate the help!
I used following code to extract and plot data and I am stuck on how to find period and damping:
code:
clc; clear all; close all
load Vibration_Data.txt
acc = Vibration_Data(:,2);
dt = 0.02;
time = (0:numel(acc)-1) * dt;
plot (time,acc,'b-');
findpeaks(acc,time)
peaks=findpeaks(acc,time)
period=time(peaks)-time(peaks(0:size(peaks)-1))
error:
last line: array indices must be positive integers or logical values.
  댓글 수: 2
Sameer Pujari
Sameer Pujari 2021년 7월 19일
편집: Sameer Pujari 2021년 7월 19일
As per my understanding, you are trying to calculate period(s) between two peaks.
You could use numel(peaks) or length(peaks) to find number of elements in the peaks array.
Then use for loop to generate an array of period.
for i=1:length(peaks)-1
period(i)=time(i+1)-time(i)
end
In matlab, Array indexing starts from index '1'. index '0' is not valid. So, you might be getting the error
Obsidian
Obsidian 2021년 7월 19일
Thanks! it worked.

댓글을 달려면 로그인하십시오.

답변 (1개)

Simon Chan
Simon Chan 2021년 7월 19일
This line will give an error:
period=time(peaks)-time(peaks(0:size(peaks)-1))
So just try the following:
period=time(peaks)-time(peaks-1)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by