Functions
Structures and Constructors
GasChromatographySimulator.Column — Type
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 functiond(x, a_d)ofx, 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 functiond_f(x, a_df)ofx, 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.
GasChromatographySimulator.Column — Method
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")
GasChromatographySimulator.Program — Type
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 functiongf(x, a_gf), describes the thermal gradient.a_gf: Parameters of the gradient function.T_itp: Interpolated (linear) temperatureT(x,t), constructed fromtime_steps,temp_stepsandgf.Fpin_itp: Interpolated (linear) flow/inlet pressureFpin(t), constructed fromtime_stepsandFpin_steps.pout_itp: Interpolated (linear) outlet pressurepout(t), constructed fromtime_stepsandpout_steps.
Note: The length of the arrays time_steps, temp_steps, pin_steps and a_gf have to be the same.
GasChromatographySimulator.Program — Method
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)GasChromatographySimulator.Program — Method
Program(time_steps, temp_steps, Fpin_steps, pout_steps)Construct the structure Program with direct step arrays for the case without a thermal gradient and without explicitly specifying a column length.
This is intended for conventional GC use-cases where T(x,t) is spatially uniform (ng=true workflows), so only time dependence is relevant.
Examples
julia> Program(
[0.0, 60.0, 360.0, 600.0],
[40.0, 40.0, 250.0, 250.0],
[150000.0, 150000.0, 150000.0, 150000.0],
[101325.0, 101325.0, 101325.0, 101325.0]
)GasChromatographySimulator.Program — Method
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)GasChromatographySimulator.Program — Method
Program(TP, FpinP, L; pout="vacuum", time_unit="min")Construct the structure Program with conventional formulation (see conventional_program) of programs for the case without a thermal gradient.
Arguments
TP: conventional formulation of a temperature program.FpinP: conventional formulation of a Flow (in m³/s) resp. inlet pressure (in Pa(a)) program.L: Length of the capillary measured in m (meter).pout: Outlet pressure, "vacuum" (default), "atmosphere" or the outlet pressure in Pa(a).time_unit: unit of time in the programs, "min"` (default) times are measured in minutes, "s" times are measured in seconds.
The argument L is used to construct the temperature interpolation T_itp(x,t).
Examples
julia> Program((40.0, 1.0, 5.0, 280.0, 2.0, 20.0, 320.0, 2.0),
(400000.0, 10.0, 5000.0, 500000.0, 20.0),
10.0)GasChromatographySimulator.Program — Method
Program(TP, FpinP, pout, time_unit)Construct the structure Program with conventional formulation (see conventional_program) of programs for the case without a thermal gradient, without explicitly specifying a column length.
This overload is intended for conventional GC use-cases where temperature is spatially uniform (ng=true workflows), so the specific length used for constructing T_itp(x,t) is not physically relevant.
Arguments
TP: conventional formulation of a temperature program.FpinP: conventional formulation of a Flow (in m³/s) resp. inlet pressure (in Pa(a)) program.pout: Outlet pressure,"vacuum","atmosphere"or the outlet pressure in Pa(a).time_unit: unit of time in the programs,"min"times are measured in minutes,"s"in seconds.
Examples
julia> Program(
[40.0, 1.0, 5.0, 280.0, 2.0, 20.0, 320.0, 2.0],
[400000.0, 10.0, 5000.0, 500000.0, 20.0];
pout="vacuum",
time_unit="min"
)GasChromatographySimulator.Substance — Type
Substance(name, CAS, Tchar, θchar, ΔCp, φ₀, ann, Cag, t₀, τ₀, x₀=0, σ₀=0)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 soluteain the mobile phaseg(in...). It is calculated by the functiondiffusitivity().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.x₀: Initial position of the solute along the column, in m. Used by the time-domain solver. Default0(thex = 0end).σ₀: Initial spatial band width of the solute, in m. Used by the time-domain solver. Default0. Independent ofτ₀.
See also: load_solute_database
GasChromatographySimulator.Options — Type
Options(alg, abstol, reltol, Tcontrol, odesys, ng, vis, control, k_th, domain)Structure describing some general options for the simulation.
Arguments
alg: The algorithm used for the ODE solver. Recommended:OwrenZen5()(default),Tsit5(),Vern9(),BS5()andDP5(). Legacy/alternative:OwrenZen3(),OwrenZen4().abstol: The absolute tolerance for the ODE solver. Recommended value 1e-6 to 1e-8 (use 1e-8 for high-accuracy solvers likeVern9()).reltol: The relative tolerance for the ODE solver. Recommended value 1e-3 to 1e-5 (use 1e-5 for high-accuracy solvers likeVern9()).Tcontrol: Option defining at which point of the column the temperature program is calculated. The options areinlet(x=0) andoutlet(x=L).odesys: Combine migration and band-width ODEs into one system (odesys = true) or solve them separately (odesys = false). Applies to both:spatial($t(z)$/$τ²(z)$) and:temporal($x(t)$/$σ²(t)$). Callers that need only the band center (e.g. retention fitting) can usesolving_migration/solving_migration_timedirectly and skip the width ODE.ng: Option to calculate the simulation without a gradient (ng = true) or with a gradient (ng = false).vis: Used model of viscosity.HPis a second-order polynomial taken from the HP flow calculator.Blumbergis an emperical formula according to the bookTemperature-programmed Gas Chromatographyby 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 thank_ththan the retention factor is set to the valuek_th. This is done to avoid to small step widths in the solver for highly retained soultes at the beginning of a GC program.domain: Independent variable of the migration ODEs.:spatial(default) integrates $t(z)$ / $τ²(z)$.:temporalintegrates $x(t)$ / $σ²(t)$ so the band may reverse when both end pressures are finite. Vacuum-like outlets (pout/pin < 0.1) stay on:spatial.
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.
GasChromatographySimulator.Parameters — Type
Parameters(col, prog, sub, opt)Structure describing all parameters for the simulation of a GC system.
Arguments
col: StructureColumndescribing the parameters of the GC column and mobile phase gas.prog: StructureProgramdescribing the temperature and pressure program of a GC Column.sub: An array of the structureSubstancedescribing the parameters of the solutes which are separated in the GC simulation.opt: StructureOptionsdescribing additional option parameters.
Physical Model
GasChromatographySimulator.pressure — Function
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) temperatureT(x,t).Fpin_itp: Interpolated (linear) flowF(t)resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. Can be a function of positionx.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, profile
GasChromatographySimulator.flow_restriction — Function
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) temperatureT(x,t).d: Diameter of the GC column, in m. A number, or a function of positionx.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.
GasChromatographySimulator.viscosity — Function
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) temperatureT(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.
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.
GasChromatographySimulator.holdup_time — Function
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}$
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) temperatureT(x,t).pin_itp: Interpolated (linear) inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.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
See also: profile
GasChromatographySimulator.flow — Function
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$.
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) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.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$.
See also: profile
GasChromatographySimulator.mobile_phase_residency — Function
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) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.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, profile
GasChromatographySimulator.residency — Function
residency(x, t, T_itp, Fpin_itp, pout_itp, L, d, df, gas, Tchar, θchar, ΔCp, φ₀; ng=false, vis="Blumberg", control="Pressure", k_th=1e12)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) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(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
GasChromatographySimulator.retention_factor — Function
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) temperatureT(x,t).d: Diameter of the GC column, in m. A number, or a function of positionx.df: Film thickness of the GC column, in m. A number, or a function of positionx.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$).
See also: profile
TODO: add option for the retention model ('ABC', 'K-centric')
GasChromatographySimulator.plate_height — Function
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. The plate height is the spatial dispersion rate of the solute.
Arguments
x: Position along the GC column, in m.t: Time in s.T_itp: Interpolated (linear) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.df: Film thickness of the GC column, in m. A number, or a function of positionx.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 soluteain gasg.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 absolute velocity of the mobile phase and μ the mobility of the solute. The absolute value keeps $H$ positive when the flow is reversed.
$D_S$ is correlated to $D_M$ by:
$D_S = \frac{D_M}{10000}$
TODO: alternative correlations?
$|u_M|$ is the absolute value of the inverse 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
GasChromatographySimulator.mobile_phase_velocity — Function
mobile_phase_velocity(x, t, T_itp, Fpin_itp, pout_itp, L, d, gas; ng=false, vis="Blumberg", control="Pressure")Calculate the velocity of the mobile phase at position x at time t. This is the signed inverse of mobile_phase_residency. It stays finite when pin = pout, where the residency is singular.
Arguments
x: Position along the GC column, in m.t: Time in s.T_itp: Interpolated (linear) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.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.
For control = "Pressure"
$u_M(x,t) = \frac{1}{64}\frac{T(x,t)}{κ_L d(x)^2}\frac{p_{in}(t)^2-p_{out}(t)^2}{p(x,t)}$
and for control = "Flow"
$u_M(x,t) = \frac{4}{\pi}\frac{p_n}{T_n}\frac{F(t)}{d(x)^2}\frac{T(x,t)}{p(x,t)}$
with $κ_L$ the flow restriction of the whole column. $u_M$ is negative when pin < pout. When pin² = pout², $u_M = 0$.
See also: mobile_phase_residency, pressure, flow_restriction, profile
GasChromatographySimulator.solute_velocity — Function
solute_velocity(x, t, T_itp, Fpin_itp, pout_itp, L, d, df, gas, Tchar, θchar, ΔCp, φ₀; ng=false, vis="Blumberg", control="Pressure")Calculate the 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) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.df: Film thickness of the GC column, in m. A number, or a function of positionx.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.
$u_s(x,t) = \frac{u_M(x,t)}{1+k(x,t)}$
The retention factor is not clamped by k_th. A cold, highly retained band has $u_s ≈ 0$, which is a regular state of the time-domain solver.
See also: mobile_phase_velocity, retention_factor
GasChromatographySimulator.temporal_dispersion_rate — Function
temporal_dispersion_rate(x, t, T_itp, Fpin_itp, pout_itp, L, d, df, gas, Tchar, θchar, ΔCp, φ₀, Cag; ng=false, vis="Blumberg", control="Pressure")Calculate the temporal dispersion rate of the solute at position x at time t. This is the Golay plate height times the solute speed, written so that it stays finite at $u_M = 0$. It is the source term of dσ²/dt in the time-domain solver.
Arguments
x: Position along the GC column, in m.t: Time in s.T_itp: Interpolated (linear) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(t).L: Length of the capillary measured in m (meter).d: Diameter of the GC column, in m. A number, or a function of positionx.df: Film thickness of the GC column, in m. A number, or a function of positionx.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 soluteain gasg.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.
``\mathcal{D} = 2 DM μ + \frac{d^2}{96}(6μ^3-16μ^2+11μ)\frac{uM^2}{D_M}
- \frac{2}{3} df^2 μ^2 (1-μ) \frac{uM^2}{D_S}``
with $μ = 1/(1+k)$ and $D_S = D_M/10000$. At $u_M = 0$ the mass-transfer terms vanish and $\mathcal{D} = 2 D_M/(1+k)$. k is not clamped by k_th.
See also: plate_height, mobile_phase_velocity, diffusion_mobile, profile
GasChromatographySimulator.diffusion_mobile — Function
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) temperatureT(x,t).Fpin_itp: Interpolated (linear) Flow F(t) resp. inlet pressurepin(t).pout_itp: Interpolated (linear) outlet pressurepout(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 soluteain gasg.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)}$
Solving
GasChromatographySimulator.simulate — Function
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,Name, CAS, ann, Tchar, θchar, ΔCp, φ₀, Cag, t₀, τ₀, opt; kwargs...)
domain selects the independent variable; odesys selects coupled vs separate ODEs in either domain:
| domain | odesys=true | odesys=false | |–|–|–| | :spatial (default) | $t(z), τ²(z)$ system → pl, sol | separate → pl, sol, peak | | :temporal | $x(t), σ²(t)$ system → pl, sol | separate → pl, sol, band |
Vacuum-like outlets (pout/pin < 0.1) stay on :spatial. kwargs... pass to the ODE solver.
GasChromatographySimulator.solve_system_multithreads — Function
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)GasChromatographySimulator.solve_separate_multithreads — Function
solve_separate_multithreads(par::Parameters, kwargs...)Simulate the GC system defined by the structure par by solving the ODEs for $t(z)$ and $τ²(z)$ separatly (solving $t(z)$ and using this result to solve for $τ²(z)$) 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 are two arrays of the solution structure from DifferentialEquations.jl.
Alternative call: solve_separate_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, peak = solve_separate_multithreads(par)GasChromatographySimulator.solving_migration — Function
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.
GasChromatographySimulator.solving_peakvariance — Function
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.
GasChromatographySimulator.solving_odesystem_r — Function
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!
GasChromatographySimulator.odesystem_r! — Function
odesystem_r!(dt, t, p, z)The ODE system for migration $t(z)$ and peak variance development $τ²(z)$.
$\frac{dt}{dz} = r(z, t(z))$
$\frac{dτ^2}{dz} = H(z, t(z)) r(z, t(z)) + 2 τ^2(z, t(z)) \frac{∂r}{∂t}(z,t(z))$
See also: solving_odesystem_r, peakode
GasChromatographySimulator.peakode — Function
peakode(z, t, τ², col, prog, sub, opt)The second ODE function for the ODE system describing the peak variance development $τ²(z)$, using automatic differentiation.
$\frac{dτ^2}{dz} = H(z, t(z)) r(z, t(z)) + 2 τ^2(z, t(z)) \frac{∂r}{∂t}(z,t(z))$
See also: solving_odesystem_r, odesystem_r!
Time-domain solving
GasChromatographySimulator.solving_migration_time — Function
solving_migration_time(L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, x₀, t₀, opt; t_end=T_itp.grid[2][end], kwargs...)Solve the migration $x(t)$ of one solute. The independent variable is laboratory time. The solve stops at an outward exit (x = L while $u_s > 0$, or x = 0 while $u_s < 0$) or at t_end if the band is still inside the column.
kwargs... are passed to the ODE solver. tstops are the program knots strictly between t₀ and t_end.
Alternative call: solving_migration_time(col::Column, prog::Program, sub::Substance, opt::Options; t_end=prog.T_itp.grid[2][end], kwargs...)
The initial position is x₀ (or sub.x₀). The initial time is t₀ (or sub.t₀). The default t_end is the last absolute program time. T_itp.grid[2] already stores those times.
A vacuum outlet (pout = 0) cannot reverse the flow. Use solving_migration for that program. At x = L the local pressure is zero, so $u_s → ∞$. This solver is for a finite pressure at both ends (forward elution, a pause, or pin < pout).
Note: The result is the solution structure from DifferentialEquations.jl. sol.t is time and sol.u is position.
See also: solute_velocity, time_domain_exit_callback, program_knots
GasChromatographySimulator.solving_bandvariance_time — Function
solving_bandvariance_time(solution_zt, L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, σ₀, opt; kwargs...)Solve the spatial band variance $σ²(t)$ along a migration solution_zt from solving_migration_time. The time span is the span of that solution, so the variance is not integrated after the band has left the column. There is no exit callback: position is already known.
kwargs... are passed to the ODE solver.
Alternative call: solving_bandvariance_time(solution_zt, col, prog, sub, opt; kwargs...)
The initial variance is σ₀^2 (or sub.σ₀^2).
Note: The result is the solution structure from DifferentialEquations.jl. sol.t is time and sol.u is $σ²$.
See also: bandode, solving_migration_time
GasChromatographySimulator.solving_odesystem_time — Function
solving_odesystem_time(L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, t₀, x₀, σ₀, opt; t_end=T_itp.grid[2][end], kwargs...)Solve the migration $x(t)$ and the spatial band variance $σ²(t)$ as one ODE system. The solve stops at an outward exit or at t_end if the band is still inside the column.
kwargs... are passed to the ODE solver.
Alternative call: solving_odesystem_time(col::Column, prog::Program, sub::Substance, opt::Options; t_end=prog.T_itp.grid[2][end], kwargs...)
Initial values are x₀ and σ₀ (or sub.x₀ and sub.σ₀) at time t₀ (or sub.t₀). The default t_end is the last absolute program time.
A vacuum outlet (pout = 0) cannot reverse the flow. Use solving_odesystem_r for that program. At x = L the local pressure is zero, so $u_s → ∞$ and $σ² → ∞$. The finite outlet width there is the temporal width from the position-domain solver. This solver is for a finite pressure at both ends (forward elution, a pause, or pin < pout).
Note: The result is the solution structure from DifferentialEquations.jl. sol.t is time and sol.u is (x, σ²).
See also: odesystem_time!, solving_migration_time, solving_bandvariance_time
GasChromatographySimulator.odesystem_time! — Function
odesystem_time!(du, u, p, t)The ODE system for migration $x(t)$ and spatial band variance $σ²(t)$.
$\frac{dx}{dt} = u_s(x, t)$
$\frac{dσ^2}{dt} = \mathcal{D}(x,t) + 2 σ^2 \frac{∂u_s}{∂x}(x,t)$
The state is (x, σ²). Parameter order in p matches odesystem_r!: (L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, opt).
See also: solving_odesystem_time, bandode, solute_velocity
GasChromatographySimulator.bandode — Function
bandode(z, t, σ², L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, opt)Right-hand side for the spatial band variance $σ²(t)$ at position z and time t.
$\frac{dσ^2}{dt} = \mathcal{D}(z,t) + 2 σ^2 \frac{∂u_s}{∂x}(z,t)$
$∂u_s/∂x$ is taken at fixed time. The gradient term keeps its sign. $\mathcal{D}$ stays non-negative, including when the band reverses.
See also: temporal_dispersion_rate, solute_velocity, solving_bandvariance_time
GasChromatographySimulator.time_domain_exit_callback — Function
time_domain_exit_callback(L, t₀, p; vel=nothing)Callback that terminates a time-domain solve when the band leaves the column. Root 1 is x - L and root 2 is x. The solve stops only on an outward crossing: x = L while $u_s > 0$, or x = 0 while $u_s < 0$ and t > t₀. A crossing in the other direction, and the initial condition sitting on x = 0, do not stop the solve.
p has the layout of odesystem_time! and of solving_migration_time: (L, d, df, gas, T_itp, Fpin_itp, pout_itp, Tchar, θchar, ΔCp, φ₀, Cag, opt). Pass vel(x, t) to supply the solute velocity instead of building it from p. The state may be a scalar position or the vector (x, σ²).
See also: solving_migration_time, solving_odesystem_time, solute_velocity
GasChromatographySimulator.program_knots — Function
program_knots(T_itp, t₀, t_end)Program times strictly between t₀ and t_end, used as tstops of the time-domain solvers. T_itp.grid[2] already holds the absolute times (cumsum of the program step durations). This function does not cumsum that grid again.
See also: solving_migration_time, temperature_interpolation
Results
GasChromatographySimulator.peaklist — Method
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τRbetween the peaks.Annotations: additional anotations, e.g. Source, categories, if available
Examples
julia> pl = peaklist(sol, par)
...GasChromatographySimulator.peaklist — Method
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τRbetween the peaks.Annotations: additional anotations, e.g. Source, categories, if available
Examples
julia> pl = peaklist(sol, peak, par)
...GasChromatographySimulator.peaklist_temporal — Function
peaklist_temporal(sol, par)
peaklist_temporal(sol, band, par)Exit record for a :temporal solve. First form: coupled solving_odesystem_time state $(x, σ²)$. Second form: separate solving_migration_time + solving_bandvariance_time. Columns include tR, τR, σR, x_end, uR, and exit_end (0.0, L, or NaN if not eluted). Not interchangeable with the spatial peaklist ($t(z)$ / $τ²(z)$).
GasChromatographySimulator.sol_extraction — Method
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)
...GasChromatographySimulator.sol_extraction — Method
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)
...Plot functions
GasChromatographySimulator.plot_chromatogram — Function
plot_chromatogram(peaklist, tlims; annotation=true, number=true, mirror=false, offset=0.0, uncertainty=false, color=:blue, label=nothing)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, ifmirror = truethe chromatogram is multiplied by-1; default = false.offset: Float64, this value is added to the chromatogram; default = 0.0.uncertainty: Boolean, ifuncertainty = truethe 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 aspeak width - uncertaintyandpeak width + uncertainty. Default is false.color: Symbol of the color for the chromatogram, default is:blue.label: Optional label for the plotted chromatogram (used in legends). Default isnothing.
Output
Tupel (p_chrom, t, chrom)
p_chrom: the plot of the chromatogramchromover timett: Array of time of the chromatogramchrom: Array of the abundance values of the chromatogram
GasChromatographySimulator.plot_chromatogram! — Function
plot_chromatogram!(p_chrom, peaklist, tlims; annotation=true, number=true, mirror=true, offset=0.0, uncertainty=false, color=:darkgreen, label=nothing)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, ifmirror = truethe chromatogram is multiplied by-1; default = false.offset: Float64, this value is added to the chromatogram; default = 0.0.uncertainty: Boolean, ifuncertainty = truethe 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 aspeak width - uncertaintyandpeak width + uncertainty. Default is false.color: Symbol of the color for the chromatogram, default is:darkgreen.label: Optional label for the plotted chromatogram (used in legends). Default isnothing.
Output
Tupel (t, chrom)
t: Array of time of the chromatogramchrom: Array of the abundance values of the chromatogram
GasChromatographySimulator.plot_flow — Function
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.
GasChromatographySimulator.plot_pressure — Function
plot_pressure(prog)Plot the inlet and outlet pressure over time of the program prog::GasChromatographySimulator.Program.
GasChromatographySimulator.plot_temperature — Function
plot_temperature(par; selector="T(t)")Plot the temperature program of the GC Column.
Arguments
par::GasChromatographySimulator.Parameters: parameters of the GC systemselector::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`GasChromatographySimulator.local_plots — Function
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.
GasChromatographySimulator.velocity — Function
velocity(df_sol, i, par)Calculate the velocity (in m/s) coressponding to solution of the i-th sunstance of a GC-system defined by par.
UI functions for notebooks
GasChromatographySimulator.UI_Column — Function
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
GasChromatographySimulator.UI_Program — Function
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)).
GasChromatographySimulator.UI_Substance — Function
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.
GasChromatographySimulator.UI_Options — Function
UI_Options()Construct a combined PlutoUI widget for the settings of the options for the simulation.
GasChromatographySimulator.setting_prog — Function
setting_prog(prog_values)Translates the Program parameters from a tuple defined by a PlutoUI widget into the structure GasChromatographySimulator.Program.
Helper functions
GasChromatographySimulator.profile — Function
profile(g, x)Value of a column profile at position x. A Number is constant along the column. Any other profile is called as g(x).
Use this for column diameter d and film thickness df wherever either may be a number or a function of x. Prefer it over isa checks or extra methods for ::Number vs callable arguments.
GasChromatographySimulator.temperature_interpolation — Function
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 functiongf(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)GasChromatographySimulator.steps_interpolation — Function
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])GasChromatographySimulator.load_solute_database — Function
load_solute_database(db_path, db, sp, gas, solutes, t₀, τ₀; x₀=zeros(length(solutes)), σ₀=zeros(length(solutes)))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.x₀: Initial positions along the column, in m. Optional. Default is a vector of zeros with the same length assolutes.σ₀: Initial spatial band widths, in m. Optional. Default is a vector of zeros with the same length assolutes.
Examples
julia> sub = load_solute_database("path/to/the/file", "db.csv", "DB5", "He", ["C10", "C11"], [0.0, 0.0], [0.5, 0.5])load_solute_database(db_, sp_, gas_, solutes_, t₀_, τ₀_; x₀=zeros(length(solutes_)), σ₀=zeros(length(solutes_)))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.
x₀ and σ₀ are optional vectors of the initial position (m) and the initial spatial band width (m). Both default to zeros of the same length as solutes_. A shorter vector is padded with zeros. A longer vector is truncated.
The loaded data is returned as a vector of the GasChromatographySimulator.Substance structure.
GasChromatographySimulator.all_solutes — Function
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: iftruethan 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)GasChromatographySimulator.diffusivity — Function
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.
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.
GasChromatographySimulator.common — Function
common(s_1, s_1)Compare two arrays and return the common elements.
GasChromatographySimulator.compare_peaklist — Function
compare_peaklist(pl_1, pl_2)Compare two peaklists (results of GasChromatographySimulator.jl) and calculate absolute and relative differences of retention times and peak widths.
GasChromatographySimulator.compare_measurement_simulation — Function
compare_measurement_simulation(meas, peaklist)Compare the retention times of measured and simulated substances.
Arguments
meas: DataFrame consisting at least of the columns:Nameand:RTor:tR(measured retention time in s)peaklist: DataFrame as result from GasChromatographySimulator.jl with the columns:Nameand: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 %).
GasChromatographySimulator.conventional_program — Method
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.
GasChromatographySimulator.temperature_program — Method
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.
GasChromatographySimulator.common_time_steps — Function
common_time_steps(time_steps_1, time_steps_2)Estimate a new set of time steps, which represents the combination of time_steps_1 and time_steps_2.
GasChromatographySimulator.new_value_steps — Function
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.
GasChromatographySimulator.ColumnGasChromatographySimulator.ColumnGasChromatographySimulator.OptionsGasChromatographySimulator.ParametersGasChromatographySimulator.ProgramGasChromatographySimulator.ProgramGasChromatographySimulator.ProgramGasChromatographySimulator.ProgramGasChromatographySimulator.ProgramGasChromatographySimulator.ProgramGasChromatographySimulator.SubstanceGasChromatographySimulator.UI_ColumnGasChromatographySimulator.UI_OptionsGasChromatographySimulator.UI_ProgramGasChromatographySimulator.UI_SubstanceGasChromatographySimulator.all_solutesGasChromatographySimulator.bandodeGasChromatographySimulator.commonGasChromatographySimulator.common_time_stepsGasChromatographySimulator.compare_measurement_simulationGasChromatographySimulator.compare_peaklistGasChromatographySimulator.conventional_programGasChromatographySimulator.diffusion_mobileGasChromatographySimulator.diffusivityGasChromatographySimulator.flowGasChromatographySimulator.flow_restrictionGasChromatographySimulator.holdup_timeGasChromatographySimulator.load_solute_databaseGasChromatographySimulator.local_plotsGasChromatographySimulator.mobile_phase_residencyGasChromatographySimulator.mobile_phase_velocityGasChromatographySimulator.new_value_stepsGasChromatographySimulator.odesystem_r!GasChromatographySimulator.odesystem_time!GasChromatographySimulator.peaklistGasChromatographySimulator.peaklistGasChromatographySimulator.peaklist_temporalGasChromatographySimulator.peakodeGasChromatographySimulator.plate_heightGasChromatographySimulator.plot_chromatogramGasChromatographySimulator.plot_chromatogram!GasChromatographySimulator.plot_flowGasChromatographySimulator.plot_pressureGasChromatographySimulator.plot_temperatureGasChromatographySimulator.pressureGasChromatographySimulator.profileGasChromatographySimulator.program_knotsGasChromatographySimulator.residencyGasChromatographySimulator.retention_factorGasChromatographySimulator.setting_progGasChromatographySimulator.simulateGasChromatographySimulator.sol_extractionGasChromatographySimulator.sol_extractionGasChromatographySimulator.solute_velocityGasChromatographySimulator.solve_separate_multithreadsGasChromatographySimulator.solve_system_multithreadsGasChromatographySimulator.solving_bandvariance_timeGasChromatographySimulator.solving_migrationGasChromatographySimulator.solving_migration_timeGasChromatographySimulator.solving_odesystem_rGasChromatographySimulator.solving_odesystem_timeGasChromatographySimulator.solving_peakvarianceGasChromatographySimulator.steps_interpolationGasChromatographySimulator.temperature_interpolationGasChromatographySimulator.temperature_programGasChromatographySimulator.temporal_dispersion_rateGasChromatographySimulator.time_domain_exit_callbackGasChromatographySimulator.velocityGasChromatographySimulator.viscosity