0% found this document useful (0 votes)
42 views

Newmarks Method

This document contains code that simulates the motion of a mass-spring-damper system subjected to base excitation over 10 time steps. It initializes arrays to store the displacement, velocity, and acceleration values. It then calculates the displacement, velocity, and acceleration at each time step by applying equations of motion that account for the mass, stiffness, damping, and applied force. The output displays the calculated displacement, velocity, and acceleration values over time.

Uploaded by

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

Newmarks Method

This document contains code that simulates the motion of a mass-spring-damper system subjected to base excitation over 10 time steps. It initializes arrays to store the displacement, velocity, and acceleration values. It then calculates the displacement, velocity, and acceleration at each time step by applying equations of motion that account for the mass, stiffness, damping, and applied force. The output displays the calculated displacement, velocity, and acceleration values over time.

Uploaded by

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

% Given Data

m = 0.2533;
k = 10;
c = 0.1592;
dt = 0.1;
beta = 0.25;
gamma = 0.5;

% Base excitation
Ugdd = zeros(10,1);
P = zeros(10,1);
t = 0;
for i = 1:10,
Ugdd(i,1) = -39.47*sin(pi*t/0.6);
P(i,1) = -m*1*-39.49*sin(pi*t/0.6);
t = t + dt;
end

%Initial Caulculations
U = zeros(10,1);
Ud = zeros(10,1);
Udd = zeros(10,1);

U(1,1) = 0;
Ud(1,1) = 0;
Udd(1,1) = (P(1) - m*Ud(1) - k*U(1))/m;

kcap = k + m/(beta*dt^2) + c*gamma/(beta*dt);


a = m/(beta*dt) + c*gamma/beta;
b = m/(2*beta) + c*(gamma/(2*beta)-1)*dt;

%Calculations at each time step i


for i = 1:(10-1),
deltap = P(i+1,1) - P(i,1);
deltapcap = deltap + a*Ud(i,1) + b*Udd(i,1);
deltaU = deltapcap/kcap;
deltaUd = gamma/(beta*dt)*deltaU - gamma*Ud(i,1)/beta + dt*(1-
gamma/(2*beta))*Udd(i,1);
deltaUdd = deltaU/(beta*dt^2) - Ud(i,1)/(beta*dt) - Udd(i,1)/(2*beta)

U(i+1) = U(i,1) + deltaU;


Ud(i+1) = Ud(i,1) + deltaUd;
Udd(i+1) = Udd(i,1) + deltaUdd;
end
U
Ud
Udd

You might also like