numerical solution laplace’s equation - empossible

7
9/21/2020 1 Advanced Electromagnetics: 21 st Century Electromagnetics Numerical Solution of Laplace’s Equation Lecture Outline Intuitive interpretation of Laplace’s equation 0 Numerical solution of Laplace’s equation Enclosed problems Slide 2

Upload: others

Post on 10-Apr-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

1

Advanced Electromagnetics:

21st Century Electromagnetics

Numerical Solution of Laplace’s Equation

Lecture Outline

• Intuitive interpretation of Laplace’s equation ∇ 𝑢 0•Numerical solution of Laplace’s equation 𝐋𝐮 𝟎• Enclosed problems

Slide 2

Page 2: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

2

Intuitive Interpretation of

Laplace’s Equation

Slide 3

Meaning of Laplace’s Equation

4

2 0u

Laplace’s equation is

2 is a 3D second‐order derivative. 

A second‐order derivative quantifies curvature.

But the second‐order derivative is set to zero.

Functions satisfying Laplace’s equation vary linearly.

Page 3: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

3

Laplace’s Equation as a “Linear Number Filler Inner”

5

Given known values at certain points (e.g. physical boundary conditions), Laplace’s equation calculates the numbers everywhere else so they vary linearly.

Map of known values (boundary values) Laplace’s equation is solved to fill in the values away from the boundaries.

2 0u

Numerical Solution of Laplace’s Equation

Slide 6

Page 4: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

4

2 2 x y

Lu 0

L D D

Numerical Solution of Laplace’s Equation (1 of 3)

7

Step 1 – Use the finite‐difference method to express Laplace’s equation in matrix form.

Step 2 – Build a function 𝑏 𝑥, 𝑦 containing the boundary values.

The function 𝑏 𝑥, 𝑦 contains the values of 𝑢 𝑥, 𝑦 in the locations where 𝑢 𝑥, 𝑦 is known.  The other points in 𝑏 𝑥, 𝑦 can be set to anything because they will be ignored, but zero is a convenient choice.

,b x y

2 , 0u x y 2 2 x y D u D u 0 2 2

2 2

, , 0

u x y u x y

x y

Numerical Solution of Laplace’s Equation (2 of 3)

8

Step 3 – Build a diagonal force matrix F.

Step 4 – Incorporate the boundary values into Laplace’s equation.

The array 𝑓 𝑥, 𝑦 contains 1’s at the positions where u(x,y) is to be forced.  It contains 0’s everywhere else.  It should be set to 1’s at the locations of the boundary values.

,f x y

diag ,f x y F

L F I F L

b FbNote: both F and I should be stored as sparse matrices!

Page 5: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

5

Numerical Solution of Laplace’s Equation (3 of 3)

9

Step 5 – Solve Laplace’s equation

The function u(x,y) has all of the forced values, but also contains all of the numbers in between.

,u x y

1 u L b

Enclosed Problems

Slide 10

Page 6: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

6

Enclosed Problems

11

Sometimes a solution is only needed that is perfectly enclosed by the boundary values.

Boundary values enclose some volume.

Only need to solve Laplace’s equation here.

Do not care about values outside of the enclosed boundary.

Map Function 𝑀 𝑥,𝑦

12

Step 1 – Make a map 𝑀 𝑥, 𝑦 of where Laplace’s equation is to be solved and include the locations of the boundary.

,M x y ,b x y Solve here.

Do not solve here.

Page 7: Numerical Solution Laplace’s Equation - EMPossible

9/21/2020

7

Reducing the Matrix Equation

13

Step 2 – Eliminate the rows and columns in the matrix equation 𝐋𝐮 𝐛 that correspond to points that do not have to be calculated.

% REDUCE LAPLACE’S EQUATIONind = find(M(:));L = L(ind,ind);b = b(ind);

L u b

L u b

Solve and Expand Solution

14

Step 3 – Solve Laplace’s equation.

1 u L b

Step 4 – Insert solutionback into grid.

% SOLVE LAPLACE'S EQUATIONu = L\b;

% INSERT SOLUTION BACK INTO GRIDU = zeros(Nx,Ny);U(ind) = u;