feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
115 stars 22 forks source link

Partial derivatives of density profiles #134

Closed prehner closed 1 year ago

prehner commented 1 year ago

This PR introduces routines for the calculation of partial derivatives of density profiles with respect to chemical potential, pressure, and temperature. Since the calculation of the density profiles is implicit, a procedure similiar to that used in the Newton solver is used. The derivatives are calculated analytically using automatic differentiation. Therefore, the calculation is faster and more robust compared to approximating the profiles using numerical differentiation.

With the derivatives in place, enthalpies of adsorption should be readily available. In addition, the derivatives can be used to generate better initial values for the calculation of adsorption isotherms or surface tension diagrams.

While derivatives with respect to $p$ or $\mu$ are also available for heterosegmented functionals, temperature derivatives currently can not be implemented without breaking the interface.