Numerical Laplace Transform inversion Partial fraction expansion is a popular method to find inverse Laplace transform. However it requires finding poles and residues. Finding poles is expensive and inaccurate. Here, we will discuss a numerical method for inverse Laplace transform calculation based on Padé approximation. From the definition of inverse Laplace transform we have (i) v( t ) 1 2j c j st v ( s ) e ds c j If we want to avoid evaluation of poles we mist approximate the integrand. Approximation of v(s) is not good since it will have to be repeated for each st new function. Instead we approximate e using Padé approximation (with z = st) N e z R N1M (z) PN (z) Q M (z) a z i 0 M b z i 1 i i i i 1 Using this result we can replace (i) by 1 v( t ) (ii) 2jt c ' tj z z v e dz t c ' j Padé approximation is found by expanding ez and R N1M in Taylor series and comparing first (M + N + 1) terms. The solution is known in the closed, analytical form giving N i z ( M N i ) ! i 0 i M M (z) i ( M N i )! i 0 i N R N1M Result for first few N & M values are shown in Table 10.1.1. Using Padé approximation we approximate v(t) by v (t ) c ' j 1 z v( t ) v R N1M (z)dz 2jt c ' j t if M N 2 (iii) z v c t R N1M (z)dz 2j (residue at poles inside the closed path) + if path C is closed in the left half plane - right (clockwise) Since M Ki R N1M (z) i 1 z z i 10.1.2 ki, zi known from Table zi does t then closing the path C clockwise ( v have poles in o.h.p) we have (iv) where M1 1 1M z v( t ) Re k 1i v i t i 1 t M & k 1i 2k i 2 t 0 for M even Example Find v(t) for t - 0.1 and v(s) 2s 3 s 1s 2 exact solution t 2 t v( t ) e e Solution Select M = 2 N = 0 from Table 10.1.2 z1 1 j K i 2 j M1 1 not use z1/t = 10 + 10j in (v) to obtain 1 2 j 23 20 j 40 j 46 v(t ) Re 10 Re 1.72465 t 11 10 j 12 10 j 32 j 230 the exact value v(t) = 1.72357 (for t = 0.1) While the method is good for nonperiodic excitations the error grows with + for periodic excitations. To improve accuracy we may use stepping algorithm. Properties of the method By closing the path C to the left we can prove that 1. Formula (iv) inverts exactly the function V (s ) 1 sm for M N 2 m M N 1 2. Formula (iv) inverts exactly the first M + N + 1 terms of the Taylor expansion of any time response. 10.3 Application Derivatives of time domain responses can be obtained from the transform L v (n) n (t ) s v s v k 1 (0) s n k n k 1 and using (v) with v replaced by z t n z z V t t we have n 1 M zi zi v ( t ) k i V t i 1 t t (n) t>0 (n) [note that the 2nd term doesn't contribute to v (t) t 0 ] Newton-Raphson iteration can be used to find time when function raises to a specific value A (important for event driven simulation). A V ' (t k ) k V (t ) tk t k 1 a zi k At i k k v t A k i 1 t M t k 1 zi zi k k v t i k v k t t i 1 t k 1 M k v t The method can also be used to find time domain sensitivities from the frequency domain sensitivities. Let v(s) F(s) W (s) 1M z z v( t ) 1 k i F i W i t i 1 t t and Let F(s) depend on a parameter h. Then time domain sensitivities can be obtained using M frequency domain sensitivities as follows zi F v( t ) 1 M t ki h t i 1 h W z i t Example 10.3.1 Calculate time domain sensitivities of v2 wrt network elements. Input J(t) = 1(t), skip size h = 0.1. Use M = 2 N = 0 with z = 1 + j , k1 = -2j C = 1 G1 =1 J=1 /S G2 V =1 2 t 1 2 exact solution v 2 ( t ) 2 e v 2 ( t ) 1 t 1 e 2 G 1 4 2 t 0.1 0.4756147123 t t 0.1 0.249697723 v 2 ( t ) t 2 e 0.0237807356 C 4 t From analysis v1 (s) s 1 1 & v 2 (s) 1 1 2s s 2 s 2 2 Adjoint system sC v1a 0 G1 sC a yields sC G 2 sC v 2 1 v1a (s) s 1 2 s 2 (s 1) v a2 (s) 1 2 s 2 so the frequency domain sensit (Ch. 6) 1 v 2 (s 1) L 1 t 2 a 1 v1 v1 1 e 2 G 1 4 2 1 n s 2 L1 v 2 1 t a a s v1 v 2 v1 v 2 e t / 2 2 C 4 1 4 s 2 Using the numerical evaluation of t v 2 ( t ) v (t ) & 2 G1 C are as follows v 2 ( t ) g j10 2 j 0.2496885962 1 1 (s 1) Re k 10 Re 2 s z i 10 j10 2 G 1 t 4 10 . 5 j 10 1 t 4 s 2 v 2 ( t ) 1 1 Re k 1 2 C t 1 4 s 2 s 10 j10 10 Re 2j 0.0237575355 4(10.5 j10) 2 Stepping algorithm To increase accuracy of numerical inversed Laplace transform we "reset" the problem after each step in time. Consider system equs TC (s)X C WC (s) I (1) where TC (s) G sC , c denotes complex vectors and matrices I vector of initial conditions Civi0 or -LiIi0 substituting x(t) for t = h s zi h we can solve (1) to obtain solution 1 1M x Re k 1i X Ci h i 1 x Ci zi xC h for the next step the vector I is obtained from I = Cx If step h does not change then LU factorization of the TC(s) can be used for all time steps( as Tc (s) does not change). For the rational transfer function M v(s) F(s) W (s) N(s) W (s) D(s) a s a 1 i i 1 n s b i s i 1 i 1 define an auxiliary system x 1 (s) 1 W(s) D(s) so D(s)x1 (s) W(s) (2) then V(s) N(s)X1 (s) Equation (2) can be solved for X1 as follows s n b n s n ... b1 X1 (s) W(s) introduce x1, x2, . . . xn x 11 x 2 x 12 x 3 . . . x 1n W b n x u b n 1 x n 1 ... b1 x 1 In the matrix form (for n = 4) x 1' 0 ' x 2 0 x 3' 0 ' x 4 b1 1 0 0 1 0 b2 0 b3 0 0 1 b4 x 1 0 x 0 2 W x 3 0 x 4 1 or x 1 Ax Bw is s-domain sX - I0 = AX + BW (s1 - A)X = BW + IC (3) initially IC = 0, and (3) can be solved using the stepping algorithm similarly like (1). Algorithm implementing solution of (3) is shown in Fig. 10.4.1 Stability 1 is tested on a differntial equation x x using Laplace transform sX x 0 x X x0 s from (*) (inverse Lapl. tr.) M x0 ki 1 M x1 k x i 0 h i 1 z i i 1 h z i h M for z = utiv= h x1 x 0 i 1 . . . ki z zi M ki x n x 0 i 1 z z i M ki 1 stable if z z i 1 i or n R N1M (z) 1