0% found this document useful (0 votes)
106 views2 pages

Dynamics of Ground Acceleration Analysis

This document contains MATLAB code to model the dynamic response of a single degree of freedom linear system subjected to ground acceleration. It defines parameters like mass, damping ratio, stiffness, calculates natural frequency and damping coefficient. It then uses Newmark's method to calculate the relative displacement, velocity and acceleration at each time step due to the applied ground acceleration read from an excel file. Finally, it plots the total acceleration and relative displacement vs time along with minimum and maximum values.

Uploaded by

Shashi Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views2 pages

Dynamics of Ground Acceleration Analysis

This document contains MATLAB code to model the dynamic response of a single degree of freedom linear system subjected to ground acceleration. It defines parameters like mass, damping ratio, stiffness, calculates natural frequency and damping coefficient. It then uses Newmark's method to calculate the relative displacement, velocity and acceleration at each time step due to the applied ground acceleration read from an excel file. Finally, it plots the total acceleration and relative displacement vs time along with minimum and maximum values.

Uploaded by

Shashi Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

16/10/17 2:18 PM G:\M Tech\Dynamics\COde\New\NmarkLin.

m 1 of 2

clc
clear all
close all
format long;
m=1; % m is the mass of the structure
T=0.5; % T is the Natural Period of Vibration
z=0.05; % z is the Damping ratio
w=2*pi/T; % w is the natural frequency
k=m*w^2; % k is the stiffness constant
c=2*m*z*w; % c is the Damping Coefficient
dt=0.0
G=0.5; % Gamma
B=1/6; % Beta
k1=k+c*(G/(B*dt))+(m/(B*dt^2));
a=(m/(B*dt))+((c*G))/B;
b=(m/(2*B))+(dt*c*((G/(2*B))-1));
data=xlsread('data.xlsx','sheet1');
t=data(:,1);
ag=data(:,2); %ag is Ground acceleration
d(1)=0; % d is Relative Displacement
v(1)=0; % v is Relative Velocity
for i=1:3000
P(i)=-m*ag(i); %P is Ground force (Po)
P(i+1)=-m*ag(i+1); %A is Relative Acceleration
A(i)=(P(i)-c*v(i)-k*d(i))/m;
dP(i)=P(i+1)-P(i)+a*v(i)+b*A(i); %dP is (delta Pcap)
dd(i)=dP(i)/k1;
dv(i)=((G*dd(i))/(B*dt))-G*v(i)/B+((dt*A(i))*(1-G/(2*B)));
dA(i)=(dd(i)/(B*dt^2))-(v(i)/(B*dt))-(A(i)/(2*B));
d(i+1)=d(i)+dd(i); %dA is (delta relative accelaration)
v(i+1)=v(i)+dv(i);
A(i+1)=A(i)+dA(i);

At(i)=A(i)+ag(i);
At(i+1)=A(i+1)+ag(i+1); %At is Total Acceleration

end

%Total Acceleration
figure;
plot(t,At);
title('Total Acceleration Vs Time');
xlabel('Time(sec)');
ylabel('Total Acceleration(m/s^2)');
grid on;
indexmin = find(min(At) == At);
tmin = t(indexmin);
tsmin = At(indexmin);
indexmax = find(max(At) == At);
tmax = t(indexmax);
tsmax = At(indexmax);
16/10/17 2:18 PM G:\M Tech\Dynamics\COde\New\NmarkLin.m 2 of 2

strmin = ['Minimum = ',num2str(tsmin)];


text(tmin,tsmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(tsmax)];
text(tmax,tsmax,strmax,'HorizontalAlignment','right');

%Relative Displacement Plot


figure;
plot(t,d);
grid on;
title('Relative Displacement Vs Time');
xlabel('Time(sec)');
ylabel('Relative Displacement(m)');
indexmin = find(min(d) == d);
tmin = t(indexmin);
dmin = d(indexmin);
indexmax = find(max(d) == d);
tmax = t(indexmax);
dmax = d(indexmax);
strmin = ['Minimum = ',num2str(dmin)];
text(tmin,dmin,strmin,'HorizontalAlignment','left');
strmax = ['Maximum = ',num2str(dmax)];
text(tmax,dmax,strmax,'HorizontalAlignment','right');

You might also like