ADI Solver
Solve two-dimensional transient equations with the Alternating Direction Implicit method. Set up the grid, enter coefficients by node, and inspect the solution.
Problem setup
Equations and coefficient conversionNode navigator
Run Solve to see the final value at each node.
| Node (i,j,k) | Final U |
|---|
Local coupling matrix G
G[k, ℓ] multiplies variable ℓ in the equation for variable k at the same node. Leave entries at zero for uncoupled variables.
Equations and coefficient conversion
Go to problem setupStart with the 2D heat equation
Discretise time and space
Use a backward difference in time and centred second differences in space. The discrete equation at an interior node is
Match the solver’s coefficient form
Factor one grid spacing out of each spatial denominator. For the x direction, the conversion is
Do the same for the y direction, then match the two numerators to this form.
The form above shows all spatial terms at time level n + 1. ADI uses the same coefficients in two sweeps, treating x implicitly first and y implicitly second.
Coefficients to enter
| Input | Meaning | Heat equation value |
|---|---|---|
| a | East neighbour (i + 1, j) | α/Δx |
| b | Centre node, x direction | −2α/Δx |
| c | West neighbour (i − 1, j) | α/Δx |
| d | Source term, x direction | 0 |
| e | North neighbour (i, j + 1) | α/Δy |
| f | Centre node, y direction | −2α/Δy |
| g | South neighbour (i, j − 1) | α/Δy |
| h | Source term, y direction | 0 |
For constant thermal diffusivity, use these values at every interior node. Enter the initial temperatures in U0, set m = 1 and leave G at zero.
Symbols
- T
- Temperature in a consistent unit throughout the grid.
- Ti,jn
- Temperature at grid node (i, j) at the current time level n. The superscript n + 1 indicates the next time level.
- x, y, t
- Spatial coordinates x and y in metres, and time t in seconds.
- i, j, k
- Zero-based x-node, y-node, and variable indices. In this single-temperature model, k is 0.
- α
- Thermal diffusivity, in m²/s.
- Nx
- Number of nodes in the x direction.
- Ny
- Number of nodes in the y direction.
- m
- Number of variables or equations at each node.
- Δx
- Grid spacing in the x direction, in metres for the heat example.
- Δy
- Grid spacing in the y direction, in metres for the heat example.
- Nt
- Number of time steps.
- Δt
- Time step size, in seconds for the heat example.
- U0
- Initial values on the grid. For heat diffusion these are the temperatures at time level 0.
- G
- m × m matrix for coupling different variables at the same node.
Solver history
No solver runs saved yet.
Solver reference
The node table uses zero-based indices (i, j, k). The outer nodes remain fixed. Choose Desktop compatibility when comparing with the original Tkinter solver or when its boundary terms have already been accounted for in your coefficients.
Load example fills a 3 × 3 heat diffusion problem. With fixed edges at 100 and a starting centre value of 0, the centre reaches 98.1928405 after 10 steps using the loaded settings.