Skip to content

Commit

Permalink
working on
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliacomi committed Apr 29, 2019
1 parent 97d9b12 commit 04716b1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
],
"coverage-gutters.xmlname": "coverage.xml",
"python.pythonPath": "C:\\tools\\miniconda3\\envs\\py37\\python.exe",
"restructuredtext.confPath": ""
}
35 changes: 18 additions & 17 deletions src/pygaps/calculations/models_isotherm/da.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import scipy

from ...utilities.exceptions import CalculationError
from .model import IsothermModel
from .base_model import IsothermBaseModel


class DR(IsothermModel):
class DR(IsothermBaseModel):
r"""
Dubinin-Astakov (DA) adsorption isotherm.
Expand All @@ -25,20 +25,20 @@ class DR(IsothermModel):
in Progress in Surface and Membrane Science, vol. 9, Elsevier, 1975, pp. 1–70.
"""
#: Name of the model

# Model parameters
name = 'DA'
calculates = 'loading'

def __init__(self):
"""
Instantiation function
"""

self.params = {"n_t": numpy.nan, "m": numpy.nan, "eps": numpy.nan}
param_names = ["n_m", "e", "exp"]
param_bounds = {
"n_m": [0, numpy.inf],
"e": [-numpy.inf, numpy.inf],
"exp": [0, 3],
}

def loading(self, pressure):
"""
Calculate loading.
Calculate loading at specified pressure.
Parameters
----------
Expand All @@ -50,16 +50,17 @@ def loading(self, pressure):
float
Loading at specified pressure.
"""
return self.params["n_t"] * numpy.exp(
scipy.constants.r
return self.params["n_m"] * numpy.exp(
(scipy.constants.r) **
)

def pressure(self, loading):
"""
Function that calculates pressure as a function
of loading.
For the BET model, the pressure will
be computed numerically as no analytical inversion is possible.
Calculate pressure at specified loading.
Careful!
For the DA model, the loading has to
be computed numerically.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion src/pygaps/calculations/models_isotherm/dr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import scipy

from ...utilities.exceptions import CalculationError
from .model import IsothermModel
from .base_model import IsothermBaseModel


class DR(IsothermModel):
Expand Down

0 comments on commit 04716b1

Please sign in to comment.