from
Integrators of Newmark Family
by WaiChing Sun
obtain displacement and velocity from acceleration record
|
| [accel, vel, disp]=fnewmark(accel, dt, beta, gamma);
|
% --------------------------------------------------------------
% Written by: WaiChing Sun [stvsun@stanford.edu]
% Purpose: generate the displacement history
% Input: time and acceleration history as arrays
% Output: displacement and velocity as arrays
% Last Update: 9/14/2006
%---------------------------------------------------------------
function [accel, vel, disp]=fnewmark(accel, dt, beta, gamma);
dim = size(accel);
vel = zeros(dim);
disp = zeros(dim);
for i=1:1:(dim(1)-1)
disp(i+1,1)= disp(i,1)+dt*vel(i,1)+0.5*(dt^2)*...
((1-2*beta)*accel(i,1)+2*beta*accel(i+1,1));
vel(i+1,1) = vel(i,1)+ dt*((1-gamma)*accel(i,1)+gamma*accel(i+1,1));
end
save history.mat disp vel disp
|
|
Contact us at files@mathworks.com