Manuscript Offprint
arXiv:2611.03542Variational Functional Neural Networks (vfNN)
Chinmay Katke and C. Nadir Kaplan
Department of Physics, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.
Center for Soft Matter and Biological Physics, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.
Department of Mechanical Engineering, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.
Center for the Mathematics of Biosystems, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.
(Dated: November 3, 2026)
We present a variational functional neural network (vfNN) algorithm that optimizes physically motivated continuum functionals in integral form (e.g., Lagrangian, Hamiltonian, or free energy) to find the states of a system. That way, vfNN bypasses solving the equations of motion (a.k.a. the Euler-Lagrange equations), which are in the form of differential equations. To this end, our approach is fundamentally different from conventional physics-informed neural networks (PINN) that solve differential equations by minimizing a phenomenological loss function involving higher order derivatives and ad hoc weight factors. In contrast, vfNN merely evaluates lower order derivatives of the generating functional and replaces the weight factors with rigorous physical scales. This also fundamentally changes the loss landscape, and the desired solutions may become unstable. For this emergent nonconvex optimization problem, we develop a quasi-Newton optimization algorithm with simulated annealing that converges to the solutions of the corresponding Euler-Lagrange equations of the functional regardless of their stability properties. Our simulations using vfNN give accurate results for benchmark systems governed by linear or nonlinear ordinary differential equations.
I. INTRODUCTION
The equations of motion of a wide range of dissipative or energy conserving physical systems can be derived from a Lagrangian, Hamiltonian, or Rayleighian functional that involves conservative or nonconservative forces. The analytical extremization yields Euler-Lagrange equations (ELE), which inherently employ gradient information to solve for a smooth function, such as the position of a body in time, or an order parameter and a nonuniform vector field of a many-body system.
Neural networks as universal function approximators and reliable gradient algorithms have thus become appealing for automating the solution of physically motivated differential equations [1, 2]. To this end, physics-informed neural networks (PINN) have become a popular tool to solve for the state of a system by minimizing a phenomenological loss function constructed from a set of coupled differential equations [3, 4]. This loss function is the norm of the set, and the derivative terms in the loss function are calculated using automatic differentiation (AD) [2]. The procedure is mesh-free in the sense that the accuracy of the solution does not depend on the coarseness of the underlying mesh. This gives PINN a significant advantage over conventional differential equation solvers in problems involving irregular domains and large deformations [5, 6]. Consequently, PINN found wide applicability in biomedicine, fluid and solid mechanics, materials science, geophysics, dynamical systems and control, and chemical engineering [7–19].
Despite the advantages of NN implementations in physical modeling, using AD to compute higher order derivatives, which lie at the heart of the mathematical description of physical systems, is expensive due to extensive mapping of all lower derivatives. Even if the differential equations are cast to a coupled system of first-order equations, the corresponding optimization procedure using PINN involves construction of a single loss function with ad hoc weight factors multiplying each equation. These weight factors are estimated manually or algorithmically, increasing the complexity of the problem.
These shortcomings can be circumvented by turning to the variational formulation of the problem at hand, which naturally has lower order derivatives. A variational PINN framework that utilizes weak formulation has previously been implemented in the Petrov-Galerkin framework (VPINN), where a deep neural network (DNN) acts as a trial function, and the test functions are represented by prescribed functions or a second neural network [20–24]. These formulations are similar to the finite element method (FEM), and the accuracy depends on the number of quadrature points in the domain and the choice of test functions. Another NN approach – much closer in spirit to the physically motivated variation as with Lagrangian and Hamiltonian mechanics – was explored in the context of the Poisson's equation as an elliptic partial differential equation that was numerically solved by directly minimizing a convex functional [25–33].
Here, we generalize this latter approach by developing a variational functional neural network (vfNN) algorithm to directly optimize a broader class of physically motivated functionals that have nonconvex loss landscapes. This approach bypasses solving ELE, thus significantly differing from PINN, as well as from VPINN in that the variational form is not the weak form. We demonstrate that vfNN can successfully extremize a functional to find the solution(s) even when the loss landscape is not guar-
anteed to be locally or globally convex. We implement vfNN to a range of benchmark problems with a variational formulation, whose ELE would correspond to a single (linear or nonlinear) ordinary differential equation (ODE) or a coupled set thereof.
This paper is organized as follows: in Sec. II, we present the details of the vfNN algorithm. In particular, we characterize the nonconvexity of the loss landscape to assess the stability of the solutions of ELE, and then develop a quasi-Newton optimization procedure that identifies the solutions regardless of their stability. In Sec. III, we utilize vfNN to extremize the functionals of different physical systems whose ELEs constitute a linear ODE, a nonlinear ODE for the minimal surface of revolution, steady-state Sine-Gordon equation, Poisson-Boltzmann equation, and a set of coupled ODEs for the packing of hard rods in a liquid crystalline colloidal monolayer. We provide a discussion and concluding remarks in Sec. IV.
Here is a scalar function of unknowns and their gradients . The optimization is subject to the following Dirichlet () and Neumann () boundary conditions:
The Dirichlet and Neumann boundary conditions hold on different parts of the domain boundary and , respectively, where known functions and are imposed.
By considering first-order variation of Eq. 1 with respect to , we arrive at the corresponding Euler-Lagrange equations (ELE):
The solution to the ELE is defined as the first-order critical point in variational calculus [34].
To solve Eq. 1, we represent using a neural network (NN) as a universal function approximator, which reduces the original infinite-dimensional optimization problem to finite dimensions [1]. A point is
an input to the neural network, and the corresponding output is . We denote the set of such points in the domain by (collocation points) and the set of the outputs from the neural network by .
The network topology that we use for vfNN is depicted in Fig. 1. We construct the NN as follows: let denote the input to the network, and let be the number of layers. For each layer with the number of neurons , let be the weight matrix, and be the bias vector that enables nonzero output of the neural network for zero input ( ). The output of the layer is denoted by . Then,
The activation functions are defined as
We choose the hyperbolic tangent function as an activation function for all the layers except for the last layer, which allows for a simple pass-through to give the output . For convenience, we denote the set of all parameters that are the entries of the matrices and vectors by a single vector , where is the total number of NN parameters. We choose the most fundamental neural network, multilayer perceptron (MLP), as the underlying network structure. Furthermore, we set three hidden layers (length) with 20 neurons in each layer (width). These network dimensions are optimal for the validation problems considered in this work. Networks with number of layers less than three and a width less than 20 were not sufficient to approximate the solutions. We found that MLP with bigger length and width higher increased computational cost without significantly improving the accuracy.
In the conventional formulation of PINN, the ELE is solved by minimizing the corresponding norm [3]:
Here, the sum over index runs over the Euler-Lagrange equations, each corresponding to an unknown describing the system, and are the corresponding loss weight factors. The determination of these weight factors is not trivial and often involves trial and error or implementation of complex algorithms. In vfNN, to obtain the solution of Eq. 3, we optimize Eq. 1 where rigorous physical scales describing the system effectively replace the loss weight factors in Eq. 8. To this end, we first approximate the integral in Eq. 1 by a right Riemann sum:
Here is the volume of the domain , and is total number of collocation points. For a

FIG. 1. Variational functional neural network (vfNN). We use a multilayer perceptron (MLP) deep neural network with an input and output that minimizes the variational loss . The derivative is computed using automatic differentiation at each input point . The Dirichlet boundary conditions are implemented by transforming the output of the network with known functions and . The Neumann boundary conditions are implemented by including a corresponding boundary term in the functional . For the definitions of , see Eqs. 4, 5.
fixed set of collocation points , is a function of , i.e., the variational problem in Eq. 1 can be solved by optimizing the NN weights and biases.
The most popular method to implement the boundary conditions (BCs) in PINN is to include a corresponding penalty term for the deviation from the desired BC in the overall loss function [3]. For the Dirichlet BCs stated in problem 1, the penalty terms are given by
where is again a penalty coefficient. Generally, the optimization is initiated with a smaller value whose value is increased gradually until the BCs are met. Since this method adds an extra layer of complexity to the optimization process, in vfNN, we instead implement the Dirichlet BCs for the problem in Eq. 1 by directly constraining the output of the neural network [35]:
The functions and are any smooth function over the domain with following properties:
The simplest function one can construct to satisfy the above criteria are quadratic in and linear in . Hence, we have chosen and accordingly for each problem studied in this work.
Eq. 8 ensures that the solution is a local minimum in the multidimensional loss landscape, and the optimization algorithms such as the adaptive
moment estimation (ADAM) and the limited memory Broyden–Fletcher–Goldfarb–Shanno algorithm (LBFGS) work very well to find the solution [36, 37]. In contrast, although the solution to Eq. 3 is the optimum solution to the problem defined by Eq. 1, it is not guaranteed that the optimum corresponds to a minimum (See Appendix A for the conditions of stability). In general, the solution could be located at a maximum, minimum, or a saddle point in the landscape of ; this increases the complexity of optimization. To overcome this, Appendix B outlines a simple algorithm to determine the stability of a 1D functional whose ELE is a linear ODE.
To find the solution of the general variational problem in Eq. 9, we develop an optimization algorithm that converges to a first-order critical point based on Newton's method of optimization. Newton's method uses the first derivatives as well as the second derivatives or the Hessian matrix of the objective function to find the optimum (minimum, maximum or a saddle point), offering faster convergence compared to other first-order methods such as the gradient descent algorithm. However, it can suffer from higher computational and memory costs associated with the second derivatives in a large parameter space, in our case of dimension of the weight vector . The quasi-Newton second-order methods like the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm approximate the Hessian of the objective function using first derivatives and the step size in the parameter space, thereby reducing the computational cost. The second-order optimization methods are typically combined with supplementary algorithms to accelerate convergence. While quasi-Newton methods determine the search direction in the parameter space, the supplementary “line search” algorithms determine the optimum step size in that direction. A variety of line search algorithms satisfy criteria called the Wolfe conditions that impose sufficient decrease (Armijo) and the curvature conditions, ensuring convergence to a global minimum when combined with the BFGS algorithm [38].
The conventional BFGS method approximates the true Hessian matrix by using another matrix with a strictly positive eigenvalue spectrum. In the vicinity of a local minimum, the Hessian is always positive definite (i.e., has only positive eigenvalues), and hence BFGS works very well at locating minima. While this method is perfectly suited for the task of finding a minimum, it is ineffective for finding a solution to variational problems when the solution lies at a saddle point or a maximum in the loss landscape. This is because around the saddle points, the true Hessian has both positive and negative eigenvalues.
Thus, we use Symmetric Rank 1 (SR1) Hessian update with a line search method based on a Metropolis criterion [38, 39]. The advantage of using SR1 Hessian update is that the approximate Hessian is not constrained to represent only the positive eigenvalues, accurately approximating the true Hessian matrix when it is indefinite (i.e., has positive, zero, and negative eigenvalues) in the vicinity of a saddle point or inflection point solution.
We implement the line search method based on a Metropolis criterion as follows: let be a vector where the elements denote the NN weights and biases, and the subscript denotes the iteration. Let be the variational loss function at the iteration , be the gradient in the loss landscape calculated using backpropagation, and is an matrix that approximates the Hessian matrix of . The matrix is evaluated iteratively during optimization. We define the vector as the direction of the next iteration step, i.e., the line search direction. Then, the quadratic approximation of the variational loss about is given by
By also expanding into a Taylor series, the optimum of the quadratic approximation in Eq. 13 is obtained by setting :
Eq. 14 is used to calculate the next iteration.
where is the step size.
Algorithm 1: Stochastic line search
Input:
1 , , ;
2 repeat
3
4
5
6
7
8
9 until ;
10 return ;
To find an appropriate step size , our line search method given in Algorithm 1 employs a Metropolis criterion. The resulting value of reduces the magnitude of the objective function gradient along the line search direction towards where the optimum of is located. While typical line search algorithms may utilize a variety of deterministic criteria to find an optimal step size , such as the Wolfe conditions that impose the sufficient decrease (Armijo) and the curvature conditions [38], our algorithm is stochastic and is thus much less sensitive to noise in a potentially rough and nonconvex loss landscape. At every iteration , we start with the maximum allowed step size and inverse “temperature” for a Newton update. The Metropolis criterion
will always be true if is smaller than , and the step length will be accepted. Here, uniform(0,1) corresponds to a random number between 0 and 1, sampled from the uniform distribution at each iteration, which leads to occasional acceptance of a step length with . This helps navigate the highly nonconvex loss landscape of the neural network to find the optimum. We rescale the cost function with to ensure that the algorithm does not randomly escape the basin of the optimum; is a tuning parameter. While lower values of increase the chances of escaping the basin of the optimum, higher values of result in very slow convergence. Thus, we choose . If the Metropolis criterion is not met, then the step length is reduced by a factor (= 0.9 here), and the process is repeated. The failure to satisfy the Metropolis condition for the maximum number of iterations would return a small constant step length .
Having determined the line search direction (Eq. 14) and the step size (Algorithm 1), the SR1 Hessian update that relates the approximate Hessian matrices and is given as [38]
(17)
with
For the SR1 update scheme, we have defined the function . Eq. 17 can be obtained by considering the secant equation
The only symmetric rank-1 update satisfying Eq. 19 and ( ) is given by Eq. 17 [38]. We start with , where is the identity matrix. The inversion of an matrix required to solve Eq. 14 is impractical when . The elegance of the quasi-Newton methods is that the inverse can also be computed iteratively [38]:
The SR1 update becomes unstable when the vectors and are perpendicular to each other and their scalar product in the denominator in Eq. 17 vanishes. To avoid this numerical instability, we perform the update when the criterion below is met:
where is a very small number. If the above condition is not met, then [38].
The procedure for the SR1 Hessian update with quenching is given in Algorithm 2, which employs simulated annealing with the inverse temperature varied
Algorithm 2: SR1 Hessian update with simulated annealing
Input: w: weights, : loss functional, : gradient, : tolerance, : quenching rate, : initial temperature, : final temperature
1 , ;
2 repeat
3
4
5 ,
6
7
8
9 return
through the optimization process [40, 41]. We start with low values of and quench the system by increasing . The quenching rate is an additional tuning parameter. A lower quenching rate increases the likelihood of finding the optimum at a cost of higher number of iterations. The numerical values used for the parameters in Algorithm 2 can be found in Ref. [42].
III. RESULTS
By using our vfNN algorithm where the vector of NN parameters is optimized through Algorithm 2 over iterations, we solve several representative linear and nonlinear ordinary differential equations (ODEs) by using their variational formulation. In Figs. 3 and 4, we compare our results from vfNN with FEM results that we generated by using FEniCS 2019.1.0 [43].
We first consider the variational formulation of a linear second order ODE
whose ELE is
Here, represents a known function up to linear order in . Table I lists the Dirichlet boundary conditions that we implement at both endpoints of the respective domains for different choices of . The results for the choices of listed in Table I are depicted in Fig. 2a–e. Unlike conventional PINN where the loss function is an norm (Eq. 8), the loss function of vfNN may converge to a nonzero value. One such example is , and Fig. 2f shows the convergence of the corresponding variational loss as a function of iteration steps.
We also compare the convergence rates of vfNN and PINN, each subject to the loss optimization through
TABLE I. Functions and corresponding boundary conditions for Eqs. 22, 23. The results are shown in Fig. 2.
| Boundary conditions | |
|---|---|
| 0 | . |
| 0.25 | . |
| u | . |
| . | |
| . |
our SR1 algorithm and the conventional ADAM algorithm [36]. For each of the network-algorithm pair, Table II presents the number of iterations necessary to achieve accurate solutions. The iterations are averaged over 30 independent initializations due to the randomness associated with our line search algorithm. Except for the case of , vfNN along with SR1 algorithm for loss optimization requires least number of iterations for convergence. This computational advantage can be attributed to two factors; the reduced computational cost due to lower order derivatives in the loss function and the superlinear convergence rate of the quasi-Newton SR1 optimization algorithm. Note that, for , the use of ADAM optimizer on vfNN results in a divergence of the loss. In this case, the sole solution to the ELE resides at an unstable saddle point within the loss landscape, and the ADAM optimizer, which seeks the minimum of the loss function, is unable to locate the solution. Here, the first two sufficiency conditions for a stable solution given in Appendix A are satisfied since . Thus, it must be the third condition that is violated, in other words, the presence of the conjugate points makes the solution unstable. We find the sole conjugate point in the domain using our algorithm 3 (Appendix B) in 14 iterations which is accurate up to decimal. This algorithm also finds multiple conjugate points, , in the extended domain . Thus, we employ the SR1 optimizer to accurately identify the corresponding unstable solution in the domain without the need to identify the conjugate points.
We next consider the functionals of a single dependent variable and its derivative whose ELEs are a single nonlinear ODE. First, we consider the problem of finding the minimal surface of revolution formed by the rotation of a two-dimensional curve around the x-axis. Since the desired function must always lie above the x-axis, such that it has no simple root, we impose the constraint , where is the output of the neural network and does not directly represent the dependent variable (see Fig. 1). The variational formulation of this problem is
We choose a domain with the Dirichlet boundary conditions . The special solution of

FIG. 2. Linear ODEs using vfNN. The function in Eq. 23 is chosen as (a) , (b) , (c) , (d) , and (e) . (f) shows the variational loss for in (c) as a function of the iterations of our SR1 update (Algorithm 2). The dashed red lines show the solutions obtained using vfNN, and the solid blue lines indicate the solutions obtained using PINN. * The domain in (e) contains a conjugate point that makes the loss landscape nonconvex; see Appendices A, B.
| vfNN | PINN | |||
|---|---|---|---|---|
| SR1 | ADAM | SR1 | ADAM | |
| Number of iterations | ||||
| 0 | 28 | 603 | 120 | 442 |
| 0.25 | 28 | 262 | 68 | 832 |
| u | 456 | 854 | 761 | 499 |
| 5 | 229 | 54 | 413 | |
| 1793 | - | 1396 | 1985 | |
TABLE II. Convergence rates of vfNN vs. PINN. By specifying different for the problem given in Eq. 22, we optimize PINN and vfNN via two algorithms: the first-order optimization algorithm ADAM [36] and the second-order optimization algorithm SR1 (Sec. II). For , the use of ADAM optimizer with vfNN leads to the divergence of the loss function since the domain contains a conjugate point that makes the loss landscape nonconvex; see Appendices A, B. For all cases, a deep neural network with three layers and 20 neurons per layer is used. The number of iterations are averaged over 30 independent initializations.
the problem can be found analytically as
The neck radius of the surface of revolution satisfies . There exist two solutions to this problem: while the solution corresponding to is a minimum, the solution corresponding to is a saddle point (Fig. 3a). Our vfNN algorithm successfully identifies both solutions by initializing the optimization from different initial guesses that are randomized by the initialization of the weight matrix in Eq. 4.
The second nonlinear problem with a single dependent variable that we consider is the steady-state Sine-Gordon

(b)
(c)
FIG. 3. Nonlinear ODEs using vfNN. Solutions to the functionals whose ELE are (a) the minimal surface of revolution (Eqs. 24, 25), (b) steady-state Sine-Gordon equation (Eq. 26), and (c) the Poisson-Boltzmann equation (Eqs. 27–29). The dashed red lines indicate the solutions using vfNN, and all other colors correspond to different nonunique solutions (a) from the exact solution (Eq. 25) and (b), (c) found by using FEM. For all panels, a deep neural network with three layers and 20 neurons at each layer is used.
equation, which is also an integrable system and models the large-angle simple pendulum when the independent variable x represents time. The variational formulation and the corresponding ELE of the problem is as follows:
In the domain , imposing Dirichlet boundary conditions at both boundaries, and for , this problem has three distinct solutions: so-

(b)
FIG. 4. Nonlinear ODEs using vfNN (continued). Minimization of the elastic energy of a colloidal membrane composed of hard rods (Eqs. 30–34) [44]. (a) the tilt angle with respect to membrane normal. (b) is the scalar order parameter describing the orientation of the rods with respect to the membrane normal. The x axis is nondimensionalized by the twist penetration depth . The membrane interior is at x = 0, whereas x = L = 10 is the position of the membrane edge. The dashed red lines indicate the solutions using vfNN, and the blue curves correspond to the solutions from FEM. Two separate deep neural networks (three layers with 20 neurons at each layer) for each of the coupled dependent variables , were used.
lution 1 and solution 2 are stable (corresponding to the equilibrium of the pendulum at u = 0 and ), and solution 3 is unstable (corresponding to ). By changing the initial guess, vfNN locates all three solutions regardless of their stability in agreement with the FEM profiles (Fig. 3b).
The third nonlinear problem with a single variable we investigate is the Poisson-Boltzmann equation. The problem herein describes the electrostatic potential u in the proximity of a uniform planar charge distribution in the presence of an electrolyte solution as function of the normal distance x from the charged surface. For a constant determined by system properties such as the surface charge density, valency of the screening charges in the electrolyte solution, and temperature, the variational formulation corresponding to mixed boundary conditions
in a domain is
where corresponds to the normalized electric field near the charged surface. The last term of Eq. 27 indicates how a Neumann condition is applied in vfNN. The corresponding ELE and the Neumann boundary condition at x = a is given by
We complete the setup by choosing our parameters as , and impose the Dirichlet boundary condition at ,
The results from vfNN and FEM agree very well (Fig. 3c), indicating that vfNN reliably tackles nonlinear problems with mixed boundary conditions.
Finally, we consider a nonlinear problem with two coupled dependent variables in a single functional that models a colloidal flat monolayer of monodisperse chiral hard rods. Whereas the rods are perfectly aligned in the normal direction to the membrane surface in the interior of the monolayer because of polymer-induced depletion interactions, the tilting of rods towards the membrane edge due to molecular chirality (with the units of inverse length) can be treated as a packing problem with liquid crystalline symmetry, specifically as a single layer of a chiral Smectic-A (Sm-A*) phase that melts into a cholesteric (Ch) order toward the monolayer edge [44, 45]. The rod tilting with an angle with respect to the monolayer surface normal manifests itself as twist deformations with a penetration depth , and the melting of Sm-A* into Ch can be represented by a phase field with a coherence length akin to the real part of the smectic order parameter. Defining a unitless parameter , the unitless form of the free energy nondimensionalized by in a unitless domain ( : monolayer bulk : monolayer edge) is given by [44, 45]
The corresponding Euler-Lagrange equations for and are
We set the parameters as , , , and impose the following Dirichlet boundary conditions:
To improve the convergence rate, we formulate the order parameter in terms of the NN output as , since the parity symmetry of evident in Eq. 30 otherwise leads to a highly degenerate loss landscape. When the rods are achiral ( ), twist deformations can still be observed since the rod tilting minimizes the membrane surface exposed to the depletant polymer solution [44, 45]. In our theory, the twist of achiral rods is enforced by the Dirichlet condition at in Eq. 34. The results are shown in Fig. 4 where the profiles from vfNN are compared to the FEM data, indicating excellent agreement for this benchmark model with more than one dependent variables, each represented by a separate neural network that has three layers and 20 neurons per layer.
IV. DISCUSSION AND CONCLUSIONS
In this paper, we have presented the variational functional neural network (vfNN) that finds the states of a system by optimizing a physically motivated variational formulation. Many physical systems are described by an integral functional as formulated in Eq. 1. The analytical extremization of , i.e., yields the Euler-Lagrange equations, which are the equations of motion that determine the physical states. As opposed to PINN (cf. Eq. 8), vfNN uses as the error function and optimizes it with two clear strengths over PINN: first, vfNN employs characteristic physical scales that govern the relative weights of the terms in the error function , instead of the ad hoc weight coefficients . Second, because always has lower order derivatives than the EL equations, we have found that vfNN consistently improves the computation times with respect to PINN for many functionals as fewer backpropagation steps are needed to take the lower order derivatives.
While a variational formulation provides significant computational advantage due to a loss function with lower order derivatives, stable solutions of the variations do not always exist. To address this issue, our vfNN algorithm incorporates quasi-Newton optimization based on the SR1 Hessian update paired with a stochastic line search method based on a Metropolis criterion. Our optimizer successfully converges to the first-order critical points regardless of their stability for ODEs, highlighting its potential in addressing problems where traditional optimizers, such as ADAM, may fail.
In its current state, our algorithm is agnostic to the nature of the optima, i.e., whether they are maxima, minima, saddle, or inflection points. Finding the inflection
points corresponding to the “conjugate points” (Appendices A and B) is of paramount importance because of their physical significance: depending on the problem, characterizing the conjugate points can reveal dynamical or phase behavior, as well as the universal properties of a physical system. For example, in a magnetic system where magnetization is defined by a function ( : temperature), there is a ferromagnetic-to-paramagnetic transition at a critical temperature , which is a conjugate point. At , the free energy of the system, which is the error function to be optimized, has an inflection point. When , the free energy landscape develops a saddle point where it becomes nonconvex. The point leads to a pitchfork bifurcation [46]. So, if the identification and characterization of conjugate points can be automated, vfNN could calculate the phase transitions of a many-body system or bifurcations and stability of a dynamical system. To find the conjugate points together with the physical solutions in a nonconvex landscape, an iterative algorithm that assesses local stability during optimization is needed.
Future work will further aim to extend vfNN to PDEs where the domain of independent variables is composed of the space and time dimensions. However, a generic vfNN PDE solver should treat space and time as independent variables on equal grounds. We will incorporate this approach to develop a general vfNN that can tackle the canonical forms of elliptic, parabolic, and hyperbolic linear PDEs before an extension to nonlinear PDEs are considered as an ultimate goal.
ACKNOWLEDGMENTS
We thank J. Barone, S. Cheng, J. Gray, M. Pleimling for fruitful discussions and the VT College of Science for financial support. We acknowledge the VT Advanced Research Computing Center for computing resources.
DATA AVAILABILITY
The data and codes that support the findings of this article are openly available at Ref. [42].
Appendix A: Stability of a functional with one independent variable
To determine the stability of a functional, the second variation in must be considered [34]. Here we present simplified picture using a single unknown in one dimension, . Let variation around solution be given by , where is a scalar and is smooth function which obeys boundary conditions:
Then, the second variation in is given by,
For to be a minimum, must be positive for all admissible . This forms a secondary variational problem in . The corresponding Euler-Lagrange equation is called Jacobi's accessory equation [34]:
(A3)
Here, , and denote the second functional derivatives with respect to their subscripts. Eq. A3 is a second order differential equation in with boundary conditions specified by Eq. A1. Let be the solution to Eq. A3 satisfying boundary conditions given in A1. If
-
,
-
has no roots in ,
then the second variation is positive definite; thus, is a minimum [34]. The roots of are defined as the conjugate points to the boundary point . The three sufficiency conditions that determine if is a weak minimum (defined as a minimum over the function space of continuous but not necessarily smooth functions) to the variational problem are
-
is a solution to the Euler-Lagrange equation (Eq. 3),
-
obeys the Legendre condition, ,
-
the domain of has no conjugate points to its boundaries.
Appendix B: Locating conjugate points of functionals with a single linear ordinary Euler-Lagrange equation
We have developed Algorithm 3 to find the conjugate points for a linear ODE by using the bisection method without solving the Jacobi's accessory equation, which requires knowing in the first place. An example for the extremization of a functional from this algorithm is shown in Fig. 2c.
This algorithm has two significant limitations: first, we assume that Legendre condition is satisfied while looking for the conjugate points. Second, it only applies to the linear ODEs since their solution is unique for the given boundary condition. Hence, the solution to the variational problem in the given domain is either a minimum
or not a minimum, and this property is exploited to find the conjugate points.
Algorithm 3: Finding conjugate points
Input: : domain, : loss functional, : tolerance, : tolerance for convergence of vfNN, : epochs
1 ;
2 Optimize vfNN on using ADAM for epochs;
3 if then
4 | return ;
5 else
6 repeat
7 ;
8 repeat
9 ;
10 Optimize vfNN on using ADAM for epochs;
11 if then
12 | ;
13 else
14 ;
15 until ;
16 Append to ;
17 ;
18 until ;
19 return ;
[1] K. Hornik, M. Stinchcombe, and H. White, Multilayer feedforward networks are universal approximators, Neural networks 2, 359 (1989).
[2] L. B. Rall and G. F. Corliss, An introduction to automatic differentiation, Computational Differentiation: Techniques, Applications, and Tools 89, 1 (1996).
[3] M. Raissi, P. Perdikaris, and G. Karniadakis, Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations, Journal of Computational Physics 378, 686 (2019).
[4] J. D. Toscano, V. Oommen, A. J. Varghese, Z. Zou, N. Ahmadi Daryakenari, C. Wu, and G. E. Karniadakis, From pins to pikans: recent advances in physics-informed machine learning, Machine Learning for Computational Science and Engineering 1, 15 (2025).
[5] B. Zhang, G. Wu, Y. Gu, X. Wang, and F. Wang, Multi-domain physics-informed neural network for solving forward and inverse problems of steady-state heat conduction in multilayer media, Physics of Fluids 34, 116116 (2022), https://pubs.aip.org/aip/pof/article-pdf/doi/10.1063/5.0116038/16602534/116116_1_online.pdf.
[6] T. Hu, B. Jin, and Z. Zhou, Solving poisson problems in polygonal domains with singularity enriched physics informed neural networks, SIAM Journal on Scientific Computing 46, C369 (2024), https://doi.org/10.1137/23M1601195.
[7] N. Ahmadi Daryakenari, M. De Florio, K. Shukla, and G. E. Karniadakis, Ai-aristotle: A physics-informed framework for systems biology gray-box identification, PLOS Computational Biology 20, 1 (2024).
[8] A. Yazdani, L. Lu, M. Raissi, and G. E. Karniadakis, Systems biology informed deep learning for inferring parameters and hidden dynamics, PLOS Computational Biology 16, 1 (2020).
[9] H. Jo, H. Hong, H. J. Hwang, W. Chang, and J. K. Kim, Density physics-informed neural networks reveal sources of cell heterogeneity in signal transduction, Patterns 5, 100899 (2024).
[10] Y. Qian, G. Zhu, Z. Zhang, S. Modepalli, Y. Zheng, X. Zheng, G. Frydman, and H. Li, Coagulo-Net: Enhancing the mathematical modeling of blood coagulation using physics-informed neural networks, Neural Netw 180, 106732 (2024).
[11] X. Jin, S. Cai, H. Li, and G. E. Karniadakis, Nsfnets (navier-stokes flow nets): Physics-informed neural networks for the incompressible navier-stokes equations, Journal of Computational Physics 426, 109951 (2021).
[12] H. Eivazi, M. Tahani, P. Schlatter, and R. Vinnesa, Physics-informed neural networks for solving reynolds-averaged navier-stokes equations, Physics of Fluids 34, 075117 (2022), https://pubs.aip.org/aip/pof/article-pdf/doi/10.1063/5.0095270/19816179/075117_1_online.pdf.
[13] A. D. Jagtap, Z. Mao, N. Adams, and G. E. Karniadakis, Physics-informed neural networks for inverse problems in supersonic flows, Journal of Computational Physics 466, 111402 (2022).
[14] M. De Florio, E. Schiassi, B. D. Ganapol, and R. Furfaro, Physics-informed neural networks for rarefied-gas dynamics: Thermal creep flow in the bhat-nagar-gross-krook approximation, Physics of Fluids
33, 047110 (2021), https://pubs.aip.org/aip/pof/article-pdf/doi/10.1063/5.0046181/13636200/047110_1_online.pdf.
[15] W. Li, M. Z. Bazant, and J. Zhu, A physics-guided neural network framework for elastic plates: Comparison of governing equations-based and energy-based approaches, Computer Methods in Applied Mechanics and Engineering 383, 113933 (2021).
[16] J.-H. Bastek and D. M. Kochmann, Physics-informed neural networks for shell structures, European Journal of Mechanics - A/Solids 97, 104849 (2023).
[17] U. b. Waheed, E. Haghighat, T. Alkhalifah, C. Song, and Q. Hao, Pinneik: Eikonal solution using physics-informed neural networks, Computers and amp; Geosciences 155, 104833 (2021).
[18] L. F. Nazari, E. Camponogara, and L. O. Seman, Physics-informed neural networks for modeling water flows in a river channel, IEEE Transactions on Artificial Intelligence 5, 1001 (2024).
[19] Z. Wu, H. Wang, C. He, B. Zhang, T. Xu, and Q. Chen, The application of physics-informed machine learning in multiphysics modeling in chemical engineering, Industrial & Engineering Chemistry Research 62, 18178 (2023), https://doi.org/10.1021/acs.iecr.3c02383.
[20] E. Kharazmi, Z. Zhang, and G. E. Karniadakis, Variational physics-informed neural networks for solving partial differential equations (2019), arXiv:1912.00873 [cs.NE].
[21] E. Kharazmi, Z. Zhang, and G. E. Karniadakis, hp-vpins: Variational physics-informed neural networks with domain decomposition, Computer Methods in Applied Mechanics and Engineering 374, 113547 (2021).
[22] S. Berrone, C. Canuto, and M. Pintore, Variational physics informed neural networks: the role of quadratures and test functions, Journal of Scientific Computing 92, 100 (2022).
[23] Y. Zang, G. Bao, X. Ye, and H. Zhou, Weak adversarial networks for high-dimensional partial differential equations, Journal of Computational Physics 411, 109409 (2020).
[24] R. Khodayi-Mehr and M. Zavlanos, Varnet: Variational neural networks for the solution of partial differential equations, in Proceedings of the 2nd Conference on Learning for Dynamics and Control, Proceedings of Machine Learning Research, Vol. 120, edited by A. M. Bayen, A. Jadbabaie, G. Pappas, P. A. Parrilo, B. Recht, C. Tomlin, and M. Zeilinger (PMLR, 2020) pp. 298–307.
[25] W. E and B. Yu, The deep ritz method: A deep learning-based numerical algorithm for solving variational problems, Communications in Mathematics and Statistics 6, 1 (2018).
[26] M. Liu, Z. Cai, and K. Ramani, Deep ritz method with adaptive quadrature for linear elasticity, Computer Methods in Applied Mechanics and Engineering 415, 116229 (2023).
[27] C. Uriarte, D. Pardo, I. Muga, and J. Muñoz-Matute, A deep double ritz method (d2rm) for solving partial differential equations using neural networks, Computer Methods in Applied Mechanics and Engineering 405, 115892 (2023).
[28] J. Lu, Y. Lu, and M. Wang, A priori generalization analysis of the deep ritz method for solving high dimensional elliptic equations (2021), arXiv:2101.01708 [math.NA].
[29] E. Samaniego, C. Anitescu, S. Goswami, V. Nguyen-Thanh, H. Guo, K. Hamdia, X. Zhuang, and T. Rabczuk, An energy approach to the solution of partial differential equations in computational mechanics via machine learning: Concepts, implementation and applications, Computer Methods in Applied Mechanics and Engineering 362, 112790 (2020).
[30] V. M. Nguyen-Thanh, C. Anitescu, N. Alajlan, T. Rabczuk, and X. Zhuang, Parametric deep energy approach for elasticity accounting for strain gradient effects, Computer Methods in Applied Mechanics and Engineering 386, 114096 (2021).
[31] S. Karumuri, R. Tripathy, I. Bilionis, and J. Panchal, Simulator-free solution of high-dimensional stochastic elliptic partial differential equations using deep neural networks, Journal of Computational Physics 404, 109120 (2020).
[32] V. M. Nguyen-Thanh, X. Zhuang, and T. Rabczuk, A deep energy method for finite deformation hyperelasticity, European Journal of Mechanics-A/Solids 80, 103874 (2020).
[33] H. Sheng and C. Yang, Pfnn: A penalty-free neural network method for solving a class of second-order boundary-value problems on complex geometries, Journal of Computational Physics 428, 110085 (2021).
[34] I. M. Gelfand, R. A. Silverman, et al., Calculus of variations (Courier Corporation, 2000).
[35] L. Lu, R. Pestourie, W. Yao, Z. Wang, F. Verdugo, and S. G. Johnson, Physics-informed neural networks with hard constraints for inverse design, SIAM Journal on Scientific Computing 43, B1105 (2021), https://doi.org/10.1137/21M1397908.
[36] D. P. Kingma and J. Ba, Adam: A method for stochastic optimization (2017), arXiv:1412.6980 [cs.LG].
[37] D. C. Liu and J. Nocedal, On the limited memory bfgs method for large scale optimization, Mathematical programming 45, 503 (1989).
[38] J. Nocedal and S. J. Wright, Numerical optimization (Springer, 1999).
[39] S. Chib and E. Greenberg, Understanding the metropolis-hastings algorithm, The american statistician 49, 327 (1995).
[40] S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi, Optimization by simulated annealing, Science 220, 671 (1983).
[41] D. Bertsimas and J. Tsitsiklis, Simulated annealing, Statistical science 8, 10 (1993).
[42] For data and codes, see https://github.com/nadirkaplan/variational-functional-neural-networks/.
[43] M. S. Alnæs, J. Blechta, J. Hake, A. Johansson, B. Kehlet, A. Logg, C. Richardson, J. Ring, M. E. Rognes, and G. N. Wells, The FEniCS project version 1.5, Archive of Numerical Software 3, 10.11588/ans.2015.100.20553 (2015), software version 2019.1.0.
[44] C. N. Kaplan and R. B. Meyer, Colloidal membranes of hard rods: unified theory of free edge structure and twist walls, Soft Matter 10, 4700 (2014).
[45] M. J. Zakhary, T. Gibaud, C. N. Kaplan, E. Barry, R. Oldenbourg, R. B. Meyer, R. D. Kamien, R. A. Pelcovits, T. R. Powers, and Z. Dogic, Imprintable membranes from incomplete chiral coalescence, Nature Communications 5, 3063 (2014).
[46] S. H. Strogatz, Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering, 2nd ed. (CRC Press, 2015).