Download presentation
Presentation is loading. Please wait.
Published byHilary Simpson Modified over 9 years ago
1
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu Rasime.uyguroglu@emu.edu.tr
2
2 FINITE DIFFERENCE METHODS
3
3 Introduction In general real life EM problems cannot be solved by using the analytical methods, because: The PDE is not linear, The solution region is complex, The boundary conditions are of mixed types, The boundary conditions are time dependent, The medium is inhomogeneous or anisotropic.
4
4 Introduction For such complicated problems numerical methods must be employed. Finite Difference Method (FDM) is one of the available numerical methods which can easily be applied to solve PDE’s with such complexity. FDM, is easy to understand and apply.
5
5 Introduction FD techniques are based upon approximations of differential equations by finite difference equations. Finite difference approximations: have algebraic forms, Relate the value of the dependent variable at a point in the solution region to the values at some neighboring points.
6
6 Introduction Steps of finite difference solution: Divide the solution region into a grid of nodes, Approximate the given differential equation by finite difference equivalent, Solve the differential equations subject to the boundary conditions and/or initial conditions.
7
7 Introduction Rectangular Grid Pattern
8
8 Finite Difference Schemes The derivative of a given function f(x) can be approximated as:
9
9 Finite Difference Schemes f(x) x A P B
10
10 Finite Difference Schemes Estimate of second derivative of f(x) at P:
11
11 Finite Difference Schemes Or, by using Taylor Series:
12
12 Finite Difference Schemes Adding these equations: Assuming that higher order terms are neglected:
13
13 Finite Difference Schemes is the error introduced by truncating the series. It represents the terms that are not greater than.
14
14 Finite Difference Schemes Subtracting Eq.6 from Eq. 5 and neglecting terms of the order Error is second order. Eq. 3- Eq.4 are second order, Eq.1 and Eq. 2 are first order.
15
15 Finite Difference Schemes As long as the derivatives of f are well behaved and the step size is not too large, the central difference should be the most accurate of the other two. i.e. Backward and forward difference approximations.
16
16 Finite Difference Schemes The error in central difference decreases quadratically as the step size decreases, whereas the decrease is only linear for the other two formula. In general, CDF is to be preferred. Situations where the data is not available on both sides of the point where the numerical derivative is to be calculated are exceptions.
17
17 Finite Difference Schemes To apply the difference method to find the solution of a function the solution region is divided into rectangles:
18
18 Let the coordinates (x, t) of a typical grid point or a node be: The value of at a point: Finite Difference Schemes
19
19 Finite Difference Schemes Using this notation, the central difference approximations of at (i, j) are: First derivative:
20
20 Finite Difference Schemes Second derivative:
21
21 Finite Difference Schemes One dimensional example: Solve Subject to the boundary conditions: Assume
22
22 Finite Difference Schemes Solution: Discretization of the equation:
23
23 Finite Difference Schemes Since there is one unknown, one equation is enough to find this unknown.
24
24 Finite Difference Schemes If
25
25 Finite Difference Schemes f(1), f(2) and f(3) are unknowns. Therefore, three equations are written to find three unknowns.
26
26 Finite Difference Schemes For we have (N-1) unknowns and we need (N-1) equations to solve. The equation of the i th node is:
27
27 Finite Differencing of Parabolic PDE’s Consider the diffusion equation: Where k is a constant. Discretized equation:
28
28 Finite Difference Schemes Where Forward difference for t and central difference for x is used. Let:
29
29 Finite Difference Schemes We can write: This equation can be calculated in terms of boundary and initial conditions. This explicit formula can be used to find explicitly in terms of.
30
30 Stability Stability is important for the numerical solutions. A stable solution is only possible when (1-2r) is nonnegative. Or: Choose r=1/2. Then our equation becomes:
31
31 Stability Stability increases by applying an implicit formula. The formula is simple to apply but it is computationally slow. Crank and Nicholson’s formula:
32
32 Example (Cont.) Rewrite: Three known values on the left hand side and three unknown values on the right hand side.
33
33 The formula is valid for all finite values of r, chose r=1: Example (cont.)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.