Numerical Integration in Structural Dynamics
Numerical Integration in Structural Dynamics
Introduction
A damped structural system subjected to dynamic forces and possibly experiencing
nonlinear material behavior is modeled by
M x(t) + C x(t)
+ Kx(t) + R(x(t), x(t))
= f ext (t),
(1)
(2)
Given values for accelerations, velocities, displacements, and applied forces at time ti , if we
can extrapolate the velocities and displacements forward in time by a time step h to time
ti+1 = ti + h, then we may compute the acceleration x(ti+1 ) using equation 2. The various
numerical integration algorithms described in this document1 2 differ primarily in the manner
in which x(ti+1 ) and x(t
i+1 ) are computed from x(ti ), x(t
i ), x(ti ), f ext (ti ), and f ext (ti+1 ). Note
that since differentiation amplifies high frequencies, changes in x and x from ti to ti+1 will
be much smoother than the corresponding changes in x.
There are two general classifications of numerical integration methods: explicit and
implicit. In explicit methods, displacements and velocities at ti+1 can be determined in
closed form from displacements, velocities, accelerations, at ti , and from external forcing at
ti and, potentially, ti+1 . For structural systems with linear elastic stiffness and linear viscous
damping, such discrete-time systems may be written
"
x(ti+1 )
x(t
i+1 )
"
=A
x(ti )
x(t
i)
+ B f ext (ti )
(3)
where A is a 2n 2n discrete time dynamics matrix which depends upon M , C, K, the time
step, h, and some algorithmic parameters. Implicit methods involve the solution of a set of
nonlinear algebraic equations at each time step. For example, the displacements and velocities
at time ti+1 , [x(ti+1 ), x(t
i+1 )], are determined from the roots of a nonlinear equation in terms
of [x(ti+1 ), x(t
i+1 )]. Explicit numerical methods are typically more computationally-efficient
than implicit methods.
1
2
Clough, R. and Penzien, J., Dynamics of Structures, 2nd ed., McGraw-Hill, 1993.
Hanson, R.D., CE 611: Structural Dynamics, class notes, The University of Michigan, 1988
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
1
1
2
1
1
M + C xi+1 = 2 M K xi + 2 M + C xi1 + fiext ,
2
h
2h
h
h
2h
(4)
(5)
(6)
which may be written A0 xi+1 = A1 xi + A2 xi1 + fiext . The matrix A0 is positive definite and
may be factorized prior to the iterative solution for xi at each time step.
The numerical stability of the central difference method depends on the choice of the
time step interval, h. To obtain a stable solution, h < Ti /, where Ti is the shortest natural
period of the structural system. If the central difference method is used with a time step
larger than Ti / the solution will increase exponentially.
A step-by-step procedure for the central difference method may be written as3 :
1. Input the mass, M , damping, C, stiffness, K, matrices and the time step interval h.
2. Initialize x0 , x 0 , x0 and compute x1 = x0 hx 0 +
h2
x .
2 0
K.J. Bathe, Finite Element Procedures in Engineering Analysis, Prentice-Hall, 1982, pp. 439449, 499
506.
CC BY-NC-ND H.P. Gavin
x(ti+1 ) = xi+1 = xi + hx i +
(7)
x(t
i+1 ) = x i+1
(8)
x(ti+1 ) = xi+1
(9)
(10)
and substituting equation (10) into equations (7) and (8) results in
!
xi+1
x i+1
h2
h2 ....
h4 ....
h2
x i +
x i + ,
xi+1 xi
= xi + hx i + xi +
2
6
2!
4!
!
h2 ....
h
h3 ....
x i +
x i +
xi+1 xi
= x i + h
xi +
2
2!
3!
(11)
(12)
Truncating the fourth time-derivative and higher from these expansions, the resulting finite
difference approximations are
xi+1 xi + hx i +
h2
(
xi+1 + 2
xi ),
6
(13)
and
h
xi+1 + xi ).
(14)
x i+1 x i + (
2
These relationships are implicit because xi+1 needs to be determined in order to find xi+1 and
x i+1 , but xi+1 can not be found without knowing xi+1 and x i+1 . Note that the substitutions
above, have eliminated the third time-derivative of x, and that the method is accurate to
....
within h4 x .
This is called the linear acceleration method because the third time derivative of x has
been eliminated. If the rate of change of acceleration is constant, then the approximation
of truncating the Taylor series at the fourth-order term does not affect the accuracy of the
solution.
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
(15)
"
h
h2
h
h2
ext
M + C + K xi+1 = fi+1
Kxi [C + hK]x i C + K xi .
2
6
2
3
(16)
and re-arranging,
"
"
h2
h
h2
h
ext
.
M + C + K xi+1 = C K xi Kxi C x i hK x i + fi+1
2
6
2
3
(17)
(18)
Substituting equation (18) into (17), we obtain the closed-form linear acceleration recurrence
relations for structural dynamics simulation.
"
"
h2
h
h2
h
ext
fiext .
M + C + K xi+1 = M C K xi hK x i + fi+1
2
6
2
3
x i+1 = x i +
h
[
xi+1 + xi ] .
2
(19)
(20)
and
h2
[
xi+1 + 2
xi ] .
(21)
6
These relationships are now explicit because xi+1 can be determined from the current response
ext
values (xi and x i ), the current dynamic load fiext , and the next dynamic load fi+1
. Note that
within each time step, the dynamic equations of equilibrium are satisfied both at time ti and
at time ti+1 .
xi+1 = xi + hx i +
The explicit linear acceleration method is a good technique to correct for acceleromter
sensor dynamics. Accelerometers are themselves simple oscillators, with an input f ext (t) =
m
z (t), and a voltage output proportional to the relative displacement, v(t) = x(t), where
is related to the accelerometer sensitivity (in volts/m/s2 ). Given the sensor senstivity,
natural frequency and damping ratio, accelerometer dynamics can be corrected by solving
for z(t) from measurements of v(t)/. Equations (19) and (20) can be inverted to correct
acceleration measurements for sensor dynamics.
(22)
and
x i+1 x i + h [(1 )
xi + xi+1 ] .
(23)
If = 1/4 and = 1/2 the Newmark- method is implicit and unconditionally stable. In
this case the acceleration within the time interval t [ti ti+1 ) is presumed to be constant. If
= 1/6 and = 1/2 the Newmark- method is identical to the linear acceleration method.
If = 0 and = 1/2 the Newmark- method is identical to the central difference method.
For linear structural dynamics, if 2 1/2, then the Newmark- method is stable
regardless of the size of the time-step, h. The Newmark- method is conditionally stable if
< 1/2. For = 1/2 the Newmark- method is at least second-order accurate; it is first
order accurate for all other values of .
Formulating the finite difference relationships in terms of the increments of displacement
(xi = xi+1 xi ), velocity ( x i = x i+1 x i ), acceleration (
xi = xi+1 xi ), and nonlinear
restoring force (Ri = R(xi+1 , x i+1 ) R(xi , x i ))
1
1
1
xi
x i
xi ,
(24)
xi =
2
h
h
2
and
!
x i =
xi x i + h 1
xi .
(25)
h
2
Now, satisfying incremental equilibrium over the time step, h,
ext
M
xi + C x i + Kxi + Ri = fi+1
fiext = fiext ,
(26)
"
3
h
6
6
M + C + K xi = fiext Ri + 3M + C xi + M + 3C x i ,
2
h
h
2
h
(27)
where = 1/6 and = 1/2. Solving this linear system of equations4 for xi , the displacements are updated with,
xi+1 = xi + xi ,
(28)
the velocities are updated with
h
3
x i+1 = 2x i xi + xi ,
2
h
and the accelerations satisfy the equations of motion,
ext
xi+1 = M 1 [C x i+1 + Kxi+1 + R(xi+1 , x i+1 ) fi+1
].
(29)
(30)
Similar relations may be found for other values of and . Note that in this incremental
formulation one needs to obtain the inverse of the mass matrix, M , and the inverse of the
matrix [6M/h2 + 3C/h + K].
4
If the incremental nonlinear restoring forces Ri are not negligible, equation (27) is solved using the
Newton-Raphson method, equation (48).
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
(31)
Equation (31) is analogous to equation (26) with the added condition that the acceleration
is constant within the interval t [ti ti+1 ). If
0 1/3
= (1 + )2 /4 ,
= 1/2 + ,
(32)
(33)
(34)
and
the HHT- method is at least second-order accurate and unconditionally stable. The HHT-
method is useful in structural dynamics simulations incorporating many degrees of freedom,
and in which it is desirable to numerically attenuate (or dampen-out) the response at high
frequencies. Increasing decreases the response at frequencies above 1/(2h), provided that
and are defined as above.
Substituting the Newmark- finite difference relationships into equation (31),
M xi+1 + (1 )C{x i + h[(1 )
xi + xi+1 ]} + C x i
2
+ (1 )K{xi + hx i + h [(1/2 )
xi + xi+1 ]} + Kxi
ext
ext
= (1 )fi+1 + fi ,
(35)
These are a set of linear equations for xi+1 in terms of xi , x i , xi , the external dynamic load,
and the structures mass, damping, and stiffness. Equations (22), (23), and (36) provide the
recurrence relationship for the HHT- method.
5
Hughes, T.J.R., Analysis of Transient Algorithms with Particular Reference to Stability Behavior. in
Computational Methods for Transient Analysis, North-Holland, 1983, pp. 67155.
M + (1 ) C + (1 )K xi =
2
h
h
+
"
M + (1 ) C x i
h
! #
"
1
M (1 )h 1
C xi
2
2
"
#
C + K xi1
h
!
C x i1 h 1
C xi1
2
(1 )Ri Ri1
(1 )fi + fi1 .
(38)
If R(x, x)
= 0, these are a set of linear equations for xi in terms of x i , xi , xi1 , x i1 ,
xi1 , xi1 , the external dynamic load, and the structures mass, damping, and stiffness.
Equations (22), (23), and (38) provide the recurrence relationship for the HHT- method
in incremental form. Solving this linear system of equations6 for xi , the displacements are
updated with,
xi+1 = xi + xi ,
(39)
the velocities are updated with
!
x i+1
x i +
xi + h 1
xi .
= 1
h
2
(40)
and the accelerations satisfy the HHT- form of the equations of motion,
h
ext
xi+1 = M 1 (1 )C x i+1 + C x i + (1 )Kxi+1 + Kxi (1 )fi+1
fiext . (41)
6
If the incremental nonlinear restoring forces Ri are not negligible, equation (38) is solved using the
Newton-Raphson method, equation (48).
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
Numerical Example
The simple linear structural model shown below
111
000
000
111
000 200 kN/mm
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000 0.35 kN/mm/s
111
2
200 kN/mm
111
000
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
111
000
0.15 kN/mm/s 111
000
111
200 kN/mm
1 Mt
1 Mt
0.20 kN/mm/s
1 Mt
0.20 kN/mm/s
is described by the following stiffness, damping, and mass matrices (units kN,mm,s):
400 200
0
400 200
K = 200
0 200
200
0.55 0.20
0
0.55 0.20
C = 0.20
0 0.20
0.35
1 0 0
M = 0 1 0 (42)
0 0 1
This system has natural periods of 1.00 s, 0.36 s, and 0.25 s, with about 1.5% critical damping in each mode. Free acceleration responses to initial conditions of x(0) = [0, 0, 0]T and
x(0)
= [1, 1, 1]T using the HHT- method with time steps of 0.001 s (black solid) and 0.1 s
(blue dash-dot), and values of of 0.0 (left) and 0.1 (right) are shown below.
10
10
= 0.00
= 0.10
5
accel #1, mm/s2
-5
-5
-10
-10
0
6
time, s
10
10
time, s
For the = 0 cases, the response computed with h = 0.1 s has a magnified short-period
response as compared to the h = 0.001 s case. For = 0.1 and h = 0.1 s, the response
is more heavily damped especially the response at the shorter periods. Also, the responses
simulated with = 0.1 and h = 0.1 s has a longer period than the systems true fundamental
period of 1.0 s. Note that the linear acceleration method ( = 0, = 1/6, = 1/2) would be
numerically unstable for this system with a time step of 0.1 s.
A more formal analysis of numerical damping, stability, and period lengthening effects
in explicit numerical integration methods can be carried out by examining the eigenvalues of
the discrete time dynamics matrix, A, in equation (3).
(43)
(44)
R(x(t),x(t))
yield .
f(x, x > 0)
K hi
xy
K lo
d
x y (1 Khi / Klo)
x y (K hi / K lo 1)
d
x(t)
yield .
f(x, x < 0)
10
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
6
3
M + C +K ,
2
h
h
(45)
and
#
"
6
h
fi (xi ) = fiext R(xi + xi , x i + x i ) + R(xi , x i ) + 3M + C xi + M + 3C x i . (46)
2
h
1. The initial value for xi is denoted xi and is arbitrarily set to zero. The corresponding
value for fi is
(0)
fi (xi )
"
6
h
+ 3M + C xi + M + 3C x i
2
h
fiext
(47)
xi
1 fi (xi(n) )
=K
(48)
where
(n)
(0)
(n)
(n)
fi (xi ) = fi (xi ) R(xi + xi , x i + x i ) + R(xi , x i ),
and
(n)
x i
3 (n)
h
xi 3x i xi .
h
2
(49)
(50)
3. Equation (48) is iterated upon until the incremental displacement xi converges, i.e.,
(n+1)
(n)
||xi
xi || < .
The convergence of this form of the Newton-Raphson method depends on the local
smoothness of R(x, x).
Convergence can be improved, for a particular time step, by making
h smaller.
is strongly positive definite; it does not depend on xi ; and it is inverted
Note that K
or factorized only once at the beginning of the simulation. If convergence is problematic,
matrices may be formed, some with small time steps, and factorized prior to
then a set of K
the simulation.
As an alternative to Newton-Raphson iterations, the approximation Ri Ri1 results
in an explicit formulation for the simulation of the response of nonlinear systems, and can
significantly reduce computational time, but with some loss of accuracy.
7
Press, W.H., et al., Numerical Recipes, Cambridge Univ. Press, 1993. http://www.nr.com/
CC BY-NC-ND H.P. Gavin
11
= f ext (t),
(51)
where we have re-named the displacement vector x(t) of equation (1) with r(t). This set
of n second order differential equations may be written as a set of 2n first order differential
equations, as follows:
d
dt
"
r
r
"
0N N
IN N
M 1 K M 1 C
#"
r
r
"
0N 1
M 1 R(r, r)
"
0N N
M 1
f ext (t).
(52)
The vector [rT r T ]T is called the state vector; along with the external forces, it can completely
describe the state of the system at any point in time. State-space models are conventionally
written as
x = Ax + g(x) + Bu,
(53)
where x is the state vector, A is the dynamics matrix, g(x) contains any nonlinear terms in
the equations of state, B is the input matrix, and u is the input to the system. For a linear
structure, g(x) = 0 and the eigenvalues of A contain the complex poles of the system. For
under-damped dynamic systems the poles are complex-valued. The imaginary part of the
pole is the damped natural frequency, and the real part of the pole is the negative of the
natural frequency times the damping ratio.
A convenient feature of state-variable formulations is that first order systems can be easily combined. If components of the structural system have first-order dynamics (for example,
visco-elasticity or Bouc-Wen hysteresis), then the first order dynamics of those components
can be appended to the state vector, and the simulation of the second order structural system
coupled with the first order structural components can proceed in parallel.
The state variable formulation is the most general description of a dynamic system, and
many methods exist for the simulation of state-variable models. A set of these methods has
been implemented in Matlab. See, for example, the Matlab command ode45 .
For large second-order systems (n > 1000), however, the HHT- method is typically
more efficient in terms of memory and speed.
Press, W.H., et al., Numerical Recipes, Cambridge Univ. Press, 1993. Section 16.1 http://www.nr.com/
CC BY-NC-ND H.P. Gavin
12
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
x(0) = xo ,
(54)
from time t to time t+t. Given the state vector x(t), we endeavor to find the state x(t+t).
The solution scheme is illustrated in Figure 1. Within each time-step, the algorithm evaluates
. .
x1 = f ( t, x(t) , u(t) )
t + dt/2
t+dt
(55)
(56)
(57)
(58)
The desired solution, x(t + t), is computed from the four state derivatives
x(t + t) = x(t) + (x 1 + 2(x 2 + x 3 ) + x 4 )
t
,
6
(59)
time is incremented, t = t + t, and the solution marches on. The solution scheme is
implemented in the Matlab function ode4u.m9 . As long as t is shorter than 0.45Tn where
Tn is the shortest natural period in the system, this constant time-step Runge-Kutta method
is stable.
http://www.duke.edu/hpgavin/ode4u.m
CC BY-NC-ND H.P. Gavin
13
%
dxdt
: a f u n c t i o n o f t h e form [ x d o t , y ] = d x d t ( t , x , u , params )
%
which p r o v i d e s t h e s t a t e d e r i v a t i v e g i v e n t h e time , t ,
%
t h e s t a t e , x , e x t e r n a l f o r c i n g , u , and p a r a m e t e r s ;
%
a v e c t o r sy s te m o u t p u t s , y , may a l s o be r e t u r n e d .
%
time
: 1byp v e c t o r o f time v a l u e s , u n i f o r m l y i n c r e a s i n g
%
( or d e c r e a s i n g ) , a t which t h e s o l u t i o n i s computed .
%
x0
: nby1 v e c t o r o f i n i t i a l s t a t e v a l u e s , a t time ( 1 ) .
%
u
: mbyp m a t r i x o f s y st e m f o r c i n g d a t a f o r t h e ode ,
%
sampled a t p o i n t s i n t h e 1byp v e c t o r time .
%
params
: o p t i o n a l parameters f o r the f u n c t i o n dxdt .
%
% Output V a r i a b l e
Description
%
%
time
: i s r e t u r n e d , unchanged .
%
x sol
: the solution to the d i f f e r e n t i a l equation at
%
t i m e s g i v e n i n t h e 1byp v e c t o r time .
%
x drv
: the d e r i v i t i v e of the solution
%
y sol
: a d d i t i o n a l s y st e m o u t p u t s
%
% Henri Gavin , C i v i l and Environmental E n g i n e e r i n g , Duke U n i v s e r s i t y , Jun . 2014
% WH Press , e t a l , Numerical R e c i p e s i n C, 1992 , S e c t i o n 1 6 . 1
30
31
32
33
end
end
34
35
[ dxdt0 , y0 ]
% compute i n i t i a l o u t p u t
36
37
38
n = length ( x0 (:));
m = length ( y0 (:));
% number o f o u t p u t s
%
%
%
%
%
39
40
41
42
43
44
memory a l l o c a t i o n f o r s t a t e h i s t o r y
memory a l l o c a t i o n f o r s t a t e d e r i v a t i v e h i s t o r y
memory a l l o c a t i o n f o r o u t p u t h i s t o r y
the i n i t i a l conditions for the s t a t e s
the i n i t i a l output
45
46
47
48
[ ru , cu ] = s i z e ( u );
% pad u w i t h z e r o s i f i t i s n o t l o n g enough
i f ( cu < points ) , u (: , cu +1: points ) = 0; end
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
f o r p = 1: points -1
% advance t h e s o l u t i o n from p t o p+1
t
= time ( p );
dt
= time ( p +1) - t ;
% t h e time s t e p f o r t h i s i n t e r v a l
dt2
= dt /2;
% h a l f o f t h e time s t e p
[ dxdt1 , y1 ] = f e v a l ( dxdt , t ,
x0 , u (: , p ) , params );
[ dxdt2 , y2 ] = f e v a l ( dxdt , t + dt2 , x0 + dxdt1 * dt2 , ( u (: , p )+ u (: , p +1))/2.0 , params );
[ dxdt3 , y3 ] = f e v a l ( dxdt , t + dt2 , x0 + dxdt2 * dt2 , ( u (: , p )+ u (: , p +1))/2.0 , params );
[ dxdt4 , y4 ] = f e v a l ( dxdt , t + dt , x0 + dxdt3 * dt , u (: , p +1) , params );
x0 = x0 + ( dxdt1 + 2*( dxdt2 + dxdt3 ) + dxdt4 ) * dt /6.0;
x_sol (: , p +1) = x0 (:);
% next s t a t e
x_drv (: , p )
= dxdt1 (:);
% current rate
y_sol (: , p )
= y1 (:);
% current output
i f a l l ( isfinite ( x0 )) , break; end
% f l o a t i n g point error
end
[ dxdt1 , y1 ] = f e v a l ( dxdt , time ( p ) , x0 , u (: , p ) , params ); % f i n a l r a t e & o u t p u t
x_drv (: , p +1) = dxdt1 (:);
% f i n a l rate
y_sol (: , p +1) = y1 (:);
% f i n a l output
% ODE4U
14
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
=
=
=
=
=
=
f (t + a1 t,
f (t + a2 t,
f (t + a3 t,
f (t + a4 t,
f (t + a5 t,
f (t + a6 t,
(60)
(61)
(62)
(63)
(64)
(65)
The fourth order predictor at time t + t, is x4 (t + t), and the fifth order predictor at time
t + t, is x5 (t + t).
x4 (t + t) = x(t) + (x 1 c41 + x 3 c43 + x 4 c44 + x 5 c45 + x 6 c46 )t
x5 (t + t) = x(t) + (x 1 c51 + x 3 c53 + x 4 c54 + x 6 c56 )t
(66)
(67)
The coefficients ai , bij , and cij are provided in Cash and Karps paper. If every term of the
truncation error vector, = |x4 x5 |/|x5 | is less than the required tolerance, tol , then the
solution x5 is considered sufficiently accurate. In this case, x(t + t) is assigned to x5 , t is
assigned to t + t, and the solution marches on. Otherwise, the time step is divided into Nss
sub-steps,11 where
l
h
im
Nss = Nss max max (/tol )1/4 , 1.1 ,
(68)
and Nss is initialized to 1, and de is the round-up operator.
These concepts are implemented in the Matlab function ode45u.m12
10
Cash, J.R. and Karp, A.H., A Variable Order Runge-Kutta Method for Initial Value Problems with
Rapidly Varying Right-Hand Sides, ACM Transactions on Mathematical Software, vol 16, no 3, pp 201-222
(1990). http://www.duke.edu/hpgavin/cee541/Cash-90.pdf
11
Press, W.H., et al., Numerical Recipes, Cambridge Univ. Press, 1993. Section 16.2 http://www.nr.com/
12
http://www.duke.edu/hpgavin/ode45u.m
CC BY-NC-ND H.P. Gavin
15
ode45u.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%
dxdt
: a f u n c t i o n o f t h e form [ x d o t , y ] = d x d t ( t , x , u , params )
which p r o v i d e s t h e s t a t e d e r i v a t i v e g i v e n t h e time , t ,
t h e s t a t e , x , e x t e r n a l f o r c i n g , u , and p a r a m e t e r s
a v e c t o r s y st e m o u t p u t s , y , may a l s o be r e t u r n e d .
time
: 1byp v e c t o r o f time v a l u e s , u n i f o r m l y i n c r e a s i n g
( or d e c r e a s i n g ) , a t which t h e s o l u t i o n i s computed .
x0
: nby1 v e c t o r o f i n i t i a l s t a t e v a l u e s , a t time ( 1 ) .
u
: mbyp m a t r i x o f s y st e m f o r c i n g d a t a f o r t h e ode ,
sampled a t p o i n t s i n t h e 1byp v e c t o r time .
params
: o p t i o n a l p a r a m e t e r s used i n t h e f u n c t i o n d x d t
tolerance
: the desired tolerance constant ( d e f a u l t 0.001)
may be a v e c t o r o f t h e l e n g t h o f x0 , or a s c a l a r
display
: 3= d i s p l a y l o t s o f r e s u l t s ; 2= d i s p l a y l e s s ; 1= even l e s s
Output V a r i a b l e
time
x
x dot
y
:
:
:
:
Description
i s r e t u r n e d , unchanged
the s o l u t i o n to the d i f f e r e n t i a l equation at times
the d e r i v a t i v e to the d i f f e r e n t i a l equation at times
the output of the d i f f e r e n t i a l equation at times
Numerical Example
In this example ode4u.m is used to solve the transient response of an inelastic system
described by the equations:
r(t) + 2n r(t)
+ z(t) = w(t)
z(t)
(69)
1 z 3 sgn(r(t))
r(t)/d
y.
(70)
given by
(
w(t)
=
Ao sin(2t/Tp )
0
0 t Tp
otherwise
(71)
r(t)
r(t)
z(t) w(t)
r(t)
= 2n r(t)
dt
3
z(t)
(1 z sgn(r(t)))
r(t)/d
y.
(72)
These ordinary differential equations are computed in the short m-file inelasSys.m
CC BY-NC-ND H.P. Gavin
16
1
2
3
CEE 541. Structural Dynamics Duke University Fall 2016 H.P. Gavin
4
5
6
7
8
% state
r
=
r_dot =
z
=
vector
x (1);
x (2);
x (3);
...
% displacement response , m
% v e l o c i t y r e s p o n s e , m/ s
% hysteretic variable
9
10
11
12
13
14
% parameters . . .
wn
= p (1);
zeta = p (2);
mu
= p (3);
dy
= p (4);
%
%
%
%
fi = mu * z ;
% inelastic force
n a t u r a l f r e q u e n c y , rad / s
v i s c o u s damping r a t i o
y i e l d f o r c e d i v i d e d by mass , m/ s 2
y i e l d displacement , m
15
16
17
18
19
20
21
% state equations
dxdt = [ r_dot ;
-2* zeta * wn * r_dot - fi - a_g ;
(1 - z 3 * sign ( r_dot )) * r_dot / dy ];
% v e l o c i t y response
% acceleration response
% inelastic force derivitive
% i n e l a s S i m .m s i m u l a t e t h e r e s p o n s e o f a SDOF i n e l a s t i c s y st e m u s i n g ode4u .m
2
3
4
5
6
7
8
9
10
% parameters . . .
g
=
9.81;
k
= 5000;
m
= 100;
zeta =
0.02;
fp
= 95.0;
Tp
=
1.0;
Ao
=
1.0;
%
%
%
%
%
%
%
mu
wn
dy
% y i e l d f o r c e d i v i d e d by mass , m/ s 2
% n a t u r a l f r e q u e n c y , rad / s
% y i e l d displacement
g r a v i t a t i o n a l a c c e l e r a t i o n , m/ s 2
s t i f f n e s s , N/m
mass , kg
v i s c o u s damping r a t i o
plastic force level , N
pulse period , s
p u l s e a m p l i t u d e , m/ s 2
11
12
13
14
= fp / m ;
= sqrt ( k / m );
= fp / k ;
15
16
= [ wn , zeta , mu , dy ];
% v e c t o r o f s y st e m p a r a m e t e r s
17
18
19
20
21
22
% time a x i s d a t a . . .
T = 5;
dt = 0.005;
N = f l o o r ( T / dt );
t = [1: N ]* dt ;
%
%
%
%
23
24
25
% ground a c c e l e r a t i o n i n p u t d i s t u r b a n c e , m/ s 2 . . .
a_g = Ao * s i n (2* pi * t / Tp ); a_g ( f l o o r ( Tp / dt ):end ) = 0;
26
27
28
x0 = [ 0; 0; 0];
% i n i t i a l states : [ displ ; veloc ; inelastic force ]
[t ,x , dxdt , fi ] = ode4u ( inelasSys , t , x0 , a_g , p ); % s i m u l a t e r e s p o n s e u s i n g ode4u
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% P l o t s
%e p s P l o t s = 0 ; i f e p s P l o t s , f o r m a t P l o t ( 1 4 , 7 , 4 ) ; e l s e f o r m a t P l o t ( 0 ) ; end
f i g u r e (1)
plot ( t , x (1 ,:) , t , x (2 ,:) );
ylabel ( response )
xlabel ( time , s )
legend ( displacement response , m , velocity response , m / s )
%i f e p s P l o t s , p r i n t ( i n e l a s S i m 1 . eps , c o l o r , s o l i d , F H e l v e t i c a : 1 4 ) ; end
f i g u r e (2)
plot ( x (1 ,:) , fi );
xlabel ( displacement , m )
ylabel ( inelastic force / mass , m / s 2 )
%i f e p s P l o t s , p r i n t ( i n e l a s S i m 2 . eps , c o l o r , s o l i d , F H e l v e t i c a : 1 4 ) ; end
17
displacement response, m
velocity response, m/s
0.3
response
0.2
0.1
-0.1
-0.2
0
time, s
1
0.5
-0.5
-1
-0.06
-0.04
-0.02
0.02
0.04
0.06
displacement, m