The same linear optimization strategy used to minimize the enthalpy can also be applied to minimize the free energy of the system. Although direct ab initio calculation of the formation entropy and free energy of solids is challenging, empirical linear relationships between the molar volume of solids and entropy , or machine learned models based on simple compositional descriptors, may be used to predict the molar Gibbs energy of inorganic solids. Because the reactants and products are either solids (with unit activity) or gaseous oxygen at constant pressure, there is no need to include logarithmic terms in the free energy expression, and so the function is linear. Consequently, the minimization objective in eq. 3 directly corresponds to an expression where one minimizes the Gibbs free energy change of the reaction upon an appropriate change of the cost function terms. Given a vector of Gibbs free energies for each species, 𝑔𝑔 ⃗, (analogous to the vector of enthalpies used above), the objective function has the form 𝑔𝑔 ⃗ 𝑇𝑇 ⋅ 𝑥𝑥 ⃗ -(𝑔𝑔 0 + 𝑔𝑔 𝑂𝑂𝑜𝑜 𝑛𝑛 �⃗ 𝑇𝑇 ⋅ 𝑥𝑥 ⃗) , where 𝑔𝑔 𝑂𝑂𝑜𝑜 = -0.31695 eV/atom is the standard molar free energy of gaseous oxygen at 298.15 K and 1 bar (based on the standard molar entropy of 205.147 J/K.mol ; another constant value could be chosen for any other desired partial pressures of oxygen), and the entries in 𝑛𝑛 �⃗ are the number of oxygen atoms are consumed by each of the corresponding products as dictated by its stoichiometry. This can be rearranged into the form (𝑔𝑔 ⃗ -𝑔𝑔 𝑜𝑜𝑜𝑜 𝑛𝑛 �⃗) 𝑇𝑇 ⋅ 𝑥𝑥 ⃗ -𝑔𝑔 0 , which is mathematically equivalent to the minimization problem in eq. 3