Finding Exact Forms on a Thermodynamic Manifold

Because only two variables are needed to characterize a simple thermodynamic system in equilibrium, any such system is constrained on a 2D manifold. Of particular interest are the exact 1-forms on the cotangent space of that manifold, since the integral of exact 1-forms is path-independent, a crucial property satisfied by state variables such as internal energy dE and entropy dS. Our prior work[1] shows that given an appropriate language of vector calculus, a machine can re-discover the Maxwell equations and the incompressible Navier-Stokes equations from data. In this paper, We enhance this language by including differential forms and show that machines can re-discover the equation for entropy dS given data. Since entropy appears in various fields of science in different guises, a potential extension of this work is to use the machinery developed in this paper to let machines discover the expressions for entropy from data in fields other than classical thermodynamics.


Introduction
We are concerned with developing a language that can allow computers to re-discover the expressions for entropy in the setting of classical thermodynamics.The reason we start by considering entropy from classical thermodynamics is that classical thermodynamics provides us with crucial clues of what form our language can take: the fact that entropy appears as a path-independent state variable suggests that the language be differential forms.Forms are natural objects to differentiate and integrate [3], and they fit nicely with our existing framework of vector calculus [1].The outline of this paper is as follows.In section 2, we briefly explain classical thermodynamics as framed in differential geometry and introduce the concept of the thermodynamic manifold.In section 3, we derive the most general expression for exact 1-forms for a simple thermodynamic system.In section 4, we introduce our existing framework for automated theorem-discovery and show that the expression for entropy can be re-discovered from data.We close the paper by considering the significance of the approach used in this paper and highlight potential extensions of this work.

The geometry of thermodynamics
We model the system of interest using an ideal gas of a certain volume.The system is allowed to contract and expand, exchange heat with the surroundings, and do work, assuming the processes are quasi-static.We can of course represent the state of the system on a p-V diagram, but that hides much of the richness of the system.If, instead, we treat the system as a submanifold of R 3 , we will discover much structure by using the language of differential forms [2].Let that submanifold occupied by the simple thermodynamic system be denoted by M 2 , the superscript indicating that the submanifold is locally R 2 .Then, the space of 1-forms at a point on Therefore, on this submanifold, we can expand any 1-form in any basis consisting of the differentials of a set of 2 coordinate functions, dx and dy.For example, in Caratheodory's formulation of thermodynamics [2], the first law reads where Q 1 is the heat 1-form and W 1 is the work 1-form.The superscript refers to the dimension of the form.Given the knowledge of entropy and work, we can expand the above equation as The above example shows that indeed, dE as a 1-form can be expanded in a basis {dS, dV} using only the variables S and V.In the following analysis, without loss of generality 1 we pick the basis of our 1-forms as {dp, dV} with the goal of expressing every 1-form in terms of p and V.In addition to the variables p and V, we have 2 other important "constants", nR and c v , where the first combination comes from the ideal gas law pV = nRT, and c v is the heat capacity which appears in dE = c v dT.

A general expression for exact 1-forms
By definition, the goal is to look for any 1-form f 1 such that f 1 = dg, where g = g(p, V) is a 0-form function.Instead of enumerating all possible g and taking the differential to get f 1 , we observe that on the thermodynamic manifold, all closed 1-forms are exact.This is because of the De Rham cohomology of this manifold, which has vanishing first Betti number b 1 = 0 (i.e. it is retractable to a point).By De Rham's theorem, all closed 1-forms on this manifold are therefore exact [3].Since all exact 1-forms are automatically closed, to find those exact forms we can simply look for closed 1 Indeed, forms are geometric objects whose properties are coordinate-independent.Exact forms in one basis stay exact in any other basis.
1-forms f 1 such that d f 1 = 0.As we shall see, the condition d f 1 = 0 severely constrains the form f can take, and will reduce the enumeration space enormously.
Using the {dp, dV} basis, we can express every 1-form f 1 on the thermodyanmic submanifold as where A and B are assembled from the symbols of the following set S. Note that consistent with our previous approach [1], we exclude any transcendental functions in the language.
At first sight, enumerating all possible f 1 seems a daunting task, because the enumeration space is too big.However, there are two crucial pieces of information that we can harness to significantly reduce the size of the enumeration space.
First, we demand that the units of the 2 summands in equation ( 2) must agree.This constraint is a physical one that must be satisfied by any equation.The first consequence of this constraint is that we can leave Nk B and c v out of the enumeration space for a while: both of their units contain 1/[Temperature], which does not appear in the unit of p or V. Therefore, they must have the same power in A and B to balance out the temperature.
The second consequence of this constraint on unit is that, if we write then by dimensional analysis we will obtain 2 independent linear equations We have now used up the information of the first constraint.
The second constraint on f 1 is closedness: recall that the goal is to enumerate closed 1-forms only.That said, we want f 1 such that d f 1 = 0, which, from (1), is simply Therefore, if in (3) we assume that β = 0 and α = 0, then by equating the partial derivatives we obtain another linear equation but this leads to a contradiction with (5).Therefore, we must have and this combined with (5) gives us Therefore, (3) becomes and if we merge the previously left-out Nk B and c v into the constants c 1 and c 2 , we obtain the final ansatz of our closed 1-form: where c 1 and c 2 are constants of the same dimension.We shall utilize this finding in the next section.

Entropy
A valid thermodynamic theorem (equation) must equate n-forms to n-forms.The first law, equation ( 1), is one such example that equates 1-forms to 1-forms.This section is concerned with finding a thermodynamic theorem governing entropy for a simple system in equilibrium.
In our prior work on Maxwell and Navier-Stokes, we created a program to enumerate "theorems" (instantiated by equations) from a set of symbols, and then validate a certain theorem by using the output of a virtual experiment to see whether the constants in the theorem can be found.
To start with, we need to create a finite set consisting of singleton theorems where each singleton theorem A i is associated with a certain complexity score and is represented by a linear equation where c 0 and c 1 are constants to be found by the program to test the validity of the theorem.A concrete example for a singleton theorem is when A 1 = ∇ • B, where B is the magnetic field.Then the first singleton theorem enumerated from the set is and electromagnetism tells us that this is a valid theorem for c 0 = 0 and c 1 = 1.
After we input the singleton theorem set, the program takes another input N, the total complexity score, and efficiently enumerates all candidate theorems whose complexity scores are no more than N [5].For example, suppose each A i in the set H has a complexity score of 1, then theorems of complexity score 2 are of the following form: The program uses a smart way to validate a theorem as soon as it is enumerated by using the output of a virtual experiment.For example, the virtual experiment we used to re-discover the Maxwell equations is the far-field behavior of an oscillating electric dipole with a certain angular frequency and dipole moment [1].From the output of this virtual experiment the program can validate theorems such as c 0 + c 1 ∇ • B = 0.The method of validating theorems involves the use of applied linear algebra, and the details can be found in [1].
The above is a summary of the essential process of enumerating and validating theorems.In the following, we shall show that an expression for entropy can be found using this process.To start with, we hypothesize that entropy S is an observable of a certain virtual experiment 2 , and that its differential dS is a 1-form.Then, using the theoretical results obtained from the previous section, we can form a tentative theorem set One theorem that is guaranteed to be enumerated from T is To test whether the above equation is a valid theorem or not, we must use the output from a certain virtual experiment and solve a system of linear equations to find the constants.If the constants have a unique nontrivial solution, then we conclude that (8) is a valid theorem.In this application, we shall simply use 1 mole of monatomic gas that can contract and expand as the virtual experiment, whose output for entropy has a simple mathematical expression valid for moderate temperature [4] where a is a constant whose specific value is irrelevant in this application: to set up equations, we want the difference in entropy instead of its absolute value.In general, the virtual experiment can be represented by a trajectory x(t) on the p-V diagram parameterized by t: and the output of the virtual experiment is S(t) = S(p(t), V(t)).To validate the theorem, we need to pull back (8) onto the t variable and evaluate the integral where ∆S = S(t 2 ) − S(t 1 ), F * t is the pull-back from the p-V plane to t, and c 2 = −c 2 , c 3 = −c 3 .We can then merge c 1 into the other 2 constants to obtain the following equation: In most applications, the output data of the virtual experiment come in discrete forms: and we need to numerically integrate (10) and set up equations to find c 2 and c 3 given a trajectory.
In the following, we use a simplified trajectory to finalize this example with the goal of showing the essentials while avoiding numerical integrations.
To turn (10) into a set of linear equations, we specify 3 points ). Starting at point A, we integrate (8) isochorically to point B, and then isobarically to point C.

2
The assumption of entropy as an observable might be a bit far-fetched.However, just as work (which itself is not a direct observable) can be obtained by measuring force and distance, so entropy can be obtained by calculating heat and measuring temperature.The purpose here is to show how the process of finding theorems works.The 2 equations we obtain are thus Let p 1 = 10000 Pa, V 1 = 22.4 × 10 −3 m 3 (this is the approximate volume of 1 mole of ideal gas at standard room temperature and pressure), and p 2 = 2p 1 , V 2 = 2V 1 .The virtual experiment (instantiated by ( 9)) gives us the following output (given R = 8.3145 J/(mol K) and c v = 3/2R): From the above output of the virtual experiments, we can then solve for c 2 and c 3 in equations (11) and (12).They are c 2 = 12.47175J/K, c 3 = 20.78625J/K.and we conclude that (8) is a valid theorem.In fact, given the knowledge of thermodynamics, we can easily show that c 2 = c v , c 3 = c v + R, and the correct expression for dS for 1 mole of ideal gas is where c 0 is an additive constant.In this example, we used a simplified approach to illustrate the core idea of constructing tentative theorems from a given set and the use of virtual experiment to determine the validity of a theorem.The complete process can be found in [1].

Conclusion
We have shown that we can greatly simplify the problem of enumerating exact 1-forms using one mathematical (closedness) and one physical (dimensional analysis) constraint.In our previous work, we dealt with re-discovering linear differential theories using the language of vector calculus.The above result shows that there is great potential to extend our previous framework to cover differential forms, which will enable us in the future to re-discover scientific theorems that can be geometrically Ricci curvature, entropy, and optimal transport.But Ricci curvature, R µν , can be thought of as a vector-valued 1-form when the first index is raised by some metric R µ ν = g µσ R σν .In addition, another vector-valued measure of curvature is θ µ ν = 1 2 R µ νρσ dx ρ ∧ dx σ .Perhaps, given a judicious choice of singleton theorem set and virtual experiment, we could find some curious functional relationship between curvature, entropy (which might also appear as a vector-valued 1-form by covariance), and other physical variables in the transport setting or gradient flow.In re-discovering old theorems, we wish to establish the robustness of this enumeration-validation framework, but the ultimate goal is to apply this framework to find new scientific laws from a wealth of data available that could shed light on scientific discovery.

Figure 1 .
Figure 1.The mesh shows a part of the 2D thermodynamic submanifold embedded in R 3 for an ideal gas pV = Nk B T. The state of the gas is represented by a point on the submanifold.

Figure 2 .
Figure 2. Path of integration from A to B to C.