-
Notifications
You must be signed in to change notification settings - Fork 3
Added nSCFT #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Added nSCFT #13
Conversation
Added numerical self consistent theory code, adapted from the work Paul Kienzle and Richard Sheridan in Refl1D
def __init__( | ||
self, | ||
adsorbed_amount, | ||
lattice_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lattice_size docstring missing
self, | ||
adsorbed_amount, | ||
lattice_size, | ||
polymerMW, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polymerMW docstring missing. (it's referred to as mn)?
""" | ||
Parameters | ||
---------- | ||
Adsorbed Amount : Parameter or float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please order docstring in the same order that the parameters appear.
|
||
dist_model : function or None | ||
The model used to turn the PDI paramter into a probability density function of chain lengths. | ||
If none the SZdist model is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this PDF specified?
rough : float | ||
the (gaussian) roughness between slabs in the slab approximation of the profile | ||
|
||
dist_model : function or None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is dist_model, is it an rv_continuous, or a general callable? What is the call signature that the function should take?
problems arise when the distribution gets too uniform, so if we find them, | ||
default to an exact uniform calculation. | ||
""" | ||
from scipy.special import gammaln |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be top level, doesn't need to be lazy import.
|
||
Shultz-Zimm is a "realistic" distribution for linear polymers. Numerical | ||
problems arise when the distribution gets too uniform, so if we find them, | ||
default to an exact uniform calculation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters for docstring, what is PDI, what is nn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the function supposed to return?
|
||
uniform = False | ||
|
||
if pdi == 1.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comparing floats for equality can be a recipe for mistakes.
Uses a numerical self-consistent field profile.\ [#Cosgrove]_\ [#deVos]_\ [#Sheridan]_ | ||
|
||
**Parameters** | ||
*chi* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use numpydoc type formatting, e.g.
Parameters
-----------
Unless, this docstring is taken from refl1d, in which case leave as-is.
|
||
Using an OrderedDict because I want to prune keys FIFO | ||
""" | ||
from scipy.optimize.nonlin import NoConvergence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be top level import
Added nSCFT, adapted from the work of Paul Kienzle (NIST) and Richard Sheridan.