Introduction to Simulation - Lecture 15 Methods for Computing Periodic Steady-State Jacob White Thanks to Deepak Ramaswamy, Michal Rewienski, and Karen Veroy
Outline Periodic Steady-state problems Application examples and simple cases Finite-difference methods Formulating large matrices Shooting Methods State transition function Sensitivity matrix Matrix Free Approach
Periodic Steady-State Basics Basic Definition () dx t dt = F x() t + u { { () t state input Suppose the system has a periodic input T 2T 3T t Many Systems eventually respond periodically x( t+ T) = x( t) for t >> 0
Periodic Steady-State Basics Basic Definition Interesting Property If x satisfies a differential equation which has a unique solution for any initial condition dx t dt ( ()) u() t = F x t + Then if u is periodic with period T and ( + ) = 0 0 0 x( t + T ) = x( t) for all t > t0 x t T x t for some t
Periodic Steady-State Basics Application Examples Swaying Bridge Periodic Input Wind Response Oscillating Platform Desired Info Oscillation Amplitude
Periodic Steady-State Basics Application Examples Communication Integrated Circuit Periodic Input Received Signal at 900Mhz Response filtered demodulated signal Desired Info Distortion
Periodic Steady-State Basics Application Examples Automobile Vibration Periodic Input Regularly Spaced Road Bumps Response Car Shakes Desired Info Shake amplitude
Periodic Steady-State Basics RLC Circuit Simple Example RLC Filter, Spring+Mass+Dashpot Spring-Mass-Dashpot Force Both Described by Second-Order ODE 2 d x dx M + D + x= u() t dt 2 dt { input
Periodic Steady-State Basics Simple Example RLC Filter, Spring+Mass+Dashpot Cont. Both Described by Second-Order ODE 2 d x dx M + D + x= u() t dt 2 dt u(t) = 0 lightly damped (D<<M) Response D t x() t Ke 2M cos φ + M
Periodic Steady-State Basics Simple Example RLC Filter, Spring+Mass+Dashpot Cont. Ke D 2M A lightly damped system oscillates many times before settling to a steady-state
Periodic Steady-State Basics Computing Steady State Frequency Domain Approach Sinusoidally excited linear time-invariant system dx t dt () e{ i t = Ax t + input Steady-State Solution simple to determine ω () = ( ) 1 i t x t iω A e ω Not useful for nonlinear or time-varying systems
Periodic Steady-State Basics Computing Steady State Time Integration Method Time-Integrate Until Steady-State Achieved dx t dt ( ()) l l 1 ˆ ˆ ( l ˆ ) = F x t + u() t x = x + t F x + u( l t) Need many timepoints for lightly damped case!
Aside Reviewing Integration Methods Solve with Backward-Euler Nonlinear System dx() t = F x() t + u( t) x { { ( 0 ) = x0 dt 14243 state input Initial Condition Backward Euler Equation for timestep l l l 1 l ( ) xˆ xˆ = t F xˆ + u( l t) How do we solve the backward-euler Equation?
Aside Reviewing Integration Methods Forward-Euler 1 ˆ 1 ( ) xt x = x(0) + tf x 0, u 0 xt xˆ = xˆ + tf xˆ, u t 2 1 1 2 1 M L L 1 L 1 ( L) = +, ( ) L 1 xt xˆ xˆ tf xˆ u t Requires just function Evaluations Implicit Methods Backward-Euler Example Backward-Euler ( ˆ ) xt xˆ = x(0) + tf x, u t 1 1 1 1 xt xˆ = xˆ + tf xˆ, u t 2 1 2 2 2 L L 1 L ˆ ˆ ˆ L xt x = x + tf x, u t L M Nonlinear equation solution at each step Stepwise Nonlinear equation solution needed whenever β0 0
Aside Reviewing Integration Methods Implicit Methods Solution with Newton Rewrite the multistep Equation ( t ) k ( l ) l j l j β l + α jx β j tl j l α ˆ ˆ ˆ ˆ 0x t 0f x, u t f x, u = 0 Solve with Newton l, j f xˆ, u( t ) j= 1 j= 1 k b Independent of xˆ l l l, j+ 1 l, j l, j l, j α0i tβ 0 ( xˆ xˆ ) = α ˆ 0x tβ0f ( xˆ, u( tl )) + b x Jacobian ( l, j F x ) Here j is the Newton iteration index
Aside Reviewing Integration Methods Implicit Methods Solution with Newton Cont. Newton Iteration: l, j ( ˆ, ) f x u t l 0 0 ( l j + α I tβ x x l j ) = F x l j x, 1,, ˆ ˆ t l k Solution with Newton is very efficient xˆ l t l 3 t l 2 tl 1 t l l, j ( ˆ, ( tl )),0 xˆ l Converged Solution Polynomial Predictor f x u α0i tβ0 α0i as t 0 x Easy to generate a good initial guess using polynomial fitting Jacobian become easy to factor for small timesteps
Boundary-Value Problem Basic Formulation Periodicity Constraint Differential Equation Solution d N Differential Equations: x i t = F i x t dt () () N Periodicity Cons traints: x T = x 0 i i
Boundary-Value Problem Finite Difference Methods Linear Example Problem dx t dt = Ax t + u t t 0, T x T = x t 14243 () () { [ ] input Discretize with Backward-Euler 1 0 ( 1 xˆ = xˆ + t Axˆ + u( t) ) 2 1 2 xˆ = xˆ + t Axˆ + u 2 t L L 1 L ˆ ˆ ˆ ( ) ( ) x = x + t Ax + u L t t = Periodicity implies xˆ = xˆ L periodicity constraint T L 0
Boundary-Value Problem Finite Difference Methods Linear Example Matrix Form NxL NxL 1 1 1 I A 0 0 I t t xˆ u ( 0) 2 1 1 xˆ u( t) I I A 0 0 t t M = M 0 0 O O M M 1 1 L 0 0 I I A xˆ u( L t) t t Matrix is almost lower triangular
Boundary-Value Problem Finite Difference Methods Nonlinear Problem dx t dt ( ()) () { [ 0, ] = F x t + u t t T x T = x t 14243 input periodicity constraint Discretize with Backward-Euler 1 L xˆ xˆ t( F( xˆ 1 ) + u( t) ) 1 xˆ xˆ 2 xˆ 1 t( F( xˆ 2 ) + u( 2 t) ) 2 xˆ H FD = L ˆ L L 1 L x xˆ xˆ t F xˆ + u L t = 0 M ( ) Solve Using Newton s Method
Boundary-Value Problem Shooting Method Basic Definitions dx( t) Start with = F ( x() t ) + u() t dt And assume x(t) is unique given x(0). D.E. defines a State-Transition Function Φ ( yt,, t) x( t) 0 1 1 where xt is the D.E. solution given x t = y 0
Boundary-Value Problem Shooting Method State Transition function Example dx t dt = λx t () Φ (,, ) ( t t ) yt t e 1 0 y 0 1 λ
Boundary-Value Problem Solve ( ) Use Newton s method Shooting Method Abstract Formulation H x 0 = Φ x 0,0, T x 1442443 0 = 0 xt H ( x,0, T) Φ = J x I H x ( k )( k+ 1 k ) = ( k ) J x x x H x
Boundary-Value Problem Shooting Method Computing Newton ( T) To Compute Φ x 0,0, dx( t) Integrate = F( x() t ) + u() t on [0,T] dt (,0, ) Φ x T What is? x x ( 0) + ε x ( 0) x ε ( T) xt Indicates the sensitivity of x(t) to changes in x(0)
Boundary-Value Problem Φ x,0, T x Shooting Method Sensitivity Matrix by Perturbation ε1 x T x T x T x T ε N 1 1 1 1 ε 1 ε1 x T x T x T x T ε N N N N N ε 1 L L M L L M M L L M L L ε ε N N
Boundary-Value Problem Shooting Method Efficient Sensitivity Evaluation Differentiate the first step of Backward-Euler x ( 0) ( 1 ( 0 ) ( ( 1 ) ) 0 ) xˆ x t F xˆ + u t = ( 0) ( 0) ( ˆ 1) xˆ 1 x 0 F x xˆ 1 t = x x x x I ( ˆ ) ( 0) 1 1 x 0 F x xˆ t = x x( 0) x 0 0 I
Boundary-Value Problem Shooting Method Efficient Sensitivity Matrix Cont Applying the same trick on the l-th step I ( ˆ ) l l l 1 F x xˆ xˆ t = x x x ( 0) ( 0) Φ x,0, T x L l= 1 I t ( ˆl ) F x x 1
Boundary-Value Problem Shooting Method Observations on Sensitivity Matrix Newton at each timestep uses same matrices Φ x,0, T x L l= 1 ( ˆ l ) F x I t x 1442443 Timestep Newton Jacobian Formula simplifies in the linear case Φ x,0, T x ( I ta) L 1
Shooting Method Matrix-Free Approach Basic Setup Start with dx t dt ( ()) ut () = F xt + Use Newton s method ( ) H x 0 = Φ x 0,0, T x 0 = 0 H ( x,0, T) Φ = J x I H x ( k )( k+ 1 k ) = ( k ) J x x x H x
Shooting Method Matrix-Free Approach Matrix-Vector Product Solve Newton equation with Krylov-subspace method ( k x,0, T) Φ I x x = x Φ x T x 14243 1442443 144424443 x b A ( k+ 1 k) k ( k,0, ) Matrix-Vector Product Computation ( x k,0, T) ( x k ε p j,0, T) ( x k,0, T) Φ Φ + Φ x ε j j I p p Krylov method search direction
Shooting Method Matrix-Free Approach Convergence for GCR Example dx Ax dt = Shooting-Newton Jacobian 0 eig A real and negative Φ x,0, T I = e AT I x
Shooting Method Matrix-Free Approach Convergence for GCR-evals λ1t e 1 AT e I = S O S λnt e 1 1 Many Fast Modes cluster at 1 1 Few Slow Modes larger than 1
Summary Periodic Steady-state problems Application examples and simple cases Finite-difference methods Formulating large matrices Shooting Methods State transition function Sensitivity matrix