
I'm working on Newmark's method. I'm not sure how to perform the algorithm.
7 views (last 30 days)
Show older comments
Hi, I tried the codes in File Exchange section for Newmark's method but they didn't worked the way I wanted. So I had to write the code myself from scratch. This is my code I written for this project (note that it's incomplete yet):
clear all
clc
%Only ACCZ is loaded for maximum response
load ACCZ.txt
t=0:0.02:53.46;
Accl=ACCZ(:,1);
Dt=0.02;
T(1,1)=0.00;
tt=length(t);%No of row @t
%Properties of materials
K=222701.1;%Stiffness coefficient,N/m
Xi=0.02;%Damping ratio
M=1220;%Mass,kg
wn=sqrt(K/M);%Natural frequency,rad/s
C=2*Xi*sqrt(K*M)%Damping coefficient
%For linear acceleration, gamma=1/2, beta=1/6
%For average acceleration, gamma=1/2, beta=1/4
gamma=1/2; beta=1/6; %linear acceleration
%--------------------------------------------------------------------------
%Initial calculations
u(1)=0; %initial condition-displacement
v(1)=0; %initial condition-velocity
a(1)=Accl(1); %initial condition-acceleration
Kbar = K+ (gamma/(beta*Dt))*C + (1/(beta*Dt^2))*M
A = (1/(beta*Dt))*M + (gamma/beta)*C
B = (1/(2*beta))*M + ((gamma/(2*beta))-1)*Dt*C
%Setting initial values for loop u,v,a
u0=u;
v0=v;
a0=a;
%That is all I have for now. Waiting for guidance on how to finish the code....
Besides, I also created the function for Newmark's Method:
function[t,u,v,a]=Newmark(t,A,B,DP,Dt,Kbar,u0,v0,a0,gamma,beta)
DP_bar = DP + A*v0 + B*a0;
Du = DP_bar/Kbar;
Du_dot = gamma*Du/(beta*Dt) - gamma*v0/beta + Dt*a0*(1-0.5*gamma/beta);
Du_2dot = Du/(beta*(Dt*Dt)) - v0/(beta*Dt) - a0/(2*beta);
u=u0+Du;
v=v0+Du_dot;
a=a0+Du_2dot;
t=t+Dt;
How can I link the function to my main code? More importantly, how can I create an algorithm, to perform a certain computations for each time and its relative acceleration from acceleration-time graph?
0 Comments
Answers (1)
MUKESH
on 12 Dec 2023
Take time step and acceleration from any earthquake data, which is availabele in internet. My personal choice elcentro data. Then import that excel file read excel. Then those acceleration will multiply with your mass gives you forces. You have to plot 4 plot 1-force function, 2-displacement response, 3- velocity response, 4-acceleration response

0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!