by 2D non-linear rootfinding. Newton steps are taken, and the analytic Jacobian is used (thanks to the ability to do derivatives with automatic differentiation). This is all handily wrapped up in the
``solve_pure_critical`` method which requires the user to provide guess values for temperature and density
%% Cell type:code id:46657a96 tags:
``` python
# Values taken from http://dx.doi.org/10.6028/jres.121.011
# Solve for the critical point from a point close to the critical point
T0=192.0
# Critical compressibility factor of P-R is 0.307401308698.. (see https://doi.org/10.1021/acs.iecr.1c00847)
rhoc=(4599200/(8.31446261815324*190.564))/0.3074
rho0=rhoc*1.2345# Perturb to make sure we are doing something in the solver
teqp.solve_pure_critical(modelPR,T0,rho0)
```
%% Cell type:markdown id:e15eeded tags:
## Mixtures
A pure fluid has a single vapor-liquid critical point, but mixtures are different:
* They may have multiple (or zero!) critical points for a given mixture composition
* The critical curves may not emanate from the pure fluid endpoints
When it comes to critical points, intuition from pure fluids is not helpful, or sometimes even counter-productive.
teqp has methods for working with the critical loci of binary mixtures (only binary mixtures, for now) and especially, methods for tracing the critical curves emanating from the pure fluid endpoints.
The tracing method in teqp is based explicitly on the isochoric thermodynamics formalism introduced by Ulrich Deiters and Sergio Quinones-Cisneros. It uses the Helmholtz energy density as the fundamental potential and all other properties are derived from it. For critical curves it is based upon the integration of sets of ordinary differential equations; the differential equations are in the form of derivatives of the molar concentrations of each component in the mixture with respect to an integration variable. The set of ODE is then integrated.
Here is an example of the construction of the critical curves emanating from the pure fluid endpoints for the mixture nitrogen + ethane.