How can I get more accurate results when I am integrating Time and Acceleration with Cumtrapz?

조회 수: 13 (최근 30일)
My Data consists of Time, Acceleration, Velocity and Displacement.
I want to calculate the equation xr.
xr = (m2*x2ddot-b1*x1dot+b1*x2dot-k1*x1+(k1+k2)*x2)/k2;
When I load my Data from excel and calculate the xr, my result is correct. When I load only Time and Acceleration from excel, integrate with cumtrapz for Velocity and Displacement and then calculate the xr, my result is wrong (inaccurate).

답변 (2개)

Dr. Seis
Dr. Seis 2016년 4월 10일
편집: Dr. Seis 2016년 4월 11일
I do not use time domain methods to compute the integral or derivative of timeseries data, but you are free to use the code in my post here for frequency domain method:
Update: I should also mention that before integration (whether using time or frequency domain techniques), I will typically remove any linear/constant trends in my data using the DETREND function. This removes the amplitude at DC (or zero-frequency) and any other relatively low-frequency noise introduced/boosted by performing the integration.
  댓글 수: 3
Dr. Seis
Dr. Seis 2016년 4월 11일
The second input argument should be whatever your "dt" is, not "t" - where "dt" is the time increment (a single value) between samples, not the entire array of times "t" that samples were collected.
Yes, DETREND is a Matlab function.
Dr. Seis
Dr. Seis 2016년 4월 11일
편집: Dr. Seis 2016년 4월 11일
You need to run the DETREND tool on the acceleration data first. Something like:
x1ddot = xlsread('Data','B2:B2501'); % Acceleration (m/s^2)
x1ddot_detrend = detrend(x1ddot);
x1dot = iomega(x1ddot_detrend,0.0180,3,2); % Velocity (m/s)
x1 = iomega(x1ddot_detrend,0.0180,3,1); % Displacement (m)
x2ddot = xlsread('Data','E2:E2501'); % Acceleration (m/s^2)
x2ddot_detrend = detrend(x2ddot);
x2dot = iomega(x2ddot_detrend,0.0180,3,2); % Velocity (m/s)
x2 = iomega(x2ddot_detrend,0.0180,3,1); % Displacement (m)
Note: You can place the detrended acceleration data inside the function for outputting both the velocity and displacement data (just change the input/output data types as shown). You may also need to run a high-pass filter to get rid of other low-frequency noise.
Other Note: Even after detrending and filtering produces a good match to the shape of the output velocity/displacement data, there will still be some bulk shift that will need to be applied for better alignment. Always some unknown constant ("C") that you may need to add on to your result after integration.

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

Prashanth Ragam
Prashanth Ragam 2016년 5월 2일
hi DR.Seis I have blasting acceleration data around 1000 values with 0.1s delay.can I wan convert acceleration data into velocity...if it is possible, please suggest the code.


Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by