Equilibrate Module#

The equilibrate module implements a Python interface to the Equilibrate and EquilState classes. It also implements a Python class called MELTSmodel that wraps the objective-C classes: EquilibrateUsingMELTSv102, EquilibrateUsingMELTSv110, EquilibrateUsingMELTSv120, EquilibrateUsingpMELTSv561, EquilibrateUsingMELTSwithDEW, and EquilibrateUsingStixrude.

The Equilibrate class provides methods to calculate an equilibrium phase assemblage given a list of Phase class instances.

You can calculate equilibrium in closed thermodynamic systems under a variety of constraints:

  • Temperature and pressure (Gibbs free energy minimization)

  • Entropy and pressure (enthalpy minimization)

  • Temperature and volume (Helmholtz free energy minimization)

  • Entropy and volume (internal energy minimization)

You can also calculate equilibrium under constraints of fixed temperature and pressure in open thermodynamic systems by specifying one or more fixed elemental chemical potentials.

For details of the underlying theory and algorithms implemented in the Equilibrate class, see the notebooks in the PublicNotebooks/Equilibrate folder on the ENKI server.

class thermoengine.equilibrate.EquilState(elements_l, phases_l)#

Class for holding the phase state for an equilibrium model determined by Equilibrate

Parameters:
elements_l[]

A list of strings identifying the chemical elements present in the system

phases_l[]

A list of class instances for phases that are in the system. These instances must derive from the PurePhase or SolutionPhase classes, which are defined in the phases module.

Attributes:
c_matrix

Numpy matrix that maps elements to moles of endmembers

c_omni

Numpy conversion matrix for the omnicomponent phase (if one exists)

c_omni_qr

Tuple of Numpy matrices of the Q,R decomposition of c_omni

c_qr_decomp

Tuple of Numpy matrices of the Q,R decomposition of the c_matrix

element_l

List of atomic numbers of elements in the system

phase_d

A dictionary of dictionaries that holds properties of system phases

pressure

Pressure of the assemblage, in bars

temperature

Temperature of the assemblage, in Kelvins

Methods

G([t, p])

Returns Gibbs free energy of the system; a scalar

affinities([phase_name])

Returns affinity of phases in the system

c_matrix_for_phase(phase_name)

Returns a slice of c_matrix relevant to the specified phase_name

compositions([phase_name, ctype, units])

Returns compositions of phases in the system

d2GdP2([t, p])

Returns the second pressure derivative of the Gibbs free energy of the system; a scalar, and the negative of the volume times the system's coefficient of isothermal compressibility

d2GdPdn([t, p])

Returns the second derivative of G of the system with respect to pressure and mole numbers; a 1-D numpy array

d2GdT2([t, p])

Returns the second temperature derivative of the Gibbs free energy of the system; a scalar, and the negative of the temperature times the system heat capacity

d2GdTdP([t, p])

Returns the cross temperature-pressure derivative of the Gibbs free energy of the system; a scalar, and the volume times the system's coefficient of isothermal expansion

d2GdTdn([t, p])

Returns the second derivative of G of the system with respect to temperature and mole numbers; a 1-D numpy array

d2Gdn2([t, p, element_basis])

Returns the second molar derivative of G of system; a 2-D numpy array

d3GdP2dn([t, p])

Returns the third derivative of G of the system with respect to pressure twice and mole numbers once; a 1-D numpy array

d3GdP3([t, p])

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdPdn2([t, p])

Returns the first pressure and second molar derivative of G of system; a 2-D numpy array

d3GdT2dP([t, p])

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdT2dn([t, p])

Returns the third derivative of G of the system twice with respect to temperature and once with respect to mole numbers; a 1-D numpy array

d3GdT3([t, p])

Returns the third temperature derivative of the Gibbs free energy of the system; a scalar

d3GdTdP2([t, p])

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdTdPdn([t, p])

Returns the third derivative of G of the system with respect to temperature, pressure and mole numbers; a 1-D numpy array

d3GdTdn2([t, p])

Returns the first temperature and second molar derivative of G of system; a 2-D numpy array

d3Gdn3([t, p, phase, cmp])

Returns the third molar derivative of G system for the cmp component of the phase named phase as a 2-D numpy array

dGdP([t, p])

Returns the pressure derivative of the Gibbs free energy of the system; a scalar, and the system volume

dGdT([t, p])

Returns the temperature derivative of the Gibbs free energy of the system; a scalar, and the negative of the system entropy

dGdn([t, p, element_basis, full_output, ...])

Returns the first molar derivative of G of the system; a 1-D numpy array

eval_G(T, P, moles_all_phases)

Calc Gibbs free energy of system without storing state; a scalar

moles_elements(phase_name)

Returns array of moles of elements in phase

moles_v(reaction_v)

Computes of a reaction product

oxide_comp(phase_name[, output, prune_list])

Returns a dictionary of concentrations of oxides in phase

print_state([level, wt_as_oxides])

Prints results about the system state

properties([phase_name, props, units])

Returns properties of phases in the system

set_phase_comp(phase_name, cmp[, ...])

Sets the endmember moles and total moles a phase in the system

tot_grams_phase(phase_name)

Returns total grams of phase

tot_moles_elements()

Returns array of moles of elements in system

tot_moles_phase(phase_name)

Returns total moles of phase

validate_moles_of_all_phases(moles_all_phases)

validate all_phase_moles; a scalar

G(t=1000.0, p=1000.0)#

Returns Gibbs free energy of the system; a scalar

affinities(phase_name=None)#

Returns affinity of phases in the system

Parameters:
phase_namestr, default None

Name of phase in system. If None, returns a dictionary of system phases, with names as keys and ‘stable’ or ‘unstable’ as values.

property c_matrix#

Numpy matrix that maps elements to moles of endmembers

Moles of endmembers are indexed by row, and moles of elements are indexed by column.

Returns:
Numpy 2-D array
c_matrix_for_phase(phase_name)#

Returns a slice of c_matrix relevant to the specified phase_name

Parameters:
phase_namestr

Name of a system phase

property c_omni#

Numpy conversion matrix for the omnicomponent phase (if one exists)

Moles of endmembers are indexed by row, and moles of elements are indexed by column.

Returns:
np 2-D array
property c_omni_qr#

Tuple of Numpy matrices of the Q,R decomposition of c_omni

Returns:
tuple
property c_qr_decomp#

Tuple of Numpy matrices of the Q,R decomposition of the c_matrix

Returns:
tuple
compositions(phase_name=None, ctype='components', units='moles')#

Returns compositions of phases in the system

Parameters:
phase_namestr, default None

Name of phase in system

ctypestr, default ‘components’

Compositional descriptor. Permitted: ‘components’, ‘oxides’, ‘elements’

unitsstr, default ‘moles’

Units of composition. Permitted: ‘moles’, ‘mole_frac’, ‘wt%’

Returns:
resultnumpy array

One dimensional vector

Notes

If units is set to ‘oxides’ or ‘elements’, results are returned in an array of standard length and order.

d2GdP2(t=1000.0, p=1000.0)#

Returns the second pressure derivative of the Gibbs free energy of the system; a scalar, and the negative of the volume times the system’s coefficient of isothermal compressibility

d2GdPdn(t=1000.0, p=1000.0)#

Returns the second derivative of G of the system with respect to pressure and mole numbers; a 1-D numpy array

d2GdT2(t=1000.0, p=1000.0)#

Returns the second temperature derivative of the Gibbs free energy of the system; a scalar, and the negative of the temperature times the system heat capacity

d2GdTdP(t=1000.0, p=1000.0)#

Returns the cross temperature-pressure derivative of the Gibbs free energy of the system; a scalar, and the volume times the system’s coefficient of isothermal expansion

d2GdTdn(t=1000.0, p=1000.0)#

Returns the second derivative of G of the system with respect to temperature and mole numbers; a 1-D numpy array

d2Gdn2(t=1000.0, p=1000.0, element_basis=True)#

Returns the second molar derivative of G of system; a 2-D numpy array

Parameters:
element_basisbool, def True

If True, returns a projected Hessian on an element basis

d3GdP2dn(t=1000.0, p=1000.0)#

Returns the third derivative of G of the system with respect to pressure twice and mole numbers once; a 1-D numpy array

d3GdP3(t=1000.0, p=1000.0)#

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdPdn2(t=1000.0, p=1000.0)#

Returns the first pressure and second molar derivative of G of system; a 2-D numpy array

d3GdT2dP(t=1000.0, p=1000.0)#

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdT2dn(t=1000.0, p=1000.0)#

Returns the third derivative of G of the system twice with respect to temperature and once with respect to mole numbers; a 1-D numpy array

d3GdT3(t=1000.0, p=1000.0)#

Returns the third temperature derivative of the Gibbs free energy of the system; a scalar

d3GdTdP2(t=1000.0, p=1000.0)#

Returns the third pressure derivative of the Gibbs free energy of the system; a scalar

d3GdTdPdn(t=1000.0, p=1000.0)#

Returns the third derivative of G of the system with respect to temperature, pressure and mole numbers; a 1-D numpy array

d3GdTdn2(t=1000.0, p=1000.0)#

Returns the first temperature and second molar derivative of G of system; a 2-D numpy array

d3Gdn3(t=1000.0, p=1000.0, phase=None, cmp=None)#

Returns the third molar derivative of G system for the cmp component of the phase named phase as a 2-D numpy array

Parameters:
phasestr, def None

Phase identity

cmpint, def None

For the phase named phase d3Gdn3[cmp][*][*] is returned

dGdP(t=1000.0, p=1000.0)#

Returns the pressure derivative of the Gibbs free energy of the system; a scalar, and the system volume

dGdT(t=1000.0, p=1000.0)#

Returns the temperature derivative of the Gibbs free energy of the system; a scalar, and the negative of the system entropy

dGdn(t=1000.0, p=1000.0, element_basis=True, full_output=False, use_omni_phase=False)#

Returns the first molar derivative of G of the system; a 1-D numpy array

Parameters:
element_basisbool, def True

If True, returns a projected array of element chemical potentials

full_outputbool, def False

If True, returns a tuple with full output from numpy lstlq method

use_omni_phasebool, def False

If True, returns a projected array of element chemical potentials using the omnicomponent phase as a basis. The system must have an omnicomponent phase, and element_basis must be set to True for this keyword to have effect.

property element_l#

List of atomic numbers of elements in the system

Returns:
A Python list
eval_G(T, P, moles_all_phases)#

Calc Gibbs free energy of system without storing state; a scalar

moles_elements(phase_name)#

Returns array of moles of elements in phase

Parameters:
phase_namestr

Name of a system phase

Returns:
resultnp_array

Numpy array of mole numbers of the reduced set of elements in the phase

moles_v(reaction_v)#

Computes of a reaction product

moles (scalar) = (mole vector of all endmembers of all active phases in the system) x (input mole vector of reaction coefficients)

Parameters:
reaction_vndarray

Array of reaction coefficients

Returns:
molesfloat

Moles of reaction product

property omni_phase_name: str#

Name of the omnicomponent phase

Returns:
str
oxide_comp(phase_name, output='wt%', prune_list=True)#

Returns a dictionary of concentrations of oxides in phase

Parameters:
phase_namestr

Name of a system phase

outputstr, default “wt%”

Units of output: ‘wt%’ (default), ‘moles’, ‘grams’

prune_listbool, default True

Remove zeroed valued entries

Returns:
resultcollections.OrderedDict

Dictionary of oxide concentration values, keyed by oxide

property phase_d#

A dictionary of dictionaries that holds properties of system phases

Returns:
Dictionary of phases in the system (dict)
property pressure#

Pressure of the assemblage, in bars

Returns:
float
print_state(level='summary', wt_as_oxides=True)#

Prints results about the system state

Parameters:
levelstr

Level of detail to be printed

wt_as_oxidesbool, default True

Print wt% values on an oxide basis; otherwise print wt% of endmember components.

properties(phase_name=None, props=None, units=False)#

Returns properties of phases in the system

Parameters:
phase_namestr, default None

Name of phase in system. If None, returns a dictionary of system phases, with names as keys and ‘stable’ or ‘unstable’ as values.

propsstr, default None

Name of property to be retrieved. If None, a list of valid properties is returned.

unitsbool, default False

Property units are provided as the second entry of a returned tuple.

set_phase_comp(phase_name, cmp, input_as_elements=False)#

Sets the endmember moles and total moles a phase in the system

Parameters:
phase_namestr

Name of a system phase

cmpndarray

1-D Numpy array with compositional data

input_as_elementsbool, def False

If True, convert input array from moles of elements to moles of endmember components.

Returns:
validbool

True if input composition is valid for phase

property temperature#

Temperature of the assemblage, in Kelvins

Returns:
float
tot_grams_phase(phase_name)#

Returns total grams of phase

Parameters:
phase_namestr

Name of a system phase

tot_moles_elements()#

Returns array of moles of elements in system

Returns:
resultnp_array

Numpy array of mole numbers of the reduced set of elements in the system

tot_moles_phase(phase_name)#

Returns total moles of phase

Parameters:
phase_namestr

Name of a system phase

validate_moles_of_all_phases(moles_all_phases, debug: int = 0)#

validate all_phase_moles; a scalar

class thermoengine.equilibrate.Equilibrate(element_l=None, phase_l=None, lagrange_l=None)#

Class for minimizing a generic thermodynamic potential in order to calculate an equilibrium phase assemblage.

The default potential is the Gibbs free energy.

Parameters:
element_l[], default None

See documentation for element_list attribute.

phase_l[], default None

See documentation for phase_list attribute.

lagrange_l[], default None

See documentation for lagrange_list attribute.

Attributes:
A_omni_inv

A matrix that transforms an array/matrix of mole numbers of elements to

bulk_comp

Bulk composition of the system as moles of elements

CTf

Stoichiometric vectors of element concentrations that embody the

element_list

A list of strings that identify the element basis for the system

entropy

Indicates if entropy is an independent variable of the minimal potential

eps_linear

Convergence criteria for the norm of the linear projection phase of the

eps_minimal_energy

Tolerance for establishing criteria for a minimum in the system potential.

eps_quad_optimal

Convergence criteria for the norm of the quadratic projection phase of

eps_quad_suboptimal

Relaxed convergence criteria for the norm of the quadratic projection

eps_rank

Tolerance for establishing the rank of the projected Hessian, which is

equil_cycle_max

Number of addition/removal cycles allowed for a phase before it is

equil_linear_min

Number of successful linear minimization attempts that do not result in a subsequent dimunition of the quadratic norm after which convergence is accepted as a “minimal energy” condition.

lagrange_list

A list of tuples characterizing the Lagrange transformation of the

lagrange_moles

Moles of chemical potential entities stipulated in dictionaries,

lagrange_no_mol_deriv

Produces a simplified gradient and hessian of the generalized

lagrange_use_omni

If set to True, the algorithm uses the omnicomponent phase exclusively to balance non-linear constraint reactions.

max_linear_iters

Maximum number of linear search steps associated with each quadratic

max_quad_iters

Maximum number of Newton quadratic minimization steps allowed in

moles_in

Moles of phase added to the system on detection of saturation

moles_out

Minimum total moles of phase allowed in system

phase_list

A list of class instances for phases that are permitted to form

phase_separ_threshold

Minimum energy in Joules for phase separation

reactions

Balanced reactions pertaining to the Lagrange constraints

rotate_orthog_proj

Prevents creation of a search direction for potential

use_numpy_lstsq

Flag to toggle method used to solve for quadratic search direction

volume

Indicates if volume is an independent variable of the minimal potential

VT_null

Orthogonal projection operator obtained from constraints on chemical

Methods

calc_flags([force_once_quad_pass, ...])

execute([t, p, bulk_comp, state, ...])

Calculates an equilibrium assemblage, returning the results as an instance of the EquilState class

kc_ferric_ferrous(t, p, m[, mtype, compute, ...])

Calculates oxygen fugacity or ferric-ferrous ratio for silicate melts using the Kress and Carmichael (1991) calibration

kc_print_state([state, silent])

Prints information about the current system state in terms of the Kress and Carmichael (1991) ferrous-ferric equilibrium model

log10NNO(t, p)

Calculates the base 10 logarithm of oxygen fugacity along the nickel- nickel oxide buffer

mu0O2(t, p)

Calculates the chemical potential of oxygen gas in the standard state of unit fugacity at one bar and any tenperature

muNNO(t, p[, delta])

Calculates the excess chemical potential of oxygen along the nickel- nickel oxide (+ delta offset) buffer

Notes

Alternate potentials are specified by stipulating appropriate Lagrange transformations of the Gibbs potential.

property A_omni_inv#

A matrix that transforms an array/matrix of mole numbers of elements to an array/matrix of mole numbers of components of the omnicomponent phase

This matrix is the inverse of a matrix that maps elemental abundances to component mole numbers for the omnicomponent phase. This property is available only if chemical potential constraints are specified in lagrange_list and if there is an omnicomponent phase in the system.

Default is None

readonly

Returns:
2-d nd_array
property CTf#

Stoichiometric vectors of element concentrations that embody the Lagrange constraints

Default is None

readonly

Returns:
np_array or None
property VT_null#

Orthogonal projection operator obtained from constraints on chemical potentials derived from the lagrange_list entries

Default is None

readonly

Returns:
np array or None
property bulk_comp#

Bulk composition of the system as moles of elements

readwrite

Returns:
numpy array
class calc_flags(force_once_quad_pass: 'bool' = False, require_quad_pass_before_phase_addition: 'bool' = False)#
property element_list#

A list of strings that identify the element basis for the system

For example,[‘H’,’C’,’O’,’Na’,’Mg’,’Al’,’Si’,’P’,’K’,’Ca’,’Ti’,’Cr’, ‘Mn’,’Fe’,’Co’,’Ni’]

readonly

Returns:
A Python list
property entropy#

Indicates if entropy is an independent variable of the minimal potential and if temperature is a dependent variable

True if yes; False if reverse.

readonly

Returns:
Flag (bool)
property eps_linear#

Convergence criteria for the norm of the linear projection phase of the equilibrium calculation

readwrite

Returns:
Convergence tolerance (number)
property eps_minimal_energy#

Tolerance for establishing criteria for a minimum in the system potential.

Successive linear minimization attempts (equil_linear_min) that do not result in a subsequent dimunition of the quadratic norm within this tolerance result in convergence as a “minimal energy” condition.

readwrite

Returns:
Tolerance (number)
property eps_quad_optimal#

Convergence criteria for the norm of the quadratic projection phase of the equilibrium calculation

readwrite

Returns:
Convergence tolerance (number)
property eps_quad_suboptimal#

Relaxed convergence criteria for the norm of the quadratic projection phase of the equilibrium calculation

readwrite

Returns:
Convergence tolerance (number)
property eps_rank#

Tolerance for establishing the rank of the projected Hessian, which is needed to compute a valid quadratic search direction

readwrite

Returns:
Tolerance (number)
property equil_cycle_max#

Number of addition/removal cycles allowed for a phase before it is suppressed from the equilibrium assemblage

readwrite

Returns:
Iteration limit (int)
property equil_linear_min#

Number of successful linear minimization attempts that do not result in a subsequent dimunition of the quadratic norm after which convergence is accepted as a “minimal energy” condition.

readwrite

Returns:
Iteration limit (int)
execute(t=1000.0, p=1000.0, bulk_comp=None, state=None, con_deltaNNO=None, debug=0, stats=False) EquilState#

Calculates an equilibrium assemblage, returning the results as an instance of the EquilState class

Parameters:
tfloat, default 1000.0

Temperature in Kelvins

pfloat, default 1000.0

Pressure in bars

bulk_compnumpy array, default None

Bulk composition of the system. Array of element concentrations, of the length and order of self.element_list

stateEquilState, default None

An instance of the EquilState class generated by this method. This parameter is only specified for a sequence of equilibrium calculations where the state of the system is initialized from a previous computation.

con_deltaNNOfloat or None

A non-None value for this parameter is ignored unless the system contains an omnicomponnet liquid phase of either 15 or 16 endmember components modeled after Ghiorso and Sack (1995) or Ghiorso and Gualda (2015), i.e. a MELTS silicate liquid thermodynamic model. If a value is set, the liquid is constrained to follow the nickel- nickel oxide oxygen buffer plus the offset value, con_deltaNNO, which is specified in log 10 fO2 units. For example, a value of 1.0 will force the system to equilibrate on the NNO+1 oxygen buffer by adjusting the ratio of ferric and ferrous iron according to the Kress and Carmichael (1991) calibration. Setting a value permits the system to be open to oxygen transfer; the bulk moles of oxygen in the system is no longer constrained by input bulk composition.

debugint, default 0

Level of detail printed by the method:

  • 0, no information

  • 1, minimal progress information

  • 2, normal debugint output level

  • 3, verbose debuging output level

statsbool, default False

Toggle printing of statistics associated with calculation progress

Returns:
state: EquilState

An instance of the EquilState class that contains the equilibrium state of the system

Notes

Both the bulk_comp and state parameters cannot be set simultaneously.

kc_ferric_ferrous(t, p, m, mtype='components', compute='logfO2', deltaNNO=0.0, state=None, debug=0)#

Calculates oxygen fugacity or ferric-ferrous ratio for silicate melts using the Kress and Carmichael (1991) calibration

Parameters:
tfloat

Temperature in Kelvins

pfloat

Pressure in bars

mnumpy ndarray

An array of moles of endmember liquid components correcponding to the model of Ghiorso and Sack (1995) (m has length 15) or the model of Ghiorso and Gualda (2015) (m has length 16)

mtypestr, default ‘components’

Type of values in m.

computestr, default ‘logfO2’

Type of output requested, see Returns.

deltaNNOfloat, default 0.0

If ferric-ferrous computation if requested (see compute), the ratio will be computed at log 10 f O2 = nickel-nickel oxide + deltaNNO

stateEquilState or None

Pass state if the omni-phase does not use the standard liquid endmembers (e.g. if you are using pMELTS).

debugint, default 0

Level of detail printed by the method:

  • 0, no information

  • 1, minimal progress information

  • 2, normal debugint output level

  • 3, verbose debuging output level

Returns:
resultfloat

log 10 f O2, if compute is set to ‘logfO2’ (default) excess chemical potential of O2, if compute is set to ‘chem_pot’

resultnumpy ndarray

array of oxide values, with the computed ferric-ferrous ratio appropriate to the imposed log f O2. The oxides are in standard order: SiO2, TiO2, Al2O3, Fe2O3, Cr2O3, FeO, MnO, MgO, NiO, CoO, CaO, Na2O, K2O, P2O5, H2O, [CO2]

kc_print_state(state=None, silent=False)#

Prints information about the current system state in terms of the Kress and Carmichael (1991) ferrous-ferric equilibrium model

Parameters:
stateEquilState, default None

An instance of the EquilState class generated by this method. This parameter is only specified for a sequence of equilibrium calculations where the state of the system is initialized from a previous computation.

silentbool, default False

Flag to silence printing

Returns:
resulttuple or None

Returns None if state is None or the system does not contain an omnicomponent phase name ‘Liquid’, else returns a tuple with the computer log 10 fO2 of the liquid phase relative to the NNO oxygen buffer, the value of log 10 fO2 on the buffer, and the total number of moles of oxygen in the system

property lagrange_list#

A list of tuples characterizing the Lagrange transformation of the Gibbs free energy to form the operative thermodynamic potential

Each tuple has two terms:

  1. Either of the following:

    • A string with content ‘T’ or ‘P’

    • A dictionary keyed on element symbols with values corresponding to stoichiometric coefficients of element chemical potentials. These linear combinations of potentials are fixed by the constraint.

  2. A function to compute values for the constraints specified in (1)

The function has a signature func(T, P, state), where T is temperature in K, P is pressure in bars, and state is an instance of the EquilState class.

readonly

Returns:
A Python list of tuples
property lagrange_moles#

Moles of chemical potential entities stipulated in dictionaries, which are contained in the lagrange_list constraints

Default is None

readonly

Returns:
np.array or None
property lagrange_no_mol_deriv#

Produces a simplified gradient and hessian of the generalized Khorzhinskii potential

Assume that the generalized Khorzhinkii potential is constructed so that the imposed chemical potential is not a function of mole numbers of any phase in the system. Alternatively, the imposed potential is stoichiometrically assembled using reaction coefficients involving equilibrium phases in the assemblage. This option produces a simplified gradient and hessian of the generalized Khorzhinskii potential, but does not affect construction of the equality constraint matrix nor the Lagrange multiplier terms in the hessian of the Lagrangian function. It is seldom necessary to set this flag to True.

Default is False

readwrite

Returns:
Flag (bool)
property lagrange_use_omni#

If set to True, the algorithm uses the omnicomponent phase exclusively to balance non-linear constraint reactions.

Default is True

readwrite

Returns:
Flag (bool)
log10NNO(t, p)#

Calculates the base 10 logarithm of oxygen fugacity along the nickel- nickel oxide buffer

Parameters:
tfloat

Temperature in Kelvins

pfloat

Pressure in bars

Returns:
resultfloat

log (10) f O2

Notes

Algorithm from O’Neill and Pownceby (1993, Contributions to Mineralogy and Petrology, 114, 296-314) using the pressure correction suggested by Frost (1991, Mineralogical Society of America, Reviews in Mineralogy, v. 25, 1-9)

property max_linear_iters#

Maximum number of linear search steps associated with each quadratic iteration

readwrite

Returns:
Number of linear search steps (int)
property max_quad_iters#

Maximum number of Newton quadratic minimization steps allowed in computation

readwrite

Returns:
Number of steps allowed (int)
property moles_in#

Moles of phase added to the system on detection of saturation

readwrite

Returns:
Number of moles added (number)
property moles_out#

Minimum total moles of phase allowed in system

If there is less than this quantity, the phase is discarded.

readwrite

Returns:
Minimum moles allowed (number)
mu0O2(t, p)#

Calculates the chemical potential of oxygen gas in the standard state of unit fugacity at one bar and any tenperature

Parameters:
tfloat

Temperature in Kelvins

pfloat

Pressure in bars

Returns:
resultfloat

standard state chemical potential in Joules/mole of O2 gas

Notes

Algorithm from Berman (1988).

muNNO(t, p, delta=0.0)#

Calculates the excess chemical potential of oxygen along the nickel- nickel oxide (+ delta offset) buffer

Parameters:
tfloat

Temperature in Kelvins

pfloat

Pressure in bars

deltafloat, default 0.0

Offset in base 10 log units relative to the nickel-nickel oxide oxygen buffer

Returns:
resultfloat

Excess chemical potential of oxygen in Joules/mole of O2

Notes

See definition of function log10NNO(t, p)

property phase_list#

A list of class instances for phases that are permitted to form

These instances must derive from the PurePhase or SolutionPhase classes, which are defined in the phases module.

readonly

Returns:
A Python list
property phase_separ_threshold#

Minimum energy in Joules for phase separation

Gibbs free energy threshold that must be attained in order to add another instance of a phase to the equilibrium assemblage. In the phase unmixing (immiscibility) algorithm, candidate compositions are tested and if one is found with a Gibbs free energy below the projected tangent plane to the input composition by this amount, then the new phase instance is added to the system. The value is in Joules and should always be negative. Values larger than the default will likely encourage the detection of false unmixing events; values more negative will likely prevent the detection of unmixing and result in metastable assemblages. Use caution when altering the default value.

Default is -0.1

readwrite

Returns:
Threshold value (number)
property reactions#

Balanced reactions pertaining to the Lagrange constraints

Default is None

readonly

Returns:
np.array or None
property rotate_orthog_proj#

Prevents creation of a search direction for potential minimization that has unwanted coupling of oxygen-bearing components

The basis vectors of the orthogonal projection matrix, VT_null, generated from the lagrange_list attribute, are rotated to zero to minimize the contribution of oxygen to the null space. This flag is enabled to avoid creating a search direction for potential minimization that has unwanted coupling of oxygen-bearing components (for more information, see method _compute_null_space(…)). This option is seldom needed and can be applied only if no omnicomponent phase is present in the system.

Default is False

readwrite

Returns:
Flag (bool)
property use_numpy_lstsq#

Flag to toggle method used to solve for quadratic search direction

The quadratic search direction, dn, is computed by solving a system of equations given by H dn = -g, where H is the projected Hessian and g the projected gradient of the system potential (e.g., the system Gibbs free energy). If use_numpy_lstsq is True (default), the solution method is numpy’s linalg.lstsq method. If False, a QR decomposition method from the Python package statsmodels is utilized. The numpy method uses SVD decomposition and is slower, but more tolerant of rank deficient solutions (e.g., near phase rule violations).

Returns:
Flag (bool)
property volume#

Indicates if volume is an independent variable of the minimal potential and if pressure is a dependent variable

True if yes; False if reverse.

readonly

Returns:
Flag (bool)