diff --git a/docs/make.jl b/docs/make.jl index 17a0daf..aafe5d6 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,6 +4,7 @@ using Langmuir makedocs(; modules = Langmuir, + checkdocs=:none, authors = "Andres Riedemann, Vinicius Viena Santana and contributors", sitename = "Langmuir.jl", format = Documenter.HTML(; @@ -15,7 +16,7 @@ makedocs(; "Home" => "index.md", "Background" => "tutorials/background.md", "Getting Started" => "tutorials/getting_started.md", - "Tutorial" => "tutorials/tutorial.md", + "Tutorials" => Any["tutorials/tutorial.md"], "Supported models" => "models/models.md", "Reference" => "reference.md", ], diff --git a/docs/src/models/models.md b/docs/src/models/models.md index 41c6a73..38e2bcd 100644 --- a/docs/src/models/models.md +++ b/docs/src/models/models.md @@ -15,7 +15,9 @@ Pages = ["models.md"] ``` ## No-parameter Isotherm Models - +```@docs +Langmuir.ZeroIsotherm +``` ## One-parameter Isotherm Models diff --git a/docs/src/reference.md b/docs/src/reference.md index 049784d..29d95ce 100644 --- a/docs/src/reference.md +++ b/docs/src/reference.md @@ -16,19 +16,10 @@ Pages = ["reference.md"] ``` ```@docs -Langmuir.nlsolve -Langmuir.@MultiSite -Langmuir.isotherm_lower_bound Langmuir.isosteric_heat -Langmuir.f∂f∂2f Langmuir.pressure Langmuir.saturated_loading -Langmuir.x_sol Langmuir.loading Langmuir.henry_coefficient -Langmuir.isotherm_upper_bound Langmuir.sp_res -Langmuir.iast -Langmuir.@with_metadata -Langmuir.f∂f ``` \ No newline at end of file diff --git a/docs/src/tutorials/background.md b/docs/src/tutorials/background.md index f4e2157..da32c1a 100644 --- a/docs/src/tutorials/background.md +++ b/docs/src/tutorials/background.md @@ -20,7 +20,7 @@ where $Q_st$ is the isosteric heat of the component being adsorbed, $T$ is the t When the isotherm is of the form $N_i = f(T, P_i)$, one can write: -$Q_{st, i} = -T*(V_g - V_a)*\left( \frac{\frac{\partial N_i}{\partial T}\rvert_P_i}{\frac{\partial N_i}{\partial P}\rvert_T} \right)$ +$Q_{st, i} = -T \cdot (V_g - V_a) \cdot \left( \frac{\partial N_i / \partial T \mid P_i}{\partial N_i / \partial P \mid T} \right)$ ## Multi component adsorption @@ -38,7 +38,7 @@ $\sum_i^{N_c} x_i = 1$ Combining the two above equations, the following nonlinear solve is set: -$f(\pi) = 1-\sum_1^{N_c}\frac{Py_i}{P_i^0\left(\pi\right)}$ = 0 +$f(\pi) = 1-\sum_1^{N_c}\frac{Py_i}{P_i^0\left(\pi\right)} = 0$ diff --git a/docs/src/tutorials/tutorial.md b/docs/src/tutorials/tutorial.md index 87c0de3..4974364 100644 --- a/docs/src/tutorials/tutorial.md +++ b/docs/src/tutorials/tutorial.md @@ -1,4 +1,4 @@ -# [A complete tutorial with Langmuir.jl](@id Tutorial) +# [A typical workflow with Langmuir.jl](@id Tutorial) In this tutorial, we will go through a typical workflow for processing and analyzing adsorption equilibrium data: diff --git a/src/models/models.jl b/src/models/models.jl index 84ddfa5..874dbca 100644 --- a/src/models/models.jl +++ b/src/models/models.jl @@ -280,6 +280,7 @@ export IsothermModel include("freundlich.jl") include("langmuirs1.jl") +include("null.jl") include("langmuir_freundlich.jl") include("redlich_peterson.jl") include("sips.jl") diff --git a/src/models/multisite.jl b/src/models/multisite.jl index c56782d..ce9ed1e 100644 --- a/src/models/multisite.jl +++ b/src/models/multisite.jl @@ -1,17 +1,14 @@ """ - MultiSite(isotherms...) - MultiSite <: IsothermModel + MultiSite(isotherms::Vararg{IsothermModel}...) -The `MultiSite` isotherm model allows combining multiple single-site isotherms to model adsorption on surfaces with multiple distinct types of adsorption sites. - -## Inputs - -- `isotherms::Tuple{IsothermModel}`: A tuple of isotherm models representing the different adsorption sites. - -## Description +given a list of isotherms, create a multisite isotherm model. -The `MultiSite` model combines multiple isotherm models (e.g., Langmuir) to represent systems where adsorption occurs at different types of sites, each described by its own isotherm. This model is useful when the adsorbent has heterogeneous surface characteristics, with different regions or adsorption sites behaving according to different isotherm models. +```julia +model1 = LangmuirS1(3.0,1.0,0.0) +model2 = LangmuirS1(3.0,0.9,3000.0) +double_site_LangmuirS1 = MultiSite(model1,model2) #create a multisite model with two LangmuirS1 isotherms +``` """ struct MultiSite{T,𝕀} <: IsothermModel{T} isotherms::𝕀 @@ -43,20 +40,6 @@ function Base.getindex(m::MultiSite{T,𝕀}) where {T,𝕀} return m.isotherms[i] end -""" - - MultiSite(m1::IsothermModel,isotherms::Vararg{IsothermModel}...) - -given a list of isotherms, create a multisite isotherm model. - -```julia -model1 = LangmuirS1(3.0,1.0,0.0) -model2 = LangmuirS1(3.0,0.9,3000.0) -double_site_LangmuirS1 = MultiSite(model1,model2) #create a multisite model with two LangmuirS1 isotherms - -@assert loading(model1,1.0,3000.0) + loading(model2,1.0,3000.0) = loading(double_site_LangmuirS1,1.0,3000.0) -``` -""" function model_length(::Type{MultiSite{T,I}}) where {T,I} return _model_length_multi(I) diff --git a/src/models/null.jl b/src/models/null.jl index edcbc93..c8c3b71 100644 --- a/src/models/null.jl +++ b/src/models/null.jl @@ -25,3 +25,6 @@ sp_res(model::ZeroIsotherm, p, T) = zero(Base.promote_eltype(model,p,T)) loading(model::ZeroIsotherm, p, T) = zero(Base.promote_eltype(model,p,T)) henry_coefficient(model::ZeroIsotherm, T) = zero(Base.promote_eltype(model,T)) Base.iszero(::ZeroIsotherm) = true + + +export ZeroIsotherm diff --git a/src/utils.jl b/src/utils.jl index 3a612b9..7f93c4f 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -61,6 +61,7 @@ Base.IndexStyle(::Type{<:FractionVector}) = IndexLinear() returns f and ∂f/∂x evaluated in `x`, using `ForwardDiff.jl`, `DiffResults.jl` and `StaticArrays.jl` to calculate everything in one pass. """ + @inline function f∂f(f::F, x::R) where {F,R<:Real} T = typeof(ForwardDiff.Tag(f, R)) out = f(ForwardDiff.Dual{T,R,1}(x, ForwardDiff.Partials((oneunit(R),))))