PDEs & Parabolic problems Jacob Y. Kazakia © Partial Differential Equations Linear in two variables: Usual classification at a given point (x,y): From the numerical point of view Initial Value Problem ( time evolution) Hyperbolic or Parabolic Boundary Value Problem ( static solution) Elliptic Computational Concern: Initial Value Problem : Stability Boundary Value Problem: Efficiency
PDEs & Parabolic problems Jacob Y. Kazakia © Parabolic PDEs insulated rod time line x = 0 x = L x axis T = 0 o at all times T = 0 o at all times T = T 0 f ( x ) at time = 0 What is the temperature later ? T(x,t) T(x+ x,t) x area A heat flux in heat flux out heat flux in = heat flux out = Balance equation:
PDEs & Parabolic problems Jacob Y. Kazakia © nondimensionalization
PDEs & Parabolic problems Jacob Y. Kazakia © Numerical Solution x = 0 u = f(x) x = L u = g 1 (t)u = g 2 (t) u t = u xx consider a grid: this results in an explicit method: where
PDEs & Parabolic problems Jacob Y. Kazakia © Stencil for explicit solution h h k
PDEs & Parabolic problems Jacob Y. Kazakia © Example - Instability then using we obtain the following results rational arithmetic rounded to one decimal u 1 =3*0 - 5(1/3) + 3*(2/3) = 1/3 u 2 =3*(1/3) - 5(2/3) + 3*1 = 2/3 u 3 =3*0 - 5(1/3) + 3*(2/3) = 1/3 u 4 =2/3.. Solution : u = x ( satisfies all conditions) u 1 =3*0 - 5(.3) + 3*(.7) =.6 u 2 =3*(.3) - 5(.7) + 3*1 =.4 u 3 =3*0 - 5(.6) + 3*(.4) = -1.8 u 4 =+2.8 u 5 = 17.4 u 6 = u 7 = u 8 = Unstable results u = 0 u = 1/3 u = 2/3 u = 1 x = 1 u=0u=1 t x
PDEs & Parabolic problems Jacob Y. Kazakia © Instability - reasons/conditions x = a u = u=0 t x u 1 = (1 - 2 ) u 2 = (1 - 2 ) 2 u 3 = (1 - 2 ) 3 .. u n = (1 - 2 ) n for physically sensible results we must have (1 - 2 ) positive and less than one
PDEs & Parabolic problems Jacob Y. Kazakia © Stable solution- the Implicit method (x, t) hh k (x+h, t)(x-h, t) (x, t - k)
PDEs & Parabolic problems Jacob Y. Kazakia © Example on Implicit method u =.3u =.7 u=0u=1 t x k = h = 1 / 3, = 3, = 7 for the points 1 and 2 at the first level up we obtain 3 * u u 2 = u u * 1 = using one decimal digit arithmetic the solution of this system is: u 2 =.7 and u 1 =.3 Stable and consistent method.
PDEs & Parabolic problems Jacob Y. Kazakia © Crank - Nicholson Method A h k This is more accurate without increasing the work considerably. Same form LHS of the equation
PDEs & Parabolic problems Jacob Y. Kazakia © A Boundary Value Technique 1 here U(x) is the solution of the problem for t large summarized on the right solve the problem and get U(x)
PDEs & Parabolic problems Jacob Y. Kazakia © A Boundary Value Technique 2 we can then write the finite difference analog of the equation using the stencil 0 u(x,t)1 u(x+h,t) u(x-h,t) 3 2 u(x,t+k) 4 u(x,t-k) see example next slide
PDEs & Parabolic problems Jacob Y. Kazakia © B V T Example 1 the exact solution of this problem is: ( differentiate and substitute to prove that this is indeed the case) As time tends to large values the problem simplifies to: U xx = x U x with U(0) = 0 and U(1) = 0 which has the trivial solution U = 0 everywhere We choose T = 2 ( this is our approximation to large time) and we use k = h = 1/3
PDEs & Parabolic problems Jacob Y. Kazakia © B V T Example 2 (0,2) (0,5/3) (0,4/3) (0,1) (0,2/3) (0,1/3) (0,0) (1/3,0)(2/3,0)(1,0) (1,1/3) (1,2/3) (1,1) (1,4/3) (1,5/3) (1,2) (1/3,2)(2/3,2) u=0 t x u=1/3u=2/3 u=1 u=e -1/3 u=e -2/3 u=e -1 u=e -4/3 u=e -5/3 u=e -2 = we now write the finite difference equations for each of the 10 points and we obtain 10 equations to be solved simultaneously. This produces a solution which agrees with the exact one in two decimal places The first two equations ( points 1 and 2 ) are: verify this
PDEs & Parabolic problems Jacob Y. Kazakia © Two Dimensional Diffusion Equation 1 n+1 2 n+1 5 n+1 0 n+1 6 n+1 3 n+1 7 n+1 4 n+1 8 n+1 A 1n1n 2n2n 5n5n 0n0n 6n6n 3n3n 7n7n 4n4n 8n8n Try to implement Crank- Nicholson Scheme on this problem We must write one such equation per each interior point and then solve the system at each time step.
PDEs & Parabolic problems Jacob Y. Kazakia © Two Dimensional Diff. Eqn Cont. We must write one such equation per each interior point and then solve the system at each time step. finite difference equivalent Difficulty: Large system of equations which is sparse but not tridiagonal or even banded Remedy: ADI method ( Alternating Direction Implicit solution) a) write the above equation in the form: b) divide each time step into two steps of size t/2. In each sub step, treat a different dimension implicitly i.e. Advantage: at each sub step only a tridiagonal system is solved