Post Reply 
(11C) (15C) Invisicalc Spreadsheet
11-12-2024, 08:13 AM (This post was last modified: 11-12-2024 08:31 AM by Thomas Klemm.)
Post: #3
Solving the Dirichlet Problem
Addendum

Suppose that the cell \(u_{x,y}\) is surrounded as follows:

\(
\require{color}
\begin{array}{|c|c|c|}
\hline
& u_{x,y-1} & \\
\hline
u_{x-1,y} & \color{red} u_{x,y} & u_{x+1,y} \\
\hline
& u_{x,y+1} & \\
\hline
\end{array}
\)

Then we define:

\(
\begin{align}
u_{x,y} &= \text{average}\left(u_{x,y-1}, u_{x-1,y}, u_{x+1,y}, u_{x,y+1}\right) \\
\\
&= \frac{u_{x,y-1} + u_{x-1,y} + u_{x+1,y} + u_{x,y+1}}{4} \\
\end{align}
\)

From this we conclude:

\(
\begin{align}
4 \cdot u_{x,y} &= u_{x,y-1} + u_{x-1,y} + u_{x+1,y} + u_{x,y+1} \\
0 &= \left[u_{x+1,y} - 2 \cdot u_{x,y} + u_{x-1,y}\right] + \left[u_{x,y+1} - 2 \cdot u_{x,y} + u_{x,y-1}\right] \\
&= \left[(u_{x+1,y} - u_{x,y}) - (u_{x,y} - u_{x-1,y})\right] + \left[(u_{x,y+1} - u_{x,y}) - (u_{x,y} - u_{x,y-1})\right] \\
\end{align}
\)

We can abbreviate this double difference:

\(
\begin{align}
0 &= \left[(u_{x+1,y} - u_{x,y}) - (u_{x,y} - u_{x-1,y})\right] + \left[(u_{x,y+1} - u_{x,y}) - (u_{x,y} - u_{x,y-1})\right] \\
&= \Delta^2_x u_{x,y} + \Delta^2_y u_{x,y} \\
\end{align}
\)

This can be interpreted as the sum of the “heat” flowing into or out of the cell \(u_{x,y}\).
Since this value is \(0\), we have reached a steady state.

Compare this with the Laplace equation:

\(
\begin{align}
0 &= \Delta u \\
&= \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \\
\end{align}
\)

Maximum principle

I'm leaving it as an exercise to conclude that both the maximum and the minimum must be found on the boundary.

Uniqueness of the Solution
How can the maximum principle be used to show the uniqueness of the solution?
Hint: Assume that there are two different solutions.
Of course, they must agree on the boundary.
What can be concluded about the difference of these two solutions?

Excel

Enable iterative calculation
You can enable this option in: File > Options > Formulas

Create the formula
Use a new sheet.
Insert into cell A2 the value 0.
In cell B2 insert the function which calculates the average of the four adjacent cells: =AVERAGE(A2;B1;C2;B3)

Propagate the function
Horizontally
Propagate the formula in B2 horizontally.
To do this, move the cursor over the bottom right corner until + appears.
Now drag this over the cells to the right of B2.
It doesn't really matter how many cells you cover. About 10 is fine.

Vertically
While all of these cells are still active, hover your cursor over the bottom right corner of the rightmost cell again and drag + down.
Again, it doesn't really matter how far down you go.
You should end up with a rectangle filled with zeros.

Fill the border
Use the same technique to propagate the 0 in cell A2 around the boundary of the rectangle.
Make sure not to override the existing values.

Create graphic
Select the whole rectangle.
Use Insert > Charts > Other Charts > Surface > 3D-Surface to create a 3D graph of these values.

Modify values
Change one of the values on the boundary (not in one of the corners).
What happens?
Use different values along the boundary.
How can you modify the graph?

Modify the domain
Circle
You can modify the domain: it doesn't have to be a rectangle.
You can use Bresenham's circle algorithm to define an approximation of a circle inside the rectangle.
Simply delete cells that aren't needed.
You just need to make sure that all values on the boundary are defined values.

Other shapes
How about a disc with a hole? Or other completely irregular shapes?

Example

[Image: attachment.php?aid=14285]


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Solving the Dirichlet Problem - Thomas Klemm - 11-12-2024 08:13 AM



User(s) browsing this thread: 2 Guest(s)