Skip to content

Commit

Permalink
Merge pull request #18 from ClapeyronThermo/vini/rename
Browse files Browse the repository at this point in the history
docs and tutorial set up
  • Loading branch information
viniviena authored Oct 23, 2024
2 parents 356533d + 64542a0 commit 82af34d
Show file tree
Hide file tree
Showing 25 changed files with 699 additions and 74 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.1.0"
[deps]
BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209"
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Integrals = "de52edbc-65ea-441a-8357-d3a637375a31"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
3 changes: 2 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Langmuir = "c62cc850-d7ca-4cc1-a95b-48008b40dc90"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Langmuir = "c62cc850-d7ca-4cc1-a95b-48008b40dc90"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ makedocs(;
"Home" => "index.md",
"Background" => "tutorials/background.md",
"Getting Started" => "tutorials/getting_started.md",
"Tutorial" => "tutorials/tutorial.md",
"Supported models" => "models/models.md",
"Reference" => "reference.md",
],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CurrentModule = Langmuir

# Langmuir.jl

Langmuir.jl is a powerful Julia library designed to model adsorption equilibria for both single and multi-component systems.
Langmuir.jl is a Julia library designed to model adsorption equilibria for both single and multi-component systems.

For single-component adsorption, the library offers a wide range of isotherms, from simple one-parameter models like Henry's law to more complex two- and three-parameter models such as the Langmuir (Single and MultiSite), Freundlich, Temkin, Redlich-Peterson, Toth, and Sips isotherms. These models include temperature-dependent parameters, which are essential for estimating the isosteric heat of adsorption from pressure-loading data sets at varying temperatures. For a complete list of available models, refer to the list of supported models [`supported_models`](@ref).

Expand Down
6 changes: 3 additions & 3 deletions docs/src/tutorials/background.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}{\frac{\partial N_i}{\partial P}\rvert_T} \right)$
$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)$


## Multi component adsorption
Expand All @@ -36,9 +36,9 @@ $\pi = \pi_i = \int_{0}^{P_i^0} \frac{N_i^0(P)}{P}dP$ for $i = 1,...,N_c$
$\sum_i^{N_c} x_i = 1$


Combining (1) and (3), the following nonlinear solve is set to:
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



Expand Down
3 changes: 1 addition & 2 deletions docs/src/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ Below it is assumed that the ideal gas law is a good approximation to describe t

```@example lang1
import Langmuir: Rgas
Vg = Rgas(isotherm)*300.0./P[2:end]
ΔH = map(Vg_P -> isosteric_heat(isotherm, first(Vg_P), last(Vg_P), 300.), zip(Vg, P[2:end])) |> x -> round.(x, digits = 7)
ΔH = map(P -> isosteric_heat(isotherm, P, 300.), P[2:end]) |> x -> round.(x, digits = 7)
scatter(l_at_300[2:end], ΔH, size = (500, 250), ylabel = "Isosteric heat (J/mol)", xlabel = "loading (mol/kg)", label = "Estimated isosteric heat with AD")
plot!([first(l_at_300), last(l_at_300)], [-E, -E], label = "Expected value")
```
Expand Down
228 changes: 228 additions & 0 deletions docs/src/tutorials/sample_data/ethane_tpl_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
323,0,0
323,0.02029,0.0179
323,0.03093,0.03137
323,0.04074,0.04371
323,0.05,0.0552
323,0.06202,0.06984
323,0.07087,0.08062
323,0.08123,0.0933
323,0.09104,0.10521
323,0.10182,0.11846
323,0.13112,0.15417
323,0.16152,0.19144
323,0.19164,0.22816
323,0.22066,0.26402
323,0.2512,0.30124
323,0.2816,0.33881
323,0.31187,0.37602
323,0.34116,0.4123
323,0.37129,0.45025
323,0.40169,0.48862
323,0.43057,0.52971
323,0.46084,0.56834
323,0.49151,0.60775
323,0.52178,0.64649
323,0.55066,0.68397
323,0.58106,0.7241
323,0.61132,0.76388
323,0.64048,0.80271
323,0.67088,0.84388
323,0.70101,0.88432
323,0.73155,0.92624
323,0.76098,0.96725
323,0.79069,1.00812
323,0.82123,1.05054
323,0.84984,1.09244
323,0.88093,1.1363
323,0.91092,1.18035
323,0.94104,1.22383
323,0.97034,1.25982
323,1.00088,1.30132
323,1.24852,1.68094
323,1.49864,2.05808
323,1.74876,2.41864
323,1.99889,2.76366
323,2.24901,3.07926
323,2.49761,3.36583
323,2.74801,3.62487
323,2.99786,3.84778
323,3.24798,4.05292
323,3.49838,4.22614
323,3.74809,4.38462
323,3.9978,4.52662
323,4.24875,4.65604
323,4.49956,4.77042
323,4.74955,4.86424
323,4.99981,4.962
323,5.24952,5.04547
323,5.50033,5.12411
323,5.74907,5.19206
323,5.99906,5.24715
323,6.25291,5.31153
323,6.49917,5.36166
323,6.74929,5.41746
323,6.99914,5.46771
323,7.2494,5.51552
323,7.49938,5.56113
323,7.74951,5.60186
323,7.99949,5.64103
323,8.25072,5.67942
323,8.49987,5.71576
323,8.74958,5.74756
323,8.99915,5.78595
323,9.24817,5.81401
323,9.49774,5.84356
323,9.748,5.8792
323,9.99812,5.90908
303,0,0
303,0.02001,0.01633
303,0.03065,0.03978
303,0.04046,0.06146
303,0.05028,0.08253
303,0.06147,0.10679
303,0.07128,0.1277
303,0.08109,0.148
303,0.09063,0.16884
303,0.10196,0.19167
303,0.13139,0.25151
303,0.1611,0.31172
303,0.19192,0.3745
303,0.22052,0.43392
303,0.25106,0.49765
303,0.2816,0.56244
303,0.31159,0.62722
303,0.3413,0.69158
303,0.37157,0.75844
303,0.40169,0.82676
303,0.43043,0.89218
303,0.46111,0.96383
303,0.4911,1.035
303,0.52219,1.10876
303,0.55066,1.17813
303,0.58175,1.25476
303,0.61174,1.32991
303,0.64021,1.40244
303,0.67088,1.48084
303,0.70101,1.55863
303,0.73141,1.63801
303,0.76071,1.71536
303,0.79083,1.79491
303,0.82123,1.87587
303,0.85012,1.95327
303,0.88052,2.03444
303,0.9112,2.11657
303,0.9416,2.19722
303,0.97062,2.27464
303,1.0013,2.35619
303,1.24893,2.97916
303,1.49878,3.5279
303,1.74904,3.97805
303,1.99916,4.33653
303,2.24929,4.62275
303,2.49803,4.86391
303,2.74787,5.07049
303,2.99813,5.23621
303,3.24798,5.37882
303,3.49824,5.50171
303,3.74837,5.6126
303,3.99849,5.7145
303,4.24861,5.79757
303,4.49873,5.87987
303,4.749,5.94781
303,4.99912,6.01194
303,5.2491,6.07258
303,5.49923,6.12682
303,5.74811,6.17787
303,5.99795,6.22416
303,6.24808,6.26713
303,6.49861,6.31006
303,6.74805,6.34937
303,6.99831,6.38862
303,7.24857,6.42331
303,7.49841,6.45698
303,7.74826,6.48568
303,7.9988,6.51511
303,8.24892,6.54365
303,8.49891,6.56739
303,8.74848,6.59294
303,8.99763,6.61609
303,9.24762,6.63614
303,9.49746,6.6608
303,9.74814,6.67748
303,9.99799,6.70042
283,0.01186,0
283,0.02001,0.02878
283,0.03107,0.06987
283,0.04102,0.10613
283,0.05041,0.13986
283,0.06188,0.18066
283,0.07114,0.21208
283,0.08082,0.2456
283,0.09049,0.2789
283,0.10182,0.31866
283,0.13098,0.42165
283,0.16152,0.53076
283,0.19206,0.6453
283,0.2208,0.75786
283,0.2512,0.87941
283,0.28188,1.00841
283,0.31187,1.13835
283,0.34075,1.2681
283,0.37129,1.41099
283,0.40155,1.55624
283,0.43057,1.701
283,0.46097,1.85554
283,0.49138,2.01267
283,0.5215,2.17111
283,0.5508,2.3257
283,0.58134,2.48885
283,0.61146,2.64715
283,0.63993,2.79502
283,0.67075,2.95243
283,0.70087,3.10148
283,0.73127,3.24973
283,0.76043,3.38399
283,0.79056,3.51776
283,0.82123,3.64774
283,0.85039,3.76374
283,0.88024,3.87878
283,0.91078,3.99078
283,0.94146,4.09625
283,0.97006,4.18974
283,1.00116,4.28541
283,1.24866,4.87521
283,1.49878,5.27889
283,1.74876,5.56803
283,1.99902,5.78868
283,2.24915,5.96471
283,2.49789,6.10813
283,2.74815,6.23038
283,2.998,6.33599
283,3.24826,6.42868
283,3.4981,6.51056
283,3.7485,6.58324
283,3.99849,6.64966
283,4.24847,6.71033
283,4.4986,6.76576
283,4.74872,6.8173
283,4.99898,6.8631
283,5.24883,6.90628
283,5.49867,6.94688
283,5.74755,6.98479
283,5.99781,7.01724
283,6.24794,7.05175
283,6.49792,7.08112
283,6.74763,7.10919
283,6.99789,7.13669
283,7.24815,7.15995
283,7.49828,7.185
283,7.7484,7.20882
283,7.99852,7.22934
283,8.24823,7.24919
283,8.49849,7.26542
283,8.74903,7.28907
283,8.99736,7.30566
283,9.24748,7.32184
283,9.49733,7.33775
283,9.7469,7.35295
283,9.99743,7.36679
Loading

0 comments on commit 82af34d

Please sign in to comment.