Navigation

Operators and Keywords

Function List:

C++ API

Function File: x = newmark(m, c, k, f, dt, x0 = 0, x'0 = 0, alpha = 1/2, beta = 1/4, flags = "")

Computes the solution of second-order differential equations of the form

          m  x'' + c x' + k x = f

where x' denotes the first time derivative of x.

If the function is called without the assigning a return value then x is plotted versus time.

Inputs

m
The mass of the body.
c
Viscous damping of the system.
k
Spring stiffness (restoring force coefficient).
f
The forcing function as a time sampled or impulse vector (see Special Cases).
dt
The time step – assumed to be constant
x0
Initial displacement, default is zero
x'0
Initial velocity, default is zero
alpha
Alpha Coefficient – Controls "artificial damping" of the system. Unless you have a really good reason, this should be 1/2 which is the default.
beta
Beta Coefficient – This coefficient is used to estimate the form of the system acceleration between time steps. Values between 1/4 and 1/6 are common. The default is 1/4 which is unconditionally stable.
flags
A string value which defines special cases. The cases are defined by unique characters as explained in Special Cases below.

Outputs

x
Matrix of size (3, length(f)) with time series of displacement (x(1,:)), velocity (x(2,:)), and acceleration (x(3,:))

Special Cases

The flags variable is used to define special cases of analysis as follows.

"i" - Impulse forcing function. The forcing function, f is a vector of impulses instead of a sampled time history. "n" - The stiffness is non-linear. In this case, k is a string which contains the name of a function defining the non-linear stiffness.