Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ ProgressMeter | |
JLD2 | ||
LightGraphs | ||
FileIO | ||
Optim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Misc_Test | ||
|
||
using PorousMaterials | ||
using Test | ||
using DataFrames | ||
using CSV | ||
using Optim | ||
|
||
@testset "Misc Tests" begin | ||
### | ||
# adsorption isotherm tests | ||
### | ||
# Henry | ||
df = DataFrame(P = [0.0, 0.56, 1.333], N = [0.0, 0.534, 1.295]) | ||
henry = fit_adsorption_isotherm(df, :P, :N, :henry)["H"] | ||
@test isapprox(henry, 0.9688044280548711) | ||
|
||
# Langmuir | ||
P = range(0, stop=1, length=100) | ||
M = 23.0 | ||
K = 11.9 | ||
N = (M * K .* P) ./ (1 .+ K.*P) | ||
ids_fit = [1, 11, 21, 31, 41, 51, 61, 71, 81] | ||
df = DataFrame(P = P[ids_fit], N = N[ids_fit]) | ||
x = fit_adsorption_isotherm(df, :P, :N, :langmuir) | ||
M2, K2 = x["M"], x["K"] | ||
@test isapprox(M, M2) | ||
@test isapprox(K, K2) | ||
end | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters