Functions

Structures and Constructors

GasChromatographySimulator.ColumnType
Column(L, d, a_d, df, a_df, sp, gas)

Structure describing the GC Column.

Arguments

  • L: Length of the capillary measured in m (meter)
  • d: A function d(x, a_d) of x, the position along the capillary, describing the diameter in m (meter). Or a number for a constant value.
  • a_d: Parameters of the diameter function.
  • d_f: A function d_f(x, a_df) of x, describing the film thickness in m (meter). Or a number for a constant value.
  • a_df: Parameters of the film thickness function.
  • sp: The name of the stationary phase.
  • gas: The name of the mobile phase. Allowed values: He, H2 or N2.
source
GasChromatographySimulator.ColumnMethod
Column(L, d, df, sp, gas)

Construct the structure Column with given values for the case of constant diameter d and film thickness df.

Arguments

  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the capillary measured in m (meter).
  • d_f: Film thickness of the capillary measured in m (meter).
  • sp: The name of the stationary phase.
  • gas: The name of the mobile phase. Allowed values: He, H2 or N2.

Examples

julia julia> Column(10.0, 0.1e-3, 0.1e-6, "DB5", "He")

source
GasChromatographySimulator.ProgramType
Program(time_steps, temp_steps, Fpin_steps, pout_steps, gf, a_gf, T_itp, Fpin_itp, pout_itp)

Structure to describe the temperature and flow/pressure program of a GC Column. The function gf describes an optional thermal gradient.

Arguments

  • time_steps: Time steps in s (seconds).
  • temp_steps: Temperature steps in °C (degree celsius).
  • Fpin_steps: Flow steps in m³/s resp. inlet pressure steps in Pa(a) (pascal, absolute).
  • pout_steps: Outlet pressure steps in Pa(a) (pascal, absolute).
  • gf: Gradient function gf(x, a_gf), describes the thermal gradient.
  • a_gf: Parameters of the gradient function.
  • T_itp: Interpolated (linear) temperature T(x,t), constructed from time_steps, temp_steps and gf.
  • Fpin_itp: Interpolated (linear) flow/inlet pressure Fpin(t), constructed from time_steps and Fpin_steps.
  • pout_itp: Interpolated (linear) outlet pressure pout(t), constructed from time_steps and pout_steps.

Note: The length of the arrays time_steps, temp_steps, pin_steps and a_gf have to be the same.

source
GasChromatographySimulator.ProgramMethod
Program(time_steps::Array{<:Real, 1}, temp_steps::Array{<:Real, 1}, Fpin_steps::Array{<:Real, 1}, pout_steps::Array{<:Real, 1}, L)

Construct the structure Program with given values for the case without a thermal gradient.

Arguments

  • time_steps::Array{<:Real, 1}: Time steps in s (seconds).
  • temp_steps::Array{<:Real, 1}: Temperature steps in °C (degree celsius).
  • Fpin_steps::Array{<:Real, 1}: Flow steps in m³/s resp. inlet pressure steps in Pa(a).
  • pout_steps::Array{<:Real, 1}: Outlet pressure steps in Pa(a) (pascal, absolute).
  • L: Length of the capillary measured in m (meter).

The length of the arrays time_steps, temp_steps, Fpin_steps and pout_steps have to be the same.

The argument L is used to construct the temperature interpolation T_itp(x,t).

Examples

julia> Program([0.0, 60.0, 300.0, 120.0],
        [40.0, 40.0, 320.0, 320.0],
        300000.0.*ones(4),
        zeros(4),
        10.0)
source
GasChromatographySimulator.ProgramMethod
Program(time_steps, temp_steps, Fpin_steps, pout_steps, a_gf, Tcontrol, L)

Construct the structure Program with given values.

Arguments

  • time_steps: Time steps in s (seconds).
  • temp_steps: Temperature steps in °C (degree celsius).
  • Fpin_steps: Flow steps in m³/s resp. inlet pressure steps in Pa(a).
  • pout_steps: Outlet pressure steps in Pa(a) (pascal, absolute).
  • a_gf: Parameters of the gradient function.
  • Tcontrol: Option defining at which point of the column the temperature

program is calculated. The options are inlet (x=0) and outlet (x=L).

  • L: Length of the capillary measured in m (meter).

The length of the arrays time_steps, temp_steps, pin_steps, pout_steps and a_gf have to be the same.

The arguments Tcontrol and L are used to construct the thermal gradient function gf(x) and the temperature interpolation T_itp(x,t).

Examples

julia> Program([0.0, 60.0, 300.0, 120.0],
        [40.0, 40.0, 320.0, 320.0],
        300000.0.*ones(4),
        zeros(4),
        [[20.0, 20.0, 20.0, 20.0] zeros(4) 10.0.*ones(4) [0.0, -2.0, -5.0, -5.0]],
        "inlet",
        10.0)
source
GasChromatographySimulator.SubstanceType
Substance(name, CAS, Tchar, θchar, ΔCp, φ₀, ann, Cag, t₀, τ₀)

Structure to describe the properties of a solute, which migrates through the GC Column. These datas are in most cases read from a database with the function load_solute_database().

Arguments

  • name: Name of the solute.
  • CAS: CAS number of the solute.
  • Tchar: Characterisic temperature (in K). One of the three distribution-centric thermodynamic parameters describing the retention of this solute on the given stationary phase.
  • θchar: Characterisic parameters (in °C). One of the three distribution-centric thermodynamic parameters describing the retention of this solute on the given stationary phase.
  • ΔCp: Change of the isobaric heat capacity moving from the mobile to the stationary phase (in J mol⁻¹ K⁻¹). One of the three distribution-centric thermodynamic parameters describing the retention of this solute on the given stationary phase.
  • φ₀: Dimensionless film thickness (φ ≈ df/d) of the column for which the thermodynamic parameters (Tchar, θchar, ΔCp) were estimated.
  • ann: Annotations. In most cases the source of the data is noted here.
  • Cag: The diffusitivity constant of the solute a in the mobile phase g (in...). It is calculated by the function diffusitivity().
  • t₀: Initial time of the solute (in s) at the start of the simulation.
  • τ₀: Initial peak width of the solute (in s) at the start of the simulation.

See also: load_solute_database

source
GasChromatographySimulator.OptionsType
Options(alg, abstol, reltol, Tcontrol, odesys, ng, vis, control, k_th)

Structure describing some general options for the simulation.

Arguments

  • alg: The algorithm used for the ODE solver. The algorithms OwrenZen3(), OwrenZen4() and OwrenZen5() are recommended.
  • abstol: The absolute tolerance for the ODE solver. Recommended value 1e-6 to 1e-8.
  • reltol: The relative tolerance for the ODE solver. Recommended value 1e-3 to 1e-5.
  • Tcontrol: Option defining at which point of the column the temperature program is calculated. The options are inlet (x=0) and outlet (x=L).
  • odesys: Combine the ODEs for migration and peak-width into a system of ODEs (odesys = true) or solve the two ODEs separately (odesys = false).
  • ng: Option to calculate the simulation without a gradient (ng = true) or with a gradient (ng = false).
  • vis: Used model of viscosity. HP is a second-order polynomial taken from the HP flow calculator. Blumberg is an emperical formula according to the book Temperature-programmed Gas Chromatography by Leonid M. Blumberg (2010, Wiley-VCH).
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program.
  • k_th: Threshold for the maximum of the retention factor. If the calculated retention factor is bigger than k_th than the retention factor is set to the value k_th. This is done to avoid to small step widths in the solver for highly retained soultes at the beginning of a GC program.

TODO: add option for the retention model ('ABC', 'K-centric')

For more informations about the arguments alg, abstol and reltol see the documentation of the DifferentialEquations.jl package.

source
GasChromatographySimulator.ParametersType
Parameters(col, prog, sub, opt)

Structure describing all parameters for the simulation of a GC system.

Arguments

  • col: Structure Column describing the parameters of the GC column and mobile phase gas.
  • prog: Structure Program describing the temperature and pressure program of a GC Column.
  • sub: An array of the structure Substance describing the parameters of the solutes which are separated in the GC simulation.
  • opt: Structure Options describing additional option parameters.
source

Physical Model

GasChromatographySimulator.pressureFunction
pressure(x, t, T_itp, Fpin_itp, pout_itp, L, d, gas; ng=false, vis="Blumberg", control="Pressure")

Calculate the pressure at position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m. Can be a function of position x.
  • gas: Name of the mobile phase gas.
  • ng: Option to calculate the simulation without a gradient (ng = true, eq. 2) or with a gradient (ng = false, eq. 1).
  • vis: used model for viscosity "Blumberg" or "HP"
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$p(x,t) = \sqrt(p_{in}(t)^2-\frac{κ(x,t)}{κ_L(t)}\left(p_{in}^2-p_{out}^2\right))$ Eq. 1

$p(x,t) = \sqrt(p_{in}(t)^2-\frac{x}{L}\left(p_{in}^2-p_{out}^2\right))$ Eq. 2

with $κ(x,t)$ the flow restriction up to position x at time t and $κ_L(t) = κ(x=L,t)$ the flow restriction of the whole column at time t.

See also: flow_restriction

source
GasChromatographySimulator.flow_restrictionFunction
flow_restriction(x, t, T_itp, d, gas; ng=false, vis="Blumberg")

Calculate the flow restriction $κ$ up to position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • d: Diameter of the GC column, in m. Can be a function of position x.
  • gas: Name of the mobile phase gas.
  • ng: Option to calculate the simulation without a gradient (ng = true, eq. 2) or with a gradient (ng = false, eq. 1).
  • vis: used model for viscosity "Blumberg" or "HP"

$κ(x,t) = \int_0^x \frac{η(y,t) T(y,t)}{d(y)^4}dy$ Eq. 1

$κ(x,t) = \frac{η(t) T(t) x}{d^4}$ Eq. 2

with $η(x,t)$ the viscosity of the mobile phase gas.

See also: viscosity

source
GasChromatographySimulator.viscosityFunction
viscosity(x, t, T_itp, gas; vis="Blumberg")

Calculate the (dynamic) viscosity of the mobile phase gas at position x at time t in Pa s.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • gas: Name of the mobile phase gas.
  • vis: used model

vis = "HP"

Simple model used in the HP Flow calculator

`η(x,t) = C_1 * \left(T(x,t) + T_{st}\right) + C_2

vis = "Blumberg"

$η(x,t) = η_{st}\left(\frac{T(x,t)}{T_{st}}\right)^{(ξ_0 + ξ_1 \frac{T(x,t)-T_{st}}{T_{st}})}$

with $η_{st}$, $ξ_0$ and $ξ_1$ parameters dependent on the mobile phase gas [1].

[1] Blumberg, Leonid M., Temperature-Programmed Gas Chromatography, Wiley-VCH, 2010.

source
viscosity(T, gas; vis="Blumberg")

Calculate the (dynamic) viscosity of the mobile phase gas at temperature T in Pa s.

Arguments

  • T: Temperature in K.
  • gas: Name of the mobile phase gas.
  • vis: used model for viscosity "Blumberg" or "HP".

vis = "HP"

Simple model used in the HP Flow calculator

`η(x,t) = C_1 * \left(T(x,t) + T_{st}\right) + C_2

vis = "Blumberg"`

$η(x,t) = η_{st}\left(\frac{T)}{T_{st}} ight)^{(ξ_0 + ξ_1 \frac{T-T_{st}}{T_{st}})}$

with $η_{st}$, $ξ_0$ and $ξ_1$ parameters dependent on the mobile phase gas [1].

[1] Blumberg, Leonid M., Temperature-Programmed Gas Chromatography, Wiley-VCH, 2010.

source
GasChromatographySimulator.holdup_timeFunction
holdup_time(T, Fpin, pout, L, d, gas; vis="Blumberg", control="Pressure")

Calculate the hold-up time in s without a gradient.

Arguments

  • T: Temperature in K.
  • Fpin: Flow in m³/s resp. inlet pressure in Pa(a).
  • pout: Outlet pressure in Pa(g).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$t_M = \frac{128}{3}\frac{L^2}{d^2}η\frac{p_{in}^3-p_{out}^3}{(p_{in}^2-p_{out}^2)^2}$

source
holdup_time(t, T_itp, pin_itp, pout_itp, L, d, gas; ng=false, vis="Blumberg", control="Pressure")

Calculate the hold-up time in s at time t with a gradient.

Arguments

  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • pin_itp: Interpolated (linear) inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • ng: Option to calculate the simulation without a gradient (ng = true, eq. 2) or with a gradient (ng = false, eq. 1).
  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$t_M(t) = 64\frac{κ_L(t)}{p_{in}(t)^2-p_{out}(t)^2} \int_0^L d(y)^2\frac{p(y,t)}{T(y,t)}dy$ Eq. 1

$t_M(t) = \frac{128}{3}\frac{L^2}{d^2}η(t)\frac{p_{in}(t)^3-p_{out}(t)^3}{(p_{in}(t)^2-p_{out}(t)^2)^2}$ Eq. 2

source
GasChromatographySimulator.flowFunction
flow(T, Fpin, pout, L, d, gas; vis="Blumberg", control="Pressure")

Calculate the normalized flow through the GC column in m³/s without a gradient.

Arguments

  • T: Temperature in K.
  • Fpin: Flow in m³/s resp. inlet pressure in Pa(a).
  • pout: Outlet pressure in Pa(g).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$F = \frac{π}{256}\frac{T_n}{p_n}\frac{d^4}{L}\frac{p_{in}^2-p_{out}^2}{η T}$

with $T_n$ the normalized temperature ($T_n=(25 + 273.15)$K), $p_n$ the normalized pressure ($p_n = 101300$ Pa(a)) and $η$ the viscosity the mobile phase gas at temperature $T$.

source
flow(t, T_itp, Fpin_itp, pout_itp, L, d, gas; ng=false, vis="Blumberg", control="Pressure")

Calculate the normalized flow through the GC column in m³/s at time t.

Arguments

  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • ng: Option to calculate the simulation without a gradient (ng = true, eq. 2) or with a gradient (ng = false, eq. 1).
  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$F(t) = \frac{π}{256}\frac{T_n}{p_n}\frac{p_{in}(t)^2-p_{out}(t)^2}{κ_L(t)}$ Eq. 1

$F(t) = \frac{π}{256}\frac{T_n}{p_n}\frac{d^4}{L}\frac{p_{in}(t)^2-p_{out}(t)^2}{η(t) T(t)}$ Eq. 2

with $T_n$ the normalized temperature ($T_n=(25 + 273.15)$K), $p_n$ the normalized pressure ($p_n = 101300$ Pa(a)), $κ_L$ the flow restriction of the column and $η$ the viscosity the mobile phase gas at temperature $T$.

source
GasChromatographySimulator.mobile_phase_residencyFunction
mobile_phase_residency(x, t, T_itp, Fpin_itp, pout_itp, L, d, gas; ng=false, vis="Blumberg", control="Pressure")

Calculate the residency (the inverse velocity) of the mobile phase at position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • ng: Option to calculate the simulation without a gradient (ng = true)

or with a gradient (ng = false).

  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$r_M(x,t) = 64 \frac{d^2 κ_L}{T(x,t)}\frac{p(x,t)}{p_{in}^2-p_{out}^2}$

with $T_n$ the normalized temperature ($T_n=(25 + 273.15)$K), $p_n$ the normalized pressure ($p_n = 101300$ Pa(a)), $κ_L$ the flow restriction of the column and $p(x,t)$ the local pressure.

See also: pressure, flow_restriction

source
GasChromatographySimulator.residencyFunction
residency(x, t, T_itp, Fpin_itp, pout_itp, L, d, df, gas, Tchar, θchar, ΔCp,  φ₀; ng=false, vis="Blumberg", control="Pressure")

Calculate the residency (the inverse velocity) of the solute at position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • df: Film thickness of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • Tchar: Characteristic temperature of the solute, in K.
  • θchar: Characteristic parameters of the solute, in °C.
  • ΔCp: Change of the isobaric heat capacity of the solute moving from the mobile to the

stationary phase, in J mol⁻¹ K⁻¹.

  • φ₀: Dimensionless film thickness (φ ≈ df/d) of the column for which the

thermodynamic parameters (Tchar, θchar, ΔCp) were estimated.

  • ng: Option to calculate the simulation without a gradient (ng = true)

or with a gradient (ng = false).

  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$r(x,t) = r_M(x,t) \left(1+k(x,t)\right)$

with $r_M$ the residency of the mobile phase and $k(x,t)$ the retention factor of the solute on the stationary phase.

See also: mobile_phase_residency, retention_factor

source
GasChromatographySimulator.retention_factorFunction
retention_factor(x, t, T_itp, d, df, Tchar, θchar, ΔCp, φ₀)

Calculate the retention factor of the solute in the stationary phase at position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • d: Diameter of the GC column, in m.
  • df: Film thickness of the GC column, in m.
  • Tchar: Characteristic temperature of the solute, in K.
  • θchar: Characteristic parameters of the solute, in °C.
  • ΔCp: Change of the isobaric heat capacity of the solute moving from the mobile to the

stationary phase, in J mol⁻¹ K⁻¹.

  • φ₀: Dimensionless film thickness (φ ≈ df/d) of the column for which the

thermodynamic parameters (Tchar, θchar, ΔCp) were estimated.

$k(x,t) = \frac{φ}{φ₀} \exp{\left((\frac{ΔC_p}{R}+\frac{T_{char}}{θ_{char}})(\frac{T_{char}}{T}+-1) \frac{ΔC_p}{R}\ln{(\frac{T}{T_{char}})}\right)}$

with $R$ the molar gas constant and $φ$ the dimensionless film thickness of the simulated GC Column ($φ = d_f/d$).

TODO: add option for the retention model ('ABC', 'K-centric')

source
GasChromatographySimulator.plate_heightFunction
plate_height(x, t, T_itp, Fpin_itp, pout_itp, L, d, df, gas, Tchar, θchar, ΔCp, φ₀, Cag; ng=false, vis="Blumberg", control="Pressure", k_th=1e12)

Calculate the plate height of the solute at position x at time t according to the Golay equation.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • df: Film thickness of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • Tchar: Characteristic temperature of the solute, in K.
  • θchar: Characteristic parameters of the solute, in °C.
  • ΔCp: Change of the isobaric heat capacity of the solute moving from the mobile to the

stationary phase, in J mol⁻¹ K⁻¹.

  • φ₀: Dimensionless film thickness (φ ≈ df/d) of the column for which the

thermodynamic parameters (Tchar, θchar, ΔCp) were estimated.

  • Cag: diffusivity constant of solute a in gas g.
  • ng: Option to calculate the simulation without a gradient (ng = true)

or with a gradient (ng = false).

  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$H(x,t) = 2 \frac{D_M}{u_M} + \frac{d^2}{96}\left(6 μ^2-16 μ +11 \right) \frac{u_M}{D_M} + \frac{2}{3} d_f^2 μ(1-μ) \frac{u_M}{D_S}$

with $D_M$ the diffusion coefficient of the solute in the mobile phase, $D_S$ the diffusion coefficient of the solute in the stationary phase, $u_M$ the velocity of the mobile phase and μ the mobility of the solute.

$D_S$ is correlated to $D_M$ by:

$D_S = \frac{D_M}{10000}$

TODO: alternative correlations?

$u_M$ is realated to the residency of the mobile phase $r_M$:

$u_M = \frac{1}{r_M}$

μ is correlated to the retention factor $k$:

$μ = \frac{1}{1 + k}$

See also: diffusion_mobile, mobile_phase_residency, retention_factor

source
GasChromatographySimulator.diffusion_mobileFunction
diffusion_mobile(x, t, T_itp, Fpin_itp, pout_itp, L, d, gas, Cag; ng=false, vis="Blumberg", control="Pressure")

Calculate the diffusion coefficient of the solute in the mobile phase at position x at time t.

Arguments

  • x: Position along the GC column, in m.
  • t: Time in s.
  • T_itp: Interpolated (linear) temperature T(x,t).
  • Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressure pin(t).
  • pout_itp: Interpolated (linear) outlet pressure pout(t).
  • L: Length of the capillary measured in m (meter).
  • d: Diameter of the GC column, in m.
  • gas: Name of the mobile phase gas.
  • Cag: diffusivity constant of solute a in gas g.
  • ng: Option to calculate the simulation without a gradient (ng = true)

or with a gradient (ng = false).

  • vis: used model for viscosity "Blumberg" or "HP".
  • control: Control of the "Flow" or of the "Pressure" (at column inlet) during the program

$D_M(x,t) = C_{ag} \frac{T(x,t)^{1.75}}{p(x,t)}$

source

Solving

GasChromatographySimulator.simulateFunction
simulate(par::Parameters; kwargs...)

Simulate the GC system defined by the structure par.

Alternative call: simulate(L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, t₀, τ₀, opt; kwargs...)

Note: Based on the option for odesys the result is different. For odesys = true the result is a dataframe (the peaklist) and the solution of the ODEs as a system (solution structure from DifferentialEquations.jl). If odesys = false the result is a dataframe (the peaklist) and the two solutions of the ODEs for time $t(z)$ and peak variance $τ²(z)$. kwargs... to pass additional options to the ODE solve function as named tuples.

source
GasChromatographySimulator.solve_system_multithreadsFunction
solve_system_multithreads(par::Parameters, kwargs...)

Simulate the GC system defined by the structure par by solving the ODEs for $t(z)$ and $τ²(z)$ together as a system of ODEs using multiple threads (parallel computing) for the simulation of different solutes. kwargs... to pass additional options to the ODE solve function as named tuples.

Note: The result is an array of the solution structure from DifferentialEquations.jl.

Alternative call: solve_system_multithreads(L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, t₀, τ₀, opt; kwargs...) with the substance realted quantitites beeing vectors.

Examples

julia> sol = solve_system_multithreads(par)
source
Missing docstring.

Missing docstring for GasChromatographySimulator.solve_multithreads. Check Documenter's build log for details.

GasChromatographySimulator.solving_migrationFunction
solving_migration(col::Column, prog::Program, sub::Substance, opt::Options; kwargs...)

Solve for the migration $t(z)$ of solute sub in the GC Column col with the program prog and the options opt. kwargs... to pass additional options to the ODE solve function as named tuples.

Alternative call: solving_migration(L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, t₀, opt; kwargs...)

Note: The result is the solution structure from DifferentialEquations.jl.

source
GasChromatographySimulator.solving_peakvarianceFunction
solving_peakvariance(solution_tz, col::Column, prog::Program, sub::Substance, opt::Options; kwargs...)

Solve for the development of the peak variance $τ²(z)$ of solute sub in the GC Column col with the program prog and the options opt during its migration defined by solution_tz. kwargs... to pass additional options to the ODE solve function as named tuples.

Alternative call: solving_peakvariance(solution_tz, L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, τ₀, opt; kwargs...)

Note: The result is the solution structure from DifferentialEquations.jl.

source
GasChromatographySimulator.solving_odesystem_rFunction
solving_odesystem_r(col::Column, prog::Program, sub::Substance, opt::Options; kwargs...)

Solve the migration $t(z)$ and peak variance development $τ²(z)$ of solute sub in the GC Column col with the program prog and the options opt as a system of ODEs. kwargs... to pass additional options to the ODE solve function as named tuples.

Note: The result is the solution structure from DifferentialEquations.jl.

See also: odesystem_r!

source

Results

GasChromatographySimulator.peaklistMethod
peaklist(sol, par)

Construct a DataFrame with the peak list of the solution sol of the simulation of the GC system defined by par.

Output

The peaklist DataFrame consists of the entrys:

  • No: Number of the solute in the database.
  • Name: Name of the solute.
  • tR: Retention time of the solute (in s).
  • τR: Peak width of the solute (in s).
  • TR: Temperature of the end of the column at the retention time (in °C).
  • σR: Band width of the solute at retention time (in m).
  • uR: Solute velocity at retention time (in m/s).
  • kR: Retention factor of the solute at retention time.
  • Res: Resolution (4τ) between neighboring peaks.
  • Δs: separation metric between neighboring peaks, assuming linear development of peak width τR between the peaks.
  • Annotations: additional anotations, e.g. Source, categories, if available

Examples

julia> pl = peaklist(sol, par)
...
source
GasChromatographySimulator.peaklistMethod
peaklist(sol, peak, par)

Construct a DataFrame with the peak list of the solution sol and peak of the simulation of the GC system defined by par.

Output

The peaklist DataFrame consists of the entrys:

  • No: Number of the solute in the database.
  • Name: Name of the solute.
  • tR: Retention time of the solute (in s).
  • τR: Peak width of the solute (in s).
  • TR: Temperature of the end of the column at the retention time (in °C).
  • σR: Band width of the solute at retention time (in m).
  • uR: Solute velocity at retention time (in m/s).
  • kR: Retention factor of the solute at retention time.
  • Res: Resolution (4τ) between neighboring peaks.
  • Δs: separation metric between neighboring peaks, assuming linear development of peak width τR between the peaks.
  • Annotations: additional anotations, e.g. Source, categories, if available

Examples

julia> pl = peaklist(sol, peak, par)
...
source
GasChromatographySimulator.sol_extractionMethod
sol_extraction(sol, par)

Extract the points z=t, t=u1, τ²=u2 from the solution sol of the ODE system of the GC system defined by par and exports them in a DataFrame.

Examples

df_sol = sol_extraction(sol, par)
...
source
GasChromatographySimulator.sol_extractionMethod
sol_extraction(sol, peak, par)

Extract the points zt=sol.t, t=sol.u, zτ²=peak.t and τ²=peak.u from the solution sol and peak of the ODEs of the GC system defined by par and exports them in a DataFrame.

Examples

df_sol = sol_extraction(sol, peak, par)
...
source

Plot functions

GasChromatographySimulator.plot_chromatogramFunction
plot_chromatogram(peaklist, tlims; annotation=true, number=true, mirror=false, offset=0.0, uncertainty=false, color=:blue)

Plot the chromatogram of the peaks listed in peaklist over the time tupel tlims = (t_start, t_end). If peaklist contains values with uncertainties, than only the values of retention time and peak widths without uncertainties are used.

Arguments

  • peaklist: DataFrame with the names, retention times and peak widths of the simulated substances.
  • tlims: Tuple defining the start and end time of the plotted chromatogram.
  • annotation: Boolean, switching the annotation of the peaks on/off; default = true.
  • number: Boolean, switching the type of the annotation between number of the substance in the peaklist (number = true) or name of the substance (number = false); default = true.
  • mirror: Boolean, if mirror = true the chromatogram is multiplied by -1; default = false.
  • offset: Float64, this value is added to the chromatogram; default = 0.0.
  • uncertainty: Boolean, if uncertainty = true the uncertainty in retention time will be plotted as rectangle with ± uncertainty of retention time and uncertainty of peak width wil be plotted as two additional chromatograms with peak width as peak width - uncertainty and peak width + uncertainty. Default is false.
  • color: Symbol of the color for the chromatogram, default is :blue.

Output

Tupel (p_chrom, t, chrom)

  • p_chrom: the plot of the chromatogram chrom over time t
  • t: Array of time of the chromatogram
  • chrom: Array of the abundance values of the chromatogram
source
GasChromatographySimulator.plot_chromatogram!Function
plot_chromatogram!(p_chrom, peaklist, tlims; annotation=true, number=true, mirror=true, offset=0.0, uncertainty=false, color=:darkgreen)

Add the chromatogram of the peaks listed in peaklist over the time tupel tlims = (t_start, t_end) to the plot p_chrom. If peaklist contains values with uncertainties, than only the values of retention time and peak widths without uncertainties are used.

Arguments

  • p_chrom: Plot of an existing chromatogram.
  • peaklist: DataFrame with the names, retention times and peak widths of the simulated substances.
  • tlims: Tuple defining the start and end time of the plotted chromatogram.
  • annotation: Boolean, switching the annotation of the peaks on/off; default = true.
  • number: Boolean, switching the type of the annotation between number of the substance in the peaklist (number = true) or name of the substance (number = false); default = true.
  • mirror: Boolean, if mirror = true the chromatogram is multiplied by -1; default = false.
  • offset: Float64, this value is added to the chromatogram; default = 0.0.
  • uncertainty: Boolean, if uncertainty = true the uncertainty in retention time will be plotted as rectangle with ± uncertainty of retention time and uncertainty of peak width wil be plotted as two additional chromatograms with peak width as peak width - uncertainty and peak width + uncertainty. Default is false.
  • color: Symbol of the color for the chromatogram, default is :darkgreen.

Output

Tupel (t, chrom)

  • t: Array of time of the chromatogram
  • chrom: Array of the abundance values of the chromatogram
source
GasChromatographySimulator.plot_flowFunction
plot_flow(par)

Calculate and plot the flow (in mL/min, normalized) of the carrier gas in a GC Column with a program defined in the parameters par::GasChromatography.Parameters.

source
GasChromatographySimulator.plot_temperatureFunction
plot_temperature(par; selector="T(t)")

Plot the temperature program of the GC Column.

Arguments

  • par::GasChromatographySimulator.Parameters: parameters of the GC system
  • selector::String: selection of the plot as:
* `selector = "T(t)"`: 2D-plot of temperature `T` over time `t` at inlet (`x=0`) and outlet (`x=L`)
* `selector = "T(x)"`: 2D-plot of temperature `T` over column position `x` at the `time_steps` of the program
* `selector = "T(x,t)"`: 3D-plot of temperature `T` over column position `x` and `t`
source
GasChromatographySimulator.local_plotsFunction
local_plots(xx, yy, sol, par; uncertainty=true)

Show additional 'local' plots of selected yy quantities over selected xx quantities. If the solutions sol contain values with uncertainties, the uncertainty of yy will be plotted as a ribbon, while uncertainties in xx are ignored (if uncertainty=true, else all uncertainties are ignored).

Arguments

  • xx: Selected quantity shown on the x-axis. Possible values: "z", "t", "T", "τ", "σ" and "u".
  • yy: Selected quantity shown on the y-axis. Possible values: "z", "t", "T", "τ", "σ" and "u".
  • sol: The solution of the simulation.
  • par: The parameters of the simulated GC-system.
source

UI functions for notebooks

GasChromatographySimulator.UI_ColumnFunction
UI_Column(sp)

Construct a combined PlutoUI widget for the settings of the GC Column with the selectable stationary phases sp.

UI fields

  • $L$: column length in m.
  • $d$: column diameter in mm.
  • $d_f$: film thickness in µm.
  • stat. phase: stationary phase of the column
  • Gas: mobile phase
source
GasChromatographySimulator.UI_ProgramFunction
UI_Program(; default=("0 60 300 300 120", "40 40 170 300 300", "0 0 40 60 0", "-3 -3 -3 -3 -3", "18 18 58 98 98", "0 0 0 0 0"))

Construct a combined PlutoUI widget for the settings of the program of a GC column with or without a thermal gradient (depending on the default tuple).

With thermal gradient

For default as a tuple of six strings the folwing fields will be shown in the widget:

  • example default tupel: default=("0 60 300 300 120", "40 40 170 300 300", "0 0 40 60 0", "-3 -3 -3 -3 -3", "18 18 58 98 98", "0 0 0 0 0")

*time steps: the time steps after which duration the values of temperature, inlet pressure, ΔT and α are achieved by linear interpolation (in s). *temperature steps: the temperature steps (in °C). *ΔT steps: the steps of the temperature difference (in °C) between column inlet and outlet. *α steps: the steps of the gradient profile (α = 0 ... linear change of temperature along column, α < 0 ... concave exponential profile, α > 0 ... convexe exponential profile). *$p_{in}$ steps: the steps of the inlet pressure (in kPa(g)) *$p_{out}$ steps: the steps of the outlet pressure (in kPa(a))

Without thermal gradient

For a default as a tuple of four strings the folwing fields will be shown in the widget:

  • example default tupel: default=("0 60 600 120", "40 40 300 300", "18 18 98 98", "vacuum")

*time steps: the time steps after which duration the values of temperature, inlet pressure, ΔT and α are achieved by linear interpolation (in s). *temperature steps: the temperature steps (in °C). $p_{in}$ steps: the steps of the inlet pressure (in kPa(g)) column outlet selection of the outlet of the colum, "vacuum" ($p_{out} = 0.0$ kPa(a)) or "atmosphere" ($p_{out} = 101.3$ kPa(a)).

source
GasChromatographySimulator.UI_SubstanceFunction
UI_Substance(sol; default=(1:4, ))

Construct a combined PlutoUI widget for the settings of the substances separated in the simulated GC system with the selectable substances subs.

Depending on the tupel of default the widget is setup.

For default = (1:4, 0.0, 0.0) the UI fields are:

  • Select Substances: Selection of the substances, which will be simulated, default selection = 1st to 4th substance.
  • Injection time: Start time (in s) of the simulation. The same for all selected substances. Default is 0.0 s.
  • Injection width: Peak width (in s) of all selected substances at the time of injection. Default is 0.0 s.

For default = (1:4,) the UI fields are:

  • Select Substances: Selection of the substances, which will be simulated, default selection = 1st to 4th substance.
source

Helper functions

GasChromatographySimulator.temperature_interpolationFunction
temperature_interpolation(time_steps, temp_steps, gradient_function, L)

Construct the temperature function depending on position x and time t.

Arguments

  • time_steps::Array{<:Real,1}: Time steps in s (seconds).
  • temp_steps::Array{<:Real,1}: Temperature steps in °C (degree celsius).
  • gf::Function: Gradient function gf(x, a_gf), describes the thermal gradient.
  • L: Length of the capillary measured in m (meter).

For the spatial dependency of the interpolated temperature T_ipt(x,t) the gradient function gf is calculated every 1e-3 m (1 mm). Positions inbetween are linear interpolated. For the temporal dependency the temperatures temp_steps defined at the time_steps are linear interpolated over time t.

Examples

julia> T_itp = temperature_interpolation([0.0, 60.0, 300.0, 120.0], [40.0, 40.0, 320.0, 320.0], gf, 10.0)
source
GasChromatographySimulator.steps_interpolationFunction
steps_interpolation(time_steps, steps)

Construct a linear interpolated function depending on time t of the steps-values over time_steps.

Arguments

  • time_steps::Array{<:Real,1}: Time steps in s (seconds).
  • steps::Array{<:Real,1}: steps, e.g. pressure or flow.

Examples

julia> pin_itp = steps_interpolation([0.0, 60.0, 300.0, 120.0], 
                                    [300000.0, 300000.0, 400000.0, 400000.0])
source
GasChromatographySimulator.load_solute_databaseFunction
load_solute_database(db_path, db, sp, gas, solutes, t₀, τ₀)

Load the data of solutes for the stationary phase sp and the mobile phase gas from the database file db (located in db_path) into an array of the structure Substance. The row number of the selected solutes in the loaded database are added to the annotations of the Substance structure.

Arguments

  • db_path::String: Path to the database file.
  • db::String: Name of the database file.
  • sp::String: Name of the stationary phase.
  • gas::String: Name of the mobile phase.
  • solutes::Array{<:AbstractString,1}: Name of the solutes.
  • t₀::Array{<:Real,1}: Initial start times of the solutes.
  • τ₀::Array{<:Real,1}: Initial peak widths of the solutes.

Examples

julia> sub = load_solute_database("path/to/the/file", "db.csv", "DB5", "He", ["C10", "C11"], [0.0, 0.0], [0.5, 0.5])
source
load_solute_database(db_, sp_, gas_, solutes_, t₀_, τ₀_)

New function to load the data for the substances solutes_ from the database db_ for the stationary phase sp_ and mobile phase gas_ with initial time t₀_ and initial peak width τ₀_. The parameters solutes_, t₀_ and τ₀_ must be vectors of the same length. Acceptable values for solutes_ are either the substance names, CAS numbers or the number No from the database.

The loaded data is returned as a vector of the GasChromatographySimulator.Substance structure.

source
GasChromatographySimulator.all_solutesFunction
all_solutes(sp, db; id=false, separator=" - ")

Extract the name of all solutes for which data in a database db and the stationay phase sp is available.

Arguments

  • sp: Name of the stationary phase.
  • db: DataFrame of the database.
  • id: if true than the number of the solutes in the database are combined with the solute name. Default = false.
  • separator: string used to separate the solute number from the solute name. Default = " - ".

Examples

julia> all = all_solutes("DB5", db)
source
GasChromatographySimulator.diffusivityFunction
diffusivity(M, Cn, Hn, On, Nn, Rn, gas)

Calculate the diffusivity constant Cag of solute a in gas g using the emperical Fuller-Schettler-Giddings model [1].

[1] Fuller, Edward N.; Ensley, Keith; Giddings, J. Calvin, Diffusion of Halogenated Hydrocarbons in Helium. The Effect of Structure on Collision Cross Sections, The Journal of Physical Chemistry, Volume 73, Issue 11, 1969, 3679–3685

Arguments

  • M: Molar mass of the solute.
  • Cn: Number of carbon atoms of the solute.
  • Hn: Number of hydrogen atoms of the solute.
  • On: Number of oxygen atoms of the solute.
  • Nn: Number of nitrogen atoms of the solute.
  • Rn: Number of closed rings of the structure of the solute.
  • gas: The name of the mobile phase. Allowed values: He, H2 or N2.
source
diffusivity(id, gas)

Calculate the diffusivity constant Cag of solute id in gas gas using the emperical Fuller-Schettler-Giddings model [1], using the identifier of the solute id.

[1] Fuller, Edward N.; Ensley, Keith; Giddings, J. Calvin, Diffusion of Halogenated Hydrocarbons in Helium. The Effect of Structure on Collision Cross Sections, The Journal of Physical Chemistry, Volume 73, Issue 11, 1969, 3679–3685

Arguments

  • id: Named tupel identifying the solute. (Name, CAS, formula, MW, smiles)
  • gas: The name of the mobile phase. Allowed values: He, H2 or N2.
source
GasChromatographySimulator.compare_measurement_simulationFunction
compare_measurement_simulation(meas, peaklist)

Compare the retention times of measured and simulated substances.

Arguments

  • meas: DataFrame consisting at least of the columns :Name and :RT (measured retention time in s)
  • peaklist: DataFrame as result from GasChromatographySimulator.jl with the columns :Name and :tR (simulated retention time in s).

The comparison is done by searching the same Name of the substance in both DataFrames and calculating the absolute difference of the retention times (in s) and the relative difference (in %).

source
GasChromatographySimulator.conventional_programMethod
conventional_program(CP; time_unit="min")

Translate the conventional program notation into a vector of time steps and value steps (temperature, pressure, flow) used in GasChromatographySimulator.Program

The conventional temperature program is defined as an array of the following form (for a temperature program): CP = [T₁, t₁, r₁, T₂, t₂, r₂, T₃, t₃, ...] corresponding to the notation: T₁(t₁) - r₁ - T₂(t₂) - r₂ - T₃(t₃) - ... which can be read as: Starting temperature T₁ is holded for time t₁. After the holding time the temperature increases linearly with the heating rate r₁, until temperature T₂ is reached. This temperature is held for the time t₂ after which the temperature increases linearly by the heating rate r₂ until temperature T₃ is reached, which is hold for the time t₃, and so on.

The option time_unit determines the unit of time in the program CP. For time_unit = "min" (default) the times are measured in minutes and the heating rates in °C/min. For time_unit = "s" the times are measured in seconds and the heating rate in °C/s.

source
GasChromatographySimulator.temperature_programMethod
temperature_program(time_steps, value_steps; time_unit="min")

Translate the vector of time steps and value steps (temperature, pressure, flow) into a conventional program notation.

The conventional temperature program is defined as an array of the following form (for a temperature program): CP = [T₁, t₁, r₁, T₂, t₂, r₂, T₃, t₃, ...] corresponding to the notation: T₁(t₁) - r₁ - T₂(t₂) - r₂ - T₃(t₃) - ... which can be read as: Starting temperature T₁ is holded for time t₁. After the holding time the temperature increases linearly with the heating rate r₁, until temperature T₂ is reached. This temperature is held for the time t₂ after which the temperature increases linearly by the heating rate r₂ until temperature T₃ is reached, which is hold for the time t₃, and so on.

The option time_unit determines the unit of time in the program CP. For time_unit = "min" (default) the times are measured in minutes and the heating rates in °C/min. For time_unit = "s" the times are measured in seconds and the heating rate in °C/s.

source
GasChromatographySimulator.new_value_stepsFunction
new_value_steps(value_steps, time_steps, new_time_steps)

Estimate the new value steps at the new_time_steps from the original set of value_steps over time_steps. The new values at new time steps are calculated from a linear change of the value between the original time steps.

source