Research

Explicit and Implicit method

배워서남주냐 2019. 1. 10. 17:12

Explicit and implicit methods are approaches used in numerical analysis for obtaining numerical approximations to the solutions of time-dependent ordinary and partial differential equations, as is required in computer simulations of physical processes.

Explicit methods calculate the state of a system at a later time from the state of the system at the current time, while implicit methods find a solution by solving an equation involving both the current state of the system and the later one. Mathematically, if  is the current system state and  is the state at the later time ( is a small time step), then, for an explicit method

while for an implicit method one solves an equation

to find 

It is clear that implicit methods require an extra computation (solving the above equation), and they can be much harder to implement. Implicit methods are used because many problems arising in practice are stiff, for which the use of an explicit method requires impractically small time steps  to keep the error in the result bounded. For such problems, to achieve given accuracy, it takes much less computational time to use an implicit method with larger time steps, even taking into account that one needs to solve an equation of the form (1) at each time step. That said, whether one should use an explicit or implicit method depends upon the problem to be solved.

By Wikipedia


Let me explain implicit /explicit stuff with a simple heat equation.
Tt = Txx  ............................................................................…(1)                    
(without mentioning the boundary conditions to keep it simple) 
Explicit Scheme:  Is one in which the differential equation is discretized in such a way that there is only one unknown (at new time level n+1) on the left hand side (LHS) of the difference equation and it is computed in terms of all other terms on the RHS which are known (at previous time level n+1). Let us write an Explicit Scheme for eqn (1):
Discretizing time derivative using forward difference and the second order derivative using central difference we get:
(Tjn+1 - Tjn )/ ∆t =  (Tj+1n – 2 Tjn + Tj-1n) / ∆x2
This can be simplified as:
Tjn+1 = (1-2r) Tjn + r(Tj-1n + Tj+1n) ………………………………………..(2)
 where r = ∆t/ ∆x2
This is an explicit scheme called FTCS (Forward differencing in Time and Central differencing in Space at time level n) for solving a 1-D heat equation. Explicit as we see one unknown on LHS (Tjn+1) being calculated in terms on all the term on RHS which are known as they are at previous time level n.
Explicit Schemes have to satisfy stability conditions in order for solution to converge. For example above Explicit Scheme in eqn (2) will be stable if  r ≤ ½.
Implicit Scheme:  Is one in which the differential equation is discretized in such a way that there are multiple unknowns at n+1 time level on the LHS of the equation and the terms on RHS are known ones at n time level. Let us write Implicit Scheme for eqn (1):
(Tjn+1 - Tjn )/ ∆t =  (Tj+1n+1 – 2 Tjn+1 + Tj-1n+1) / ∆x2                     
(discretizing 2nd order derivative at time level n+1 unlike Explicit Scheme where we discretized it at level). We simplify it to:
(1+2rTjn+1 - rTj-1n+1 - rTj+1n+1 = Tjn   …………………………………..(3)
Here we discretized time derivative term in backward differencing (Backward in Time) and discretized 2nd order term in Central differencing in Space both at time level n+1. Therefore this implicit scheme is called BTCS scheme.
Implicit Schemes result in multiple simultaneous algebraic equations (here we’ll have 3 equations corresponding to 3 unknowns at time n+1 level) that need to be solved as a system of equations of the form [K]{T}n+1 = {F}n. In Our simple case here we have [K]3x3 {T}3n+1 = {F}3n.
Good thing about Implicit Schemes is that they don’t have to satisfy any stability conditions. They are unconditionally stable. But they are computationally expensive as you need more storage space for [K] matrix and need sophisticated algorithms to solve.
By Researchgate, Rajeev KUMAR


Implicit method와 explicit  method는 모두 수치해석의 time integration method 를 푸는 방법이다. 즉 dynamic 해석을 할 때 필수적인 scheme이라 할 수 있다.

요약
explicit method는 다음 타임스텝(Ref에서는 t+del t 또는 n+1로 표현된)의 정보를 얻기 위해 현재 타임스텝(t 또는 n) 의 정보만을 요구하는 반면, implicit method는 다음 타임스텝의 정보를 얻기 위해 현재 타임스텝의 정보에 더하여 다음 타임스텝의 정보또한 요구한다. 

하지만 다음 타임스텝의 정보는 모두 unknown인데 어떻게 다음 타입스텝의 정보를 이용할 수 있을까? 간단한 답은 공간상의 정보를 이용함에 있다. 보통 수치해석 기법이라하면, 주어진 해석영역을 유한개의 요소(element) 또는 격자(grid) 등을 이용하여 이산화(discretization)하게 되는데, 이러한 이산화된 영역에서는 인접한 절점(node, 요소 또는 격자를 구성하는 점)간에 관계를 나타내는 식(governing equation)이 존재한다. 때문에 다음스텝의 unknown 정보들은 절점간의 관계를 나타내는 식들로 대수적인 행렬방정식을 구성하여 그 값들을 얻을 수 있다. 

간단히 1차원 4절점의 heat equation을 예(Researchgate의 ref 참조)를 들어 설명하겠다.


B.C.는 boundary condition 을 의미하며 양 끝 단에서 T_left와 T_right 의 값으로 고정되어 있다.

n, n+1은 타임스텝을 나타낸다.

G.E.는 지배방정식을 의미하며 각 공간상 절점들의 상관관계를 정의한다.

L.A.E.는 대수적 선형방정식을 나타낸다.


즉 위와 같이 구성된 대수적 선형방정식을 풀면 n+1에서의 heat 정보를 얻을 수 있게된다.


** 대표적인 time integration 기법들
explicit method : Runge-kutta method, leapfrog method, predictor-corrector method, velocity-verlet method
implicit method : Newmark method, Houbolt method