Post Reply 
(11C) (15C) Invisicalc Spreadsheet
11-12-2024, 12:48 AM
Post: #2
Solving the Dirichlet Problem
We can define each of the red cells as the average of the four surrounding cells:

\(
\require{color}
\begin{array}{|c|c|c|c|}
\hline
& 5 & 6 & \\
\hline
.2 & \color{red} 1 & \color{red} 2 & 7 \\
\hline
.1 & \color{red} 3 & \color{red} 4 & 8 \\
\hline
& .0 & 9 & \\
\hline
\end{array}
\)

This results in the following programs for cells 1, 2, 3 and 4:
Code:
   001 { 42 21 12 } f LBL B
   002 { 43  5  0 } g CF 0
   003 {    45  0 } RCL 0
   004 {    44 25 } STO I
   005 { 42 21 .9 } f LBL 19
   006 {    32 25 } GSB I
   007 {    45 24 } RCL (i)
   008 { 43 30  5 } g TEST 5
   009 {    22 .8 } GTO 18
   010 {       34 } X<=>Y
   011 {    44 24 } STO (i)
   012 { 43  4  0 } g SF 0
   013 { 42 21 .8 } f LBL 18
   014 { 42  5 25 } f DSE I
   015 {    22 .9 } GTO 19
   016 { 43  6  0 } g F? 0
   017 {    22 12 } GTO B
   018 {    43 32 } g RTN
   019 { 42 21  1 } f LBL 1
   020 {    45  2 } RCL 2
   021 { 45 40  5 } RCL + 5
   022 { 45 40 .2 } RCL + 12
   023 { 45 40  3 } RCL + 3
   024 {        4 } 4
   025 {       10 } /
   026 {    43 32 } g RTN
   027 { 42 21  2 } f LBL 2
   028 {    45  1 } RCL 1
   029 { 45 40  6 } RCL + 6
   030 { 45 40  7 } RCL + 7
   031 { 45 40  4 } RCL + 4
   032 {        4 } 4
   033 {       10 } /
   034 {    43 32 } g RTN
   035 { 42 21  3 } f LBL 3
   036 {    45  1 } RCL 1
   037 { 45 40  4 } RCL + 4
   038 { 45 40 .0 } RCL + 10
   039 { 45 40 .1 } RCL + 11
   040 {        4 } 4
   041 {       10 } /
   042 {    43 32 } g RTN
   043 { 42 21  4 } f LBL 4
   044 {    45  2 } RCL 2
   045 { 45 40  8 } RCL + 8
   046 { 45 40  9 } RCL + 9
   047 { 45 40  3 } RCL + 3
   048 {        4 } 4
   049 {       10 } /
   050 {    43 32 } g RTN

Please note that this leads to circular dependencies.

Example

We can define arbitrary values on the boundary:

2 STO 5
3 STO 6
4 STO 7
5 STO 8
4 STO 9
7 STO .0
5 STO .1
1 STO .2

We have 4 cells to calculate:

4 STO 0
GSB B

Results

RCL 1
2.83333

RCL 2
3.54167

RCL 3
4.79167

RCL 4
4.33333

\(
\begin{array}{|c|c|c|c|}
\hline
& 2 & 3 & \\
\hline
1 & \color{red} 2.83 & \color{red} 3.54 & 4 \\
\hline
5 & \color{red} 4.79 & \color{red} 4.33 & 5 \\
\hline
& 7 & 4 & \\
\hline
\end{array}
\)

Interpretation

Consider the black numbers given as the temperature at the boundary of a sheet of metal.
The red numbers then indicate the temperature inside the sheet.
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 12:48 AM



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