pmutt.statmech.ConstantMode

class pmutt.statmech.ConstantMode(q=1.0, Cv=0.0, Cp=0.0, U=0.0, H=0.0, S=0.0, F=0.0, G=0.0, notes=None)

Bases: _ModelBase

Mode where thermodynamic properties can be arbitrarily set. Note that thermodynamic properties must be explicitly set and are not calculated from other properties.

q

Partition function. Default is 1

Type:

float, optional

Cv

Heat capacity at constant volume in eV/K. Default is 0

Type:

float, optional

Cp

Heat capacity at constant pressure in eV/K. Default is 0

Type:

float, optional

U

Internal energy in eV. Default is 0

Type:

float, optional

H

Enthalpy in eV. Default is 0

Type:

float, optional

S

Entropy in eV/K. Default is 0

Type:

float, optional

F

Helmholtz energy in eV. Default is 0

Type:

float, optional

G

Gibbs energy in eV. Default is 0

Type:

float, optional

notes

Any additional details you would like to include such as source of data. Default is None

Type:

str or dict, optional

__init__(q=1.0, Cv=0.0, Cp=0.0, U=0.0, H=0.0, S=0.0, F=0.0, G=0.0, notes=None)

Methods

__init__([q, Cv, Cp, U, H, S, F, G, notes])

from_dict(json_obj)

Recreate an object from the JSON representation.

get_Cp(units, **kwargs)

Calculate the heat capacity (constant P)

get_CpoR()

Calculate the dimensionless heat capacity (constant pressure)

get_Cv(units, **kwargs)

Calculate the heat capacity (constant V)

get_CvoR()

Calculate the dimensionless heat capacity (constant volume)

get_F(units[, T])

Calculate the Helmholtz energy

get_FoRT([T])

Calculate the dimensionless Helmholtz energy

get_G(units[, T])

Calculate the Gibbs energy

get_GoRT([T])

Calculate the dimensionless Gibbs energy

get_H(units[, T])

Calculate the enthalpy

get_HoRT([T])

Calculate the dimensionless enthalpy

get_S(units, **kwargs)

Calculate the entropy

get_SoR()

Calculate the dimensionless entropy

get_U(units[, T])

Calculate the internal energy

get_UoRT([T])

Calculate the dimensionless internal energy

get_q()

Calculate the partition function

to_dict()

Represents object as dictionary with JSON-accepted datatypes

classmethod from_dict(json_obj)

Recreate an object from the JSON representation.

Parameters:

json_obj (dict) – JSON representation

Returns:

Obj

Return type:

Appropriate object

get_Cp(units, **kwargs)

Calculate the heat capacity (constant P)

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_CpoR

Returns:

Cp – Heat capacity (constant P) in appropriate units

Return type:

float

get_CpoR()

Calculate the dimensionless heat capacity (constant pressure)

Returns:

CpoR – Dimensionless heat capacity (constant pressure)

Return type:

float

get_Cv(units, **kwargs)

Calculate the heat capacity (constant V)

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_CvoR

Returns:

Cv – Heat capacity (constant V) in appropriate units

Return type:

float

get_CvoR()

Calculate the dimensionless heat capacity (constant volume)

Returns:

CvoR – Dimensionless heat capacity (constant volume)

Return type:

float

get_F(units, T=298.15, **kwargs)

Calculate the Helmholtz energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_FoRT

Returns:

F – Hemholtz energy in appropriate units

Return type:

float

get_FoRT(T=298.15)

Calculate the dimensionless Helmholtz energy

Parameters:

T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

FoRT – Dimensionless Helmholtz energy

Return type:

float

get_G(units, T=298.15, **kwargs)

Calculate the Gibbs energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_GoRT

Returns:

G – Gibbs energy in appropriate units

Return type:

float

get_GoRT(T=298.15)

Calculate the dimensionless Gibbs energy

Parameters:

T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

GoRT – Dimensionless Gibbs energy

Return type:

float

get_H(units, T=298.15, **kwargs)

Calculate the enthalpy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_HoRT

Returns:

H – Enthalpy in appropriate units

Return type:

float

get_HoRT(T=298.15)

Calculate the dimensionless enthalpy

Parameters:

T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

HoRT – Dimensionless enthalpy

Return type:

float

get_S(units, **kwargs)

Calculate the entropy

Parameters:
  • units (str) – Units as string. See R() for accepted units.

  • kwargs (keyword arguments) – Parameters needed by get_SoR

Returns:

S – Entropy in appropriate units

Return type:

float

get_SoR()

Calculate the dimensionless entropy

Returns:

SoR – Dimensionless entropy

Return type:

float

get_U(units, T=298.15, **kwargs)

Calculate the internal energy

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • T (float, optional) – Temperature in K. Default is 298.15 K

  • kwargs (keyword arguments) – Parameters needed by get_UoRT

Returns:

U – Internal energy in appropriate units

Return type:

float

get_UoRT(T=298.15)

Calculate the dimensionless internal energy

Parameters:

T (float, optional) – Temperature in K. Default is 298.15 K

Returns:

UoRT – Dimensionless internal energy

Return type:

float

get_q()

Calculate the partition function

Returns:

q – Partition function

Return type:

float

to_dict()

Represents object as dictionary with JSON-accepted datatypes

Returns:

obj_dict

Return type:

dict