matlab people helo hellp
Show older comments
i don't know what to say
1 Comment
Original question by Constantine Kenny retrieved from Google Cache:
Convert time series for acceleration to displacement using ode45
I have data for ground motion acceleration as a function of time. I would like to convert this acceleration data to displacement data using matlab's ode45 function. Is this possible, and is this the right way to do so?
The differential equation is:
ẍ(t) + 2ζνẋ(t) + (v^2)*x(t) = -a(t)
where a(t) is the acceleration time series that I have.
Answers (1)
It appears that ζ anc v are constants. Are they known and provided or are they to be estimated?
Assuming they are provided —
syms a(t) t v x(t) Y zeta
D1x = diff(x);
D2x = diff(D1x);
DE = D2x + 2*zeta*v*D1x + v^2*x + a
[VF,Sbs] = odeToVectorField(DE)
odefcn = matlabFunction(VF, 'Vars',{'t','Y','v','zeta','a'})
v = 4.2;
zeta = 0.42;
t = linspace(0, 50, 15);
a = randn(size(t))*10; % Acceleration Values Vector
aintp = @(tv) interp1(t, a, tv); % Interpolate Data
ic = [0 2]; % Use Appropriate Values
[t,y] = ode45(@(t,y)odefcn(t,y,v,zeta,aintp), t, ic);
figure
plot(t, y)
grid
xlabel('t')
ylabel('Amplitude')
legend(string(Sbs), 'Location','best')
Seismology is not an area of my expertise, so make appropriate changes (and use the correct parameter values) to get the desired results.
.
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

