Let us write once more the functional for the Euler equation (5.4)
The linear operator for the parabolic equation we are interested in has the form
The scalar product has the form
The scalar product has the form
The Ostrogradsky formula for the Laplace operator is known
(I.1)
where is the boundary of the submanifold , and is its vector element directed along the outward normal. Let us integrate the second integral by parts
(I.2)
Thus, the original functional can be written as
Let us give the increment , where is the exact solution, and is some small number. The full increment of the functional can be written as
Neglecting the second-order terms proportional to , we obtain
If we take out of the brackets and take into account that can be negative, while the increment of the functional is always positive, since is the exact solution, we obtain as a mandatory condition
Taking into account that , and cancelling the common factor, we return to the original equation. This means that the numerical solution of the boundary value problem reduces to the minimization of the functional
(I.3)
The factor in front of the linear term is kept deliberately: it is precisely what ensures that the minimum condition returns the original equation rather than an equation with an extra factor of (when differentiating, the quadratic terms produce a factor of , and the linear term must have the same one).
Let us proceed to the separation into stationary and nonstationary problems. It is fundamentally important to perform this separation and the subsequent time discretization at the level of the equation, not of the functional: the time derivative is not a self-adjoint operator, so direct substitution of into the functional would lead to incorrect coefficients. Let us write the weak form of the equation , obtained above by integration by parts
(I.4)
which must hold for an arbitrary trial function .
The stationary equation with Dirichlet and/or Neumann boundary conditions
If , the time term disappears, and due to the symmetry of the spatial operator the weak form (I.4) is equivalent to the minimization of the functional
(I.5)
The nonstationary equation with Dirichlet and/or Neumann boundary conditions
We discretize the time derivative by the implicit Euler scheme with step , applying it to the weak form of the equation: , where is the solution on the current time layer, and on the previous one. Substituting this into (I.4) and multiplying by , we obtain the equation for the time step
This equation, in turn, is the minimum condition of the functional
(I.6)
Thus, the nonstationary equation has been reduced to successively solving stationary problems: at each step, from the known is found .
Matrix form
We discretize the trial function over the mesh nodes: , where are the basis functions, and is the vector of nodal values. The substitution turns each integral of the functional into a quadratic or linear form in , and their coefficients are assembled into matrices:
(I.7)
where is the stiffness matrix (the integral of the product of the gradients), is the damping matrix (the integral of the product of the trial functions), is the load vector (the integral of the source); the matrices and are symmetric. The boundary integral does not collapse into a matrix: it is a surface term that, in discrete form, enters only the equations of the boundary nodes (for an interior node the trial function vanishes on the boundary) and is determined by the boundary condition itself.
The discrete system is obtained by the Bubnov–Galerkin method: we substitute into the weak form (I.4) and successively take the trial functions . For the stationary equation this gives the system
(I.8)
where is the vector of nodal boundary fluxes. The flux itself is not specified here — what to do with it is determined by the type of boundary condition. Accounting for boundary conditions is a nontrivial task, and it is discussed in detail in separate appendices: “Accounting for Dirichlet boundary conditions” and “Accounting for Neumann boundary conditions”.
For the nonstationary equation (implicit Euler scheme, see (I.6)) the system at the time step takes the form