Choose the equation
Pick the type, pick the equation, set its coefficients. One thing to check twice: the Lab writes Poisson as the Laplacian of u equal to f, with no minus sign.
The PDE block holds the physics that must hold at every interior point. It takes the Domain's Coords and Interior points, and gives out a PDE residual: the amount by which the equation fails to hold at those points. That residual is what the Loss block squares and minimises (see the residual as a loss).
Wire it first: Domain Coords → PDE Coords, and Domain Interior → PDE Interior.
1. Pick the type, then the equation
Two dropdowns work together.
Equation type filters the list underneath, and tells the validator which conditions to expect:
| Type | Meaning | Needs time? | Needs |
|---|---|---|---|
| Elliptic (steady) | Nothing changes in time | No | Boundary conditions |
| Parabolic (diffusive, first order in time) | Smooths out as time passes | Yes | Boundary conditions and an initial value |
| Hyperbolic (wave-like) | Carries information along | Yes | Boundary conditions and an initial value |
Equation is the specific PDE. For each one, the table shows what you set and the residual the Lab minimises. (Subscripts are derivatives: $u_t$ is the time derivative, $u_{xx}$ the second derivative in $x$. $\nabla^2 u = u_{xx} + u_{yy}$ in 2-D.)
| Equation | Type | You set | Residual that is driven to zero |
|---|---|---|---|
| Heat | parabolic | Diffusivity $a$ (default 0.1) | $u_t - a\,u_{xx}$ |
| Diffusion-reaction | parabolic | $D$ (0.1), reaction rate $k$ (1) | $u_t - D\,u_{xx} - k\,u$ |
| Wave | hyperbolic | Wave speed $c$ (1) | $u_{tt} - c^2 u_{xx}$ |
| Advection | hyperbolic | Speed $a$ (1) | $u_t + a\,u_x$ |
| Burgers | hyperbolic | Viscosity $\nu$ (0.01) | $u_t + u\,u_x - \nu\,u_{xx}$ |
| Poisson | elliptic | Source $f(x,y)$ | $\nabla^2 u - f$ |
| Laplace | elliptic | nothing | $\nabla^2 u$ |
| Steady heat conduction | elliptic | Conductivity $k$ (1), source $q(x,y)$ | $k\,\nabla^2 T + q$ |
| Helmholtz | elliptic | Wavenumber $k$ (1) | $\nabla^2 u + k^2 u$ |
| Custom residual | any | A formula | whatever you write |
| General coefficient form | any | A table of coefficients | see section 4 |
The Applies to network output field is for problems with several unknowns. Leave it at 1 for a single field.
2. The Poisson sign
The Lab's Poisson equation is ∇²u = f, with no minus sign
In the Lab, Poisson means $\nabla^2 u = f$. A textbook often writes it as $-\nabla^2 u = g$. To solve $-\nabla^2 u = g$, enter $f = -g$.
Example: to solve $-u'' = \pi^2\sin(\pi x)$ on a line, enter -pi**2*sin(pi*x) as the source. The starter Poisson on a square does exactly this: its summary reads $\nabla^2 u = -2\pi^2\sin(\pi x)\sin(\pi y)$, and the exact answer is $\sin(\pi x)\sin(\pi y)$.
If a Poisson run converges to a mirror image of the answer you expected (the right shape, upside down), the sign of $f$ is the first thing to check.
3. Equation type must agree with the Domain
Three of the Graph check's notes are about this pairing.
- an elliptic equation is steady, but the Domain has its time dimension switched on. Switch time off on the Domain.
- a parabolic equation evolves in time, but the Domain has no time dimension, so its time derivative is dropped and the steady-state form is solved. Tick Time dimension on the Domain. Note that the Lab does not stop you: if you ignore the note you get the steady-state problem.
- 'heat' is a parabolic equation but the block is set to elliptic. The parabolic rules will be applied. The Equation type dropdown and the Equation disagree. The equation wins, and the note tells you which rules were used.
4. The general coefficient form
When none of the named equations fits, choose General coefficient form. It is one scalar equation with a table of coefficients:
$$ e_a u_{tt} + d_a u_t + \nabla\!\cdot(-c\nabla u - \boldsymbol\alpha u + \boldsymbol\gamma) + \boldsymbol\beta\cdot\nabla u + a\,u = f . $$
The panel shows this equation, a table of coefficients ($e_a$, $d_a$ are numbers; $c$, $\alpha$, $\beta$, $\gamma$, $a$ and $f$ are formulas that can use the coordinates and $u$), and a Coefficient preset menu with a Load preset button. The presets are Heat, Wave, Poisson ($\nabla^2 u = f$, which sets $c = -1$), and Advection along $x$. Loading a preset overwrites the table, so load first, then edit.
A line under the table tells you what you have built: Stationary, First order in time or Second order in time, and reminds you to turn time on if the equation needs it.
The boundary conditions here prescribe $u$ or its normal derivative. A physical flux condition on a general-coefficient problem must also account for $c$, $\alpha$ and $\gamma$; it is not automatically a plain derivative condition.
5. A custom residual
Choose Custom residual and write the equation as an expression that should equal zero. You can use the coordinates, u, and its derivatives:
- first derivatives:
u_x,u_y,u_t - second derivatives:
u_xx,u_yy,u_tt, and the mixed one asu_xy(always in coordinate order:u_xy, neveru_yx)
For example, Burgers' equation with a different viscosity would be u_t + u*u_x - 0.003*u_xx. The default text is u_t - 0.1*u_xx.
The rules for formulas (which functions, ** instead of ^) are on Read and change a block's settings. The generator emits only the derivatives your expression actually mentions.
Your screenshot · the PDE block with Elliptic and Poisson selected and a source term typed in.