Skip to content

Commit

Permalink
tweak two Yukawa docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Kienzle committed Jan 23, 2024
1 parent 660ffc4 commit 9fd13a8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.
3 changes: 1 addition & 2 deletions sasmodels/models/TY_YukawaSq.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ void translate(
}

TY_SolveEquations(*z1, *z2, *k1, *k2, *volumefraction, a, b, c1, c2, d1, d2, debug );

int checkFlag = TY_CheckSolution( *z1, *z2, *k1, *k2, *volumefraction, *a, *b, *c1, *c2, *d1, *d2 );
if (!checkFlag) {
*a = NAN;
Expand Down Expand Up @@ -67,7 +66,7 @@ double Iq(
)
{
if (isnan(a)) {
return a;
return NAN;
} else {
return SqTwoYukawa( qexp * 2 * radius, z1, z2, k1, k2, volumefraction, a, b, c1, c2, d1, d2 );
}
Expand Down
74 changes: 39 additions & 35 deletions sasmodels/models/TY_YukawaSq.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
r"""
This model calculates the interparticle structure factor for a colloidal system with
an interaction potential consisting of two Yukawa terms. If one Yukawa term
is chosen to be an attractive potential and another one to be a repulsive potential,
the two Yukawa potential can simulate a potential with both a short-range
attraction and long-range repulsion (SALR). [1,2]. When combined with an
appropriate form factor $P(q)$, this allows for inclusion of the
interparticle interference effects due to a relative complex potential.
This model calculates the interparticle structure factor for a colloidal system
with an interaction potential consisting of two Yukawa terms. If one Yukawa term
is chosen to be an attractive potential and the other a repulsive potential, the
two Yukawa potential can simulate a potential with both a short-range attraction
and long-range repulsion (SALR).[1,2] When combined with an appropriate form
factor $P(q)$, this allows for inclusion of the interparticle interference
effects due to a relatively complex potential.
The interaction potential $V(r)$ is
Expand All @@ -17,45 +16,48 @@
K_1 \frac{e^{-Z_1(r-2R)}}{r} + K_2 \frac{e^{-Z_2(r-2R)}}{r} & r \geq 2R
\end{cases}
And $R$ is the radius_effective.
where $R$ is radius_effective.
$K_1$ ( or $K_2$ ) is positive when there is a repulsion.
$K_1$ ( or $K_2$ ) is negative when there is an attraction.
.. note::
This routine only works for a potential with two Yukawa terms.
If the amplitude, $K_1$ or $K_2$ of either Yukawa potential
becomes zero, the routine may self-destruct! But one can make either
amplitude very small if there is a need to make one amplitude to be zero.
Also, $Z_1$ and $Z_2$ should be different. If these two numbers are identical,
it essentially becomes a potential with one Yukawa term.
But these two values can be very close to each other.
Therefore, the initial parameters of $Z_1$ and $Z_2$ should be different.
This routine only works for a potential with two Yukawa terms. If the
amplitude, $K_1$ or $K_2$, of either Yukawa potential becomes zero, the
routine may self-destruct! But one can make either amplitude very small if
there is a need to make one amplitude to be zero. Also, $Z_1$ and $Z_2$
should be different. If these two numbers are identical, it essentially
becomes a potential with one Yukawa term. But these two values can be very
close to each other. Therefore, the initial parameters of $Z_1$ and $Z_2$
should be different.
.. note::
Earlier versions of SasView did not incorporate the so-called
$\beta(q)$ ("beta") correction [3] for polydispersity and non-sphericity.
This is only available in SasView versions 5.0 and higher.
Earlier versions of SasView did not incorporate the so-called $\beta(q)$
("beta") correction [3] for polydispersity and non-sphericity. This is only
available in SasView versions 5.0 and higher.
This code calculates the structure factor, $S(q)$, of one component liquid systems interacting
with a two-term Yukawa potential with the mean spherical approximation (MSA).
The structure factor is generated by following Blum's method,[4]
in which the structure factor is solved using the Ornstein-Zernike equation by Baxter's Q-method with the MSA closure.
This code calculates the structure factor, $S(q)$, of one component liquid
systems interacting with a two-term Yukawa potential with the mean spherical
approximation (MSA). The structure factor is generated by following Blum's
method,[4] in which the structure factor is solved using the Ornstein-Zernike
equation by Baxter's Q-method with the MSA closure.
The algorithm used in this model was originally proposed and developled by Liu et al. in 2005 and implemented using MatLab.[1]
The algorithm was later reimplemented using C and Igor.
SasView used the C codes developed by M. Hennig in 2010.
The algorithm used in this model was originally proposed and developled by Liu
et al. in 2005 and implemented using MatLab.[1] The algorithm was later
reimplemented using C and Igor. SasView uses the C codes developed by M. Hennig
in 2010.
When the overall attraction is not very strong, this algorithm produces reasonably accurate results.[2]
However, whent the net attraction is very strong. It has been shown that the fitting algorithm
tend to underestimate the attraction strength.
Accuracy of this algorithm was evaluated by Broccio et al..[2]
When the overall attraction is not very strong, this algorithm produces
reasonably accurate results.[2] However, when the net attraction is very strong,
it has been shown that the fitting algorithm tends to underestimate the
attraction strength. Accuracy of this algorithm was evaluated by Broccio, et
al.[2]
When using the OZ euqation to obtain the structure factor, it assumes that a system is in a liquid state.
However, when the attraction potential is too strong, a physical system may not be in a liquid system any more.
But the OZ equation may still have a solution. But the result may not be physically meaningful.
When this happends, the solution of the OZ equation may return unphysical results or fail to return any result,
When using the O-Z equation to obtain the structure factor, it assumes that a
system is in a liquid state. However, when the attraction potential is too
strong the system may not be in a liquid state, and the O-Z equation may not
have a solution, or the solution may be unphysical.
References
----------
Expand Down Expand Up @@ -86,6 +88,8 @@
single = False # make sure that it has double digit precision
opencl = False # related with parallel computing

valid = "k1 != 0 && k2 != 0 && z1 != z2"

parameters = [
# ["name", "units", default, [lower, upper], "type", "description"],
["radius_effective", "Ang", 50.0, [-inf, inf], '', ''],
Expand Down

0 comments on commit 9fd13a8

Please sign in to comment.