18.336 spring 2009 lecture 21 Systems of IVP 04/28/09 ⎡ ⎤ u1 (x, t) ⎢ ⎥ . Solution has multiple components: �u(x, t) = ⎣ ⎦ .. m equations um (x, t) Uncoupled (trivial) ut = uxx vt = vxx Solve independently Triangular (easy) (1) ut + uux = 0 (2) ρt + uρx = dρxx Solve first (1), then (2) velocity field density of pollutant Fully Coupled (hard) � � ht + (uh)x = 0 shallow water equations ut + uux + ghx = 0 � � � � h uh ⇔ + 1 2 = 0 u t u + gh x 2 hyperbolic conservation law Linear Hyperbolic Systems Linearize SW � � � h ū + u t g Image by MIT OpenCourseWare. ¯ u: equations around base flow h, ¯ � � � ¯ h h · =0 ū u x Linear system: (∗) �ut + A · �ux = 0 � � ū h̄ SW: A = g ū A ∈ Rm×m � ¯ λ = ū ± gh (∗) is called hyperbolic, if A is diagonalizable with real eigenvalues, and strictly hyperbolic, if the eigenvalues are distinct. A = R · D · R−1 ; change of coordinates: �v = R−1 · �u ⇒ �vt = D · �vx = 0 Decoupled system (vp )t + λp (vp )x = 0 ∀p = 1, . . . , m ⇒ vp (x, t) = vp (x − λp t, 0) Simple wave Solution is superposition of simple waves Numerics: Implement simple waves into Godunov’s method. 1 Wave Equation 1D utt = c2 uxx � � � � � � u 0 c u ⇔ ∂t = ∂x v c 0 v Ex.: Maxwell’s Equations � Et = cHx Ht = cEx � Ett = (Et )t = (cHx )t = c(Ht )x = c(cEx )x = c2 Exx ⇒ Htt = · · · = c2 Hxx Schemes based on hyperbolic systems � � � � � � � � ϕ=u+v ϕ c 0 ϕ ϕt − cϕx = 0 → ∂t ·∂x → = ψ =u−v ψ 0 −c ψ ψt + cψx = 0 Upwind for ϕ, ψ: ⎧ ϕj n+1 − ϕj n ϕj+1 n − ϕj n ⎪ ⎪ ⎨ = c Δt Δx n+1 n n n ⎪ ψ − ψ ψ j j − ψj−1 ⎪ ⎩ j = −c Δt Δx u = 12 (ϕ + ψ) and v = 12 (ϕ − ψ) � � � � Ujn+1 − Ujn 1 ϕj n+1 − ϕj n ψj n+1 − ψj n c ϕj+1 n − ϕj n ψj n − ψj−1 n = + = + Δt 2 Δt Δt 2 Δx Δx � n � n n n c Uj +1 − Uj Vj+1 n − Vj n Uj − Uj −1 Vj n − Vj−1 n − = + + 2 Δx Δx Δx Δx n n n n n Vj+1 − Vj−1 cΔx Uj +1 − 2Uj + Uj −1 · =c + 2Δx 2 Δx2 Ujn+1 − Ujn−1 cΔx Vj+1 n − 2Vj n + Vj−1 n Vj n+1 − Vj n · = ··· = c + Δt Δx 2 Δx2 Lax-Friedrichs-like Scheme for u, v: � � �� � �� � � � �n � � � n+1 � �n n cΔx Uxx U U 0 c U U 1 1 · − = − + Δt V j c 0 2Δx V j+1 V j−1 Vyy V j 2 � �� � artificial diffusion Stable (check by von-Neumann stability analysis). More accurate schemes: Use WENO and SSP-RK for ϕ, ψ. 2 Leapfrog Method utt = c2 uxx Ujn+1 − 2Ujn + Ujn−1 Ujn+1 − 2Ujn + Ujn−1 2 → = c Δt2 Δx2 (Two-step method) Accuracy: utt + 12 utttt Δt2 − c2 uxx − 1 2 c uxxxx Δx2 12 = O(Δt2 ) + O(Δx 2 ) (using utt − c2 uxx = 0) second order Stability: ikΔx G2 − 2G + 1 − 2 + e−ikΔx 2 e = c G Δt2 Δx2 cΔt r= Δx Courant number ⇒ G2 − 2G + 1 = 2r2 (cos(kΔx) − 1) · G ⇒ G − 2 (1 − r2 (1 − cos(kΔx))) ·G + 1 = 0 � �� � =a √ ⇒ G = a ± a2 − 1 If |a| > 1 ⇒ one solution √ with |G| > 12 ⇒ unstable If |a| ≤ 1 ⇒ G = a ± i 1 − a2 ⇒ |G| = a2 + (1 − a2 ) = 1 ⇒ stable Have 1 − cos(kΔx) ∈ [0, 2], thus: |a| ≤ 1 ⇔ |r| ≤ 1 Leapfrog conditionally stable for |r| ≤ 1. Staggered Grids � � � � � � u 0 c u ∂t = ∂x v c 0 v Image by MIT OpenCourseWare. Collocation Grid Staggered Grid Central differencing requires artificial diffusion Central differencing comes naturally 3 ⎧ n+1 Uj − Ujn Vj n − Vj−1 n ⎪ ⎪ ⎨ = c Δt Δx n+1 n+1 n+1 n ⎪ U − Vj ⎪ j+1 − Uj ⎩ Vj = c Δt Δx Both are explicit central differences. Two step update: Image by MIT OpenCourseWare. � � n+1 n−1 Ujn+1 − 2Ujn + Ujn+1 1 Uj − Ujn Ujn − Uj − = Δt2 Δt Δt Δt � n � � n � c Vj − Vj−1 n Vj n−1 − Vj−1 n−1 c Vj − Vj n−1 Vj−1 n − Vj−1 n−1 − − = = Δt Δx Δx Δx Δt Δt � � n n n n n n n Uj − Uj −1 Uj +1 − 2Uj + Uj −1 c2 Uj +1 − Uj − = = c2 Δx Δx Δx Δx2 Equivalent to Leapfrog. 4 MIT OpenCourseWare http://ocw.mit.edu 18.336 Numerical Methods for Partial Differential Equations Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.