Professional Documents
Culture Documents
t, varargin)
%Newmark's Direct Integration Method
%------------------------------------------------------------------------
--
% Code written by : - Siva Srinivas Kolukula
|
% Senior Research Fellow
|
% Structural Mechanics Laboratory
|
% Indira Gandhi Center for Atomic Research
|
% INDIA
% - Hamed Nokhostin
|
% B.S. Student
|
% Mechanical Engineering Faculty
|
% K.N.Toosi Uiversity of Technoloygy
|
% I.R.Iran
|
% E-mail : allwayzitzme@gmail.com
% h_nokhostin@yahoo.com
|
%------------------------------------------------------------------------
-
% PURPOSE
% ???
% SYNTAX
% [x, xdot, x2dot] = newmarkint(M, C, K, R, x0, xdot0, t,
varargin)
% INPUT
% [M] : System Mass [n,n]
% [C] : System Damping [n,n]
% [K] : System Stiffness [n,n]
% [R] : Externally Applied Load [n,nt]
% [x0] : Initial Position [n,1]
% [xdot0] : Initial Velocity [n,1]
% [t] : Time Vector [1,nt]
% [varargin]: Options
%
% OUTPUT
% [x]: Displacemente Response [n,nt]
% [xdot]: Velocity [n,nt]
% [x2dot]: Acceleration [n,nt]
%
%
% nt = number of time steps
% n = number of nodes
% The options include changing the value of the "gamma" and "beta"
% coefficient which appear in the formulation of the method. By default
% these values are set to gamma = 1/2 and beta = 1/4.
%
% EXAMPLE
% To change nemark's coefficients, say to gamma = 1/3 and beta = 1/5,
% the syntax is:
% [u, udot, u2dot] = newmark_int(t,p,u0,udot0,m,k,xi, 1/3, 1/5)
%
%------------------------------------------------------------------------
-
if nargin == 7
disp('Using default values:');
disp(' gamma = 1/2');
disp(' beta = 1/4');
gamma = 1 / 2;
beta = 1 / 4;
elseif nargin == 9
gamma = varargin{1};
beta = varargin{2};
disp('Using user''s values:');
disp([' gamma = ', num2str(alpha)]);
disp([' beta = ', num2str(delta)]);
else
error('Incorrect number of imput arguments');
end
dt = t(2) - t(1);
nt = fix((t(length(t) )- t(1)) / dt);
n = length(M);
x = zeros(n,nt);
xdot = zeros(n,nt);
x2dot = zeros(n,nt);
% Initial Conditions
x(:, 1) = x0;
xdot(:, 1) = xdot0;
%R0 = zeros(n,1);
x2dot(:,1) = M \ (R(:, 1) - C * xdot(:, 1) - K * x(:, 1)) ;
Kcap = K + a1 * C + a2 * M;
a = a3 * M + a4 * C;
b = a5 * M + a6 * C;