arXiv:2611.03542cs.LGNov 2026

Manuscript Offprint

arXiv:2611.03542

Variational Functional Neural Networks (vfNN)

Chinmay Katke, C. Nadir Kaplan

Chinmay Katke1,2^{1,2} and C. Nadir Kaplan1−4∗^{1-4*}

1^{1}Department of Physics, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.

2^{2}Center for Soft Matter and Biological Physics, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.

3^{3}Department of Mechanical Engineering, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA.

4^{4}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 L2\mathcal{L}^{2} 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.