A MoonBit library for adsorption isotherm and fixed-bed breakthrough curve calculations.
moon add weidekais/moonbit-adsorptionmoon check
moon testtest {
let data = [
@isotherm.AdsorptionData::{ c: 1.0, q: 3.3333333333 },
@isotherm.AdsorptionData::{ c: 2.0, q: 5.0 },
@isotherm.AdsorptionData::{ c: 4.0, q: 6.6666666667 },
@isotherm.AdsorptionData::{ c: 8.0, q: 8.0 },
]
let result = @isotherm.fit_langmuir(data)
inspect(result.q_m > 9.9 && result.q_m < 10.1, content="true")
inspect(result.k_l > 0.49 && result.k_l < 0.51, content="true")
}moon run --target native benchmarksutils/
optimization, root finding, ODE, linear algebra, interpolation, units, tables, quality control, signal analysis
isotherm/
equilibrium models, kinetic models, temperature and mixture models, fitting, diagnostics
fixed_bed/
dynamic single- and multicomponent simulation, breakthrough analysis, cycle operations, design screening
benchmarks/
runnable native example and reproducible numerical workload| Measurement | Result |
|---|---|
| fitted q_m | 10.000000000024196 |
| fitted k_l | 0.499999999996915 |
| R² | 1 |
| simulation steps | 1,000 |
| 50% breakthrough time | 9.99 |
| removal-capacity metric | 199.1335926829373 |
| end-to-end command time, one run | 409.61 ms |
moon fmt --check
moon check --target all --deny-warn
moon test --target all --deny-warn
moon info
git diff --exit-codeInstall
Download zipA MoonBit library for adsorption isotherm and fixed-bed breakthrough curve calculations.