Techniques for constructing an energy functional from a system of PDEs Having an energy functional one can write the Euler-Lagrange equations. I want to do the reverse. Having a system of PDEs, I want to find an energy functional that "best" matches those. It is clear that not every system of PDEs is a system of Euler-Lagrange equations, and in the specific cases I am considering this needs not to be the case. Nevertheless I would like to find a functional whose solutions best match the solutions from my system of PDEs (wrt some metric - for example L2). Are there any references on this topic?
 A: I think this Q&A gives you some nice references for your problem: the topic you are investigating is called "inverse problem of the calculus of variation", and I advice you also to have a look at the web site of Enzo Tonti. In particular, recapitulating briefly, Tonti's main result (in its more recent formulation [1]), given a general (linear/nonlinear, local/nonlocal etc.) operator equation
$$
\mathsf{N}\big(x,u(x)\big)=f(x)\label{1}\tag{1}
$$
one can always find a functional $F$ so that its functional derivative
$$
\left.\frac{\mathrm{d}}{\mathrm{d}\varepsilon}F(u+\varepsilon\varphi)\right|_{\varepsilon=0}=0\;\text{ for all $\varphi \in$ domain of $\mathsf{N}$}\iff u\text{ is a solution of \eqref{1}}\label{2}\tag{2}
$$
Moreover, $F$ can be chosen in such a way that $u$ is a minimum for it. However, it is worth to remember that the equation(s) resulting from imposing the vanishing of the functional derivative of $F$ may have not always the form of Euler-Lagrange equations: it depends on the structure of \eqref{1} if this happens or not (see the reference by Filippov in the above linked Q&A for more details on such matters).
Reference
[1] Tonti, Enzo, "Extended variational formulation", Vestnik Rossiĭskogo Universiteta Druzhby Narodov, Seriya Matematika 2, No. 2, 148-162 (1995). ZBL0965.35036.
