Handout # 6 (MEEN 67) Numercal Integraton to Fnd Tme Response of SDOF mechancal system State Space Method The EOM for a lnear system s M X + DX + K X = F() t () t = X = X X = X = V wth ntal condtons, at 0 ( 0 ) ; ( 0) o o o Defne the followng varables, Y= X; Y = X () and wrte EOM () as two frst-order Eqs. M Y + DY + KY = F() t & Y = Y (3) whch can be wrtten n matrx form as Y 0 Y 0 = Y + M K M D Y M F (4) Or, Y = AY+ b (5) Y = X 0 0 wth Y= ; ; Y X A= = M K M D b = M F Ths s known as the state-space formulaton. Eq. (5) s to be ntegrated numercally wth ntal condton vector Y = X V [ ] T o o o MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008
If the appled load s NOT a functon of tme, then an equlbrum state s defned after a very long tme as Y 0 YE = A bo (6) Computatonal software such as Mathcad, Mapple, Mathematca, Matlab, etc has bult-n functons or commands to perform the numercal ntegraton of equatons set n the form Y = AY+ b, even when system s nonlnear,.e. A=A(Y). A few words about numercal ntegraton methods Typcal numercal ntegraton methods nclude a) Euler (smple) method b) Fourth and Ffth-Order Runge-Kutta ntegrators, c) Rosenbrock Method see references on page, d) Adams Predctor Corrector Methods e) Average Acceleraton and Wlson-θ (Implct) Methods In most methods, the selecton of an adequate tme step s crucal for numercally stable and accurate results. (a)-(b) are favored by the young ntates nto numercal computng and because of ther ready avalablty n modern computatonal software. (c) (d) are more modern (mplct) methods wth automated ntermedate reszng of the tme step whle performng the ntegraton. Methods (e) have long been favored by structural mechanc analysts when ntegratng Multple DOF (lnear) systems All methods suffer from defcences when nonlneartes are apparent thus forcng extremely small tme steps and the ensung MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008
cost wth lots of numercal computng (tme). (Memory) Storage appears not to be an ssue anymore. State-space method for MDOF systems. Recall the EOMS for a lnear system are where MU+DU+KU () t =F() t (7) U,U, and U are the vectors of generalzed dsplacement, F s the vector of velocty and acceleraton, respectvely; and () t generalzed (external forces) actng on the system. M,D,K represent the matrces of nerta, vscous dampng and stffness coeffcents, respectvely. Defne the followng varables, Y=U ; Y=U and wrte EOM (7) as a set of n-frst-order Eqs. (t) (8) MY +DY +KY =F & Y =Y (9) whch can be wrtten n matrx form as Y 0 I Y 0 = - - + - Y -M K -M D Y -M F (0) Or, Y = AY+ b () U 0 I 0 wth Y= ; A= ; b= - - - U -M K -M D M F () The matrces are square wth n-rows = n columns, whle the vectors are n- rows. MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 3
and ntal condtons Y( t= 0) = Uo U o. A s a n x n matrx. I s the nxn dentty matrx, and 0 s a nxn matrx full of zeroes. Condtons for a good numercal ntegrator In general a numercal ntegraton scheme should a) reproduce EOM as tme step 0 b) provde, as wth physcal model, bounded solutons for any sze of tme step,.e. method should be stable c) reproduce the physcal response wth fdelty and accuracy. The numercal ntegraton reles n representng tme dervatves of a functon wth an algebrac approxmaton, for example T dx Δ x x = = lm dt Δ t 0 xt+ xt x x x ~ Eq. above s exact only f 0 + (3) Numercal ntegraton methods are usually dvded nto two categores, mplct and explct. x = f x, t (4) Consder the ODE In an explct numercal scheme, the ODE s represented n terms of known values at a pror tme step,.e. x = x +Δ + t f x, t, (5) MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 4
whle n an mplct numercal scheme x, + x t f x+ t = +Δ (6) Explct numercal schemes are condtonally stable. That s, they provde bounded numercal solutons for (very) small tme steps. For example, Tn τ crt = (7) π π where T and K n= ωn = M are the natural perod and natural ωn frequency of the system, respectvely. The restrcton on the tme step s too severe when analyzng stff systems,.e. those wth large natural frequences. Implct numercal schemes are uncondtonally stable,.e. do not mpose a restrcton on the sze of the tme step Δ t. (However, accuracy may be compromsed f too large tme steps are used). ANALOGY between numercal schemes and a flter A few words of wsdom released n class MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 5
The average acceleraton method for numercal ntegraton of SDOF equaton: M X + DX + K X = F() t () Consder a change of thnkng frame by defnng Arthmetc ~ Contnuum (functon) X X t, F F t,, X X t F F t + + + + (7) Wrte Eq. () at two tmes, t = t M X + DX + K X = F (8a) at t = t M X + DX + K X = F (8b) at + + + + + Subtract (b) from (a) to obtan: where M Δ X + DΔ X + KΔ X =ΔF (9) + Δ X = X+ X Δ F= F+ F, Δ X = X X, etc. Note that known quanttes at t=t are{ X, X, X} (0) Ths numercal method s extremely popular among the structural dynamcs communty. Its extenson to MDOF systems wll be shown later. The other favorte method, Wlson-θ scheme, wll also be gven n later lectures (MDOF systems). MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 6
Now, assume the acceleraton s constant wthn the tme nterval Δ t = t t + ( τ) for 0 () X = a < τ set as an average value a= X + + X. The velocty and dsplacement follow from ntegraton of Eq. (6) wthn the tme nterval,.e. ( τ ) = + X X a τ (a) ( τ ) = + τ + τ X X X a (b) Acceleraton velocty X + X X ( τ ) = a X + X ( τ ) = + X X a τ τ t t + t τ t t + t dsplacement X + X τ = X + X τ + a τ X τ t t + t MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 7
At the end of the tme nterval, the velocty and dsplacement equal X = X Δ t = + X + a Δ t (3a) X = X Δ t = X + + X Δ t + a Δ t (3b) And the dfferences n velocty and dsplacement re ( + ) ( + ) ( X X X + ) t ( X X ) t Δ X = X X = a Δ t = X + X = + Δ = = +Δ Δ Δ X = X X = X Δ t + a + ( + ) = X Δ t + Δ t X + X X + X 4 = X Δ t + Δ X + X 4 (4a) (5b) 4 (6a) from (5b), Δ X = X+ ( ΔX X) and nto (4a) ( ) Δ X = X +ΔX 4 = X X + ( ΔX X ) MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 8
Δ X = ΔX X (6b) Note that n Eqs (6), { ΔX, ΔX } obtaned at the pror tme step,.e. { X, X } Δ X. Thus, replace { ΔX, ΔX }, depend on the known values and the unknown nto the dfference equaton (9), M Δ X + DΔ X + KΔ X =ΔF 4 M X + ( ΔX X Δ t ) + D ΔX X + KΔ X =ΔF Rearrangng terms leads to where K Δ X =Δ F (7) * * * 4 K = K+ D+ M (8a) * 4 Δ F =Δ F+ M X + D+ M X (8b) are known as pseudo dynamc stffness and dynamc force, respectvely The recpe for the numercal ntegraton to fnd the system tme response s MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 9
At tme t, known varables are { X, X } (current state) () fnd from EOM: X = M ( F DX K X) () form pseudo stffness and forcng functons, ( K *, F) Eqs. (8), * (3) Calculate Δ X = K Δ F, and (4) X + = X+Δ X, X + = X +ΔX at t + (5) Increase tme to t + and return to step () Δ from Δ X = ΔX X ; The average acceleraton method s an mplct method,.e. numercally stable and consstent. The dsadvantage s that t requres memory 3 to store X, X, ΔX, ΔX, ΔF. Average acceleraton methods for numercal ntegraton of a nonlnear system Consder the system wth EOM where g( X, X) ( 3 ) o o 3 M X + g X, X = F( t) (30) s a nonlnear functon, for example g X, X = g + k X + k X + F sgn( X ) As wth the lnear system, evaluate Eq. (30) at two tmes (closely spaced): at t = t M X + g X, X = F (3a) μ 3 A non-ssue n the st century MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 0
at t = t M X + g X, X = F (3b) + + + + + Subtract (b) from (a) to obtan: where (3) M Δ X + g g =ΔF + Δ X = X X Δ F = F F, + + (, ), (, + + + ) g = g X X g = g X X (33) A Taylor seres expanson of the nonlnear functon at t gves g g g = g + Δ X + Δ X + O ΔX ΔX (, ) + X X X, X = 0 X (34) defne local lnearzed stffness and dampng coeffcents as Hence, K g = ; D = X g X, X X X, X g g K Δ + X + D Δ X (35) and the dfference Eq. (3) becomes lnear M Δ X + D Δ X + K Δ X =ΔF (36) Eq. (35) s formally dentcal to the one devsed for a lnear system. Thus, the numercal treatment s smlar, except that at each tme MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008
step, lnearzed stffness and dampng coeffcents need be calculated. The recpe s thus dentcal; however wth the apparent nonlnearty, the method does not guarantee stablty for (too) large tme steps. The recpe for the numercal ntegraton to fnd the system tme response s (current state) At tme t, known varables are { X, X } () fnd from EOM: X = M F g( X, X ) (a) fnd local (lnearzed) stffness and dampng coeffcents, (K, D ) from eq. (35) K *, Δ F from (b) form pseudo stffness and forcng functons, ( ) * 4 K = K+ D + M * (3) Calculate ; * 4 Δ F =Δ F + M X + D + M X Δ X = K Δ F, and Δ X = ΔX X ; X = X +Δ X, X = X +ΔX at t + (4) Set + + (5) Increase tme to t + and return to step () References The followng are a must! Press, W.H., Flannery, B.P., Teukolsky, S.A., and Vetterlng, W.T., 986 ( st edton), Numercal Recpes, The Art of Scentfc Computng, Cambrdge Unversty Press, UK. Bathe, J-K, 98 ( st ed), 007 latest, Fnte Element Procedures, Prentce Hall. Pche, R., and P. Nevalanen, 999, Varable Step Rosenbrock Algorthm for Transent Response of Damped Structures, Proc. IMechE, Vol. 3, part C, Paper C05097. MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008
Rosenbrock, H.H., Some General Implct Processes for the Numercal Soluton of Dfferental Equatons, Appendx A 4 Numercal Integraton Usng Modfed Euler s Method It s often dffcult to solve (exactly) a nonlnear dfferental equaton. Numercal ntegraton s then employed to obtan results (predctons of moton). The Modfed Euler Method s one type of numercal ntegraton scheme. Solve for q(t) governed by M q + Cq + Kq= Q( q, q, t) (A.) wth ntal condtons q0and q 0at t = 0. In Eqn. (A.), Qq (, qt, ) may contan terms that are nonlnear n Let V dq dt = (A.) and wrte Eq. (A.) as a system of TWO frst order dfferental equatons,.e. C K Q( q, V, t) V = V q +, M M M q = V (A.3) 4 Ths Appendx s ncluded because most young engneerng students have learned only about Euler s method. Hence, the appendx complements ther educaton.. However, I encourage you to abandon the usage of ths poor method. MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 3
Defne K C ωn = andζ = (A.4) M K M as the natural frequency and vscous dampng rato, respectvely. Wth the noted defntons Eqs. (A.3) become dv Q( q, V, t) V = = F ( q, V, t) = ζωnv ωn q + dt M dq q = == F ( q, V, t) = V dt (A.5) Note that F and F are the slopes of the (V vs t) and (q vs t) curves, respectvely. q(t) V(t) q+ V q V+ t t t+ t t+ t Let the numercal approxmatons (arthmetc values) be,and V V t q q t (A.6) t = ; = and Δ t s a sutably small tme step for numercal ntegraton. where 0,,... F q+ In Euler s numercal scheme, approxmate the tme dervatves (or slopes) as: q V F V+ MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 4
V V +Δ t f, f = F q, V, t, + q q +Δ t f, f = F q, V, t + for =,.. (A.7) wth ntal condtons q0and q 0at t 0 = 0 Eq. (7) offer a recursve relaton to calculate the numercal (arthmetc) values of the varables V and q at successve tmes t). The regular Euler method s frst order wth a truncaton error of order ( ). A modfed Euler method (second order accurate) wth error order ( 3 ) follows: (a) Compute prelmnary estmates of ( V, q ) (,, ) V V +F q, V, t, + q q +F q V t + + + as (A8.a) (b) Use these prelmnary estmates to obtan mproved slopes as + + ( + + + ) ( + + + ) f = F q, V, t, f = F q, V, t, (A8.b) (c) Defne average slopes as per f = f + f f = f + f + + (A8.c) MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 5
(c) and obtan new estmatons usng the averaged slopes,.e. V V + f + q q + f +, (A8.d) (d) Repeat steps (a) through (d) at each tme step, t= Δ t ; = 0,,..., and startng wth the ntal condtons q and q at t = 0 0 0 0 The sze of the tme step s very mportant to obtan accurate and numercally stable results. If s too large, then numercal predctons wll be n error and very lkely show unstable (oscllatng) results. If s too small, then the numercal method wll be slow and costly snce the number of operatons ncreases accordngly. In practce, a tme step of the order =T n /60, where T n s the natural perod of moton gven as (π/ω n ). Euler s method s most tmes NOT a good choce to perform the numercal ntegraton of lnear or nonlnear ODES. Alas, t s wdely used by rooke engneers and engneerng students because t s easy to mplement. Often enough, however, predctons can be wrong and msleadng. I call Euler s method a BRUTE FORCE approach, Often regarded as an art, numercal computng s n actualty a well establshed branch of mathematcs. MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 6
MEEN 67 HD 6 Numercal Integraton for Tme Response: SDOF system L. San Andrés 008 7