100% found this document useful (2 votes)
5K views

Dynamic Response of SDOF - Matlab Code

This document provides the steps to solve a structural dynamics problem using different numerical integration methods including: 1) Central difference method (CDM) 2) Constant average acceleration method (CAA) 3) Linear acceleration method (LAM) The problem involves calculating the displacement, velocity and acceleration response of a SDOF system subjected to harmonic loading using the three methods with a time step of 0.1 seconds. MATLAB code is provided for each method.

Uploaded by

Eunlim Baek
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
5K views

Dynamic Response of SDOF - Matlab Code

This document provides the steps to solve a structural dynamics problem using different numerical integration methods including: 1) Central difference method (CDM) 2) Constant average acceleration method (CAA) 3) Linear acceleration method (LAM) The problem involves calculating the displacement, velocity and acceleration response of a SDOF system subjected to harmonic loading using the three methods with a time step of 0.1 seconds. MATLAB code is provided for each method.

Uploaded by

Eunlim Baek
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Problems

SDOF system : m=44.357kNs2/m, k=1751.18kN/m, =0.05


=2 rad/s, T=1.0s

Input loading; p(t)=44.48 sin(t/0.6)kN


Initial Condition; v(0)=v(0)=p(0)=0

(1) Determine the theoretical solution


sol) general solution of damped system subjected to harmonic loading is

cos sin

sin

cos

sin
cos sin
cos

accordance with initial condition



sin cos cos sin


sin

cos

cos sin

sin

cos

plot result

(2) Calculate the response by using the central difference method (dt=0.1s)
matlab code

%---------------------------------------% Central Diffenence Method


%----------------------------------------

% input data
m=44.357;

% mass (unit=kN.s2/m)

k=1751.18;

% stiffness (unit=kN/m)

h=0.05;

% dampin ratio (h=c/ccr=c/2mw)

w=2*pi;

% natural angular frequency of structure (unit=rad/s)

T=1.0;

% period (unit=sec)

c=2*h*m*w;

% damping coefficient

% define input loading


dt=0.1;

% for stability, dt <= 0.318T

t=[0:dt:10]';

% time

P=44.48*sin(pi*t/0.6); % input loading (unit=kN)


n=size(P,1);

% lengh of load vector(n=101)

% define initial values


F(1)=0; F(2)=0;
d(2)=0; v(2)=0; a(2)=1/m*(P(2)-c*v(2)-k*d(2)); % actually i=0 i.e d0,v0,a0
d(1)=d(2)-dt*v(2)+dt^2/2*a(2);

% actually i=-1

% coefficient of d(i+1)
A=m/dt^2-c/(2*dt);
B=k-2*m/dt^2;
C=m/dt^2+c/(2*dt);
% iteration
for i=3:n+2
TT(i)=t(i-2);
F(i)=P(i-2);
d(i)=2*dt*v(i-1)+d(i-2);
d(i+1)=1/C*(F(i)-A*d(i-1)-B*d(i));
v(i)=(d(i+1)-d(i-1))/(2*dt);
a(i)=(d(i+1)-2*d(i)+d(i-1))/dt^2;
v(i+1)=v(i);

% virtual

a(i+1)=a(i);

% virtual

TT(i+1)=TT(i); % virtual
F(i+1)=F(i);

% virtual

end
result=[TT' F' d' v' a'];
xlswrite('cdm result.xls',result)
figure(1)
plot(t,P)
xlabel('time(sec)')
ylabel('Load(kN)')
title('Input loading')
grid on
figure(2)
plot(TT,d)
xlabel('time(sec)')
ylabel('displacement(m)')
title('Displacement Response')
grid on
figure(3)
plot(TT,v)
xlabel('time(sec)')
ylabel('velocity(m/s)')
title('Velocity Response')
grid on
figure(4)
plot(TT,a)
xlabel('time(sec)')
ylabel('acceleration(m/s2)')
title('Acceleration Response')
grid on

(3) Calculate the response by using the constant average acceleration method
(dt=0.1s)
matlab code

%---------------------------------------% Constant Average Acceleraion Method


%---------------------------------------% input data
m=44.357;
k=1751.18;

% mass (unit=kN.s2/m)
% stiffness (unit=kN/m)

h=0.05;

% dampin ratio (h=c/ccr=c/2mw)

w=2*pi;

% natural angular frequency of structure (unit=rad/s)

T=1.0;

% period (unit=sec)

c=2*h*m*w;

% damping coefficient

% define input loading


dt=0.1;

% for stability, dt <= 0.318T

t=[0:dt:10]';

% time

P=44.48*sin(pi*t/0.6);
n=size(P,1);

% input loading (unit=kN)

% lengh of load vector(n=101)

% define initial values (i=0 i.e d0,v0,a0)


d(1)=0;
v(1)=0;
a(1)=1/m*(P(1)-c*v(1)-k*d(1));

% iteration
for i=1:n-1
d(i+1)=1/(k+2*c/dt+4*m/dt^2)*(P(i+1)+m*(4/dt^2*d(i)+4/dt*v(i)+a(i))+c*(2/dt*d(i)+
v(i)));
v(i+1)=2/dt*(d(i+1)-d(i))-v(i);
a(i+1)=4/dt^2*(d(i+1)-d(i))-4/dt*v(i)-a(i);
end

(4) Calculate the response by using the linear acceleration method (dt=0.1s)
matlab code

%---------------------------------------% Linear Acceleraion Method


%----------------------------------------

% input data
m=44.357;

% mass (unit=kN.s2/m)

k=1751.18;

% stiffness (unit=kN/m)

h=0.05;

% dampin ratio (h=c/ccr=c/2mw)

w=2*pi;

% natural angular frequency of structure (unit=rad/s)

T=1.0;

% period (unit=sec)

c=2*h*m*w;

% damping coefficient

% define input loading


dt=0.1;

% for stability, dt <= 0.318T

t=[0:dt:10]';

% time

P=44.48*sin(pi*t/0.6);
n=size(P,1);

% input loading (unit=kN)

% lengh of load vector(n=101)

% define initial values (i=0 i.e d0,v0,a0)


d(1)=0;
v(1)=0;
a(1)=1/m*(P(1)-c*v(1)-k*d(1));

% iteration
for i=1:n-1
d(i+1)=1/(k+6*m/dt^2+3*c/dt)*(P(i+1)+(6*m/dt^2+3*c/dt)*d(i)+(6*m/dt+2*c)*v(i)+(2*
m+c*dt/2)*a(i));
v(i+1)=3/dt*(d(i+1)-d(i))-2*v(i)-dt/2*a(i);
a(i+1)=6/dt^2*(d(i+1)-d(i))-6/dt*v(i)-2*a(i);
end

(5) Plot Result

You might also like