source: sasmodels/sasmodels/models/rpa.py @ fa8011eb

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since fa8011eb was fa8011eb, checked in by Paul Kienzle <pkienzle@…>, 7 years ago

doc cleanup

  • Property mode set to 100644
File size: 4.9 KB
Line 
1r"""
2Calculates the macroscopic scattering intensity for a multi-component
3homogeneous mixture of polymers using the Random Phase Approximation.
4This general formalism contains 10 specific cases
5
6Case 0: C/D binary mixture of homopolymers
7
8Case 1: C-D diblock copolymer
9
10Case 2: B/C/D ternary mixture of homopolymers
11
12Case 3: C/C-D mixture of a homopolymer B and a diblock copolymer C-D
13
14Case 4: B-C-D triblock copolymer
15
16Case 5: A/B/C/D quaternary mixture of homopolymers
17
18Case 6: A/B/C-D mixture of two homopolymers A/B and a diblock C-D
19
20Case 7: A/B-C-D mixture of a homopolymer A and a triblock B-C-D
21
22Case 8: A-B/C-D mixture of two diblock copolymers A-B and C-D
23
24Case 9: A-B-C-D tetra-block copolymer
25
26**NB: these case numbers are different from those in the NIST SANS package!**
27
28Only one case can be used at any one time.
29
30The RPA (mean field) formalism only applies only when the multicomponent
31polymer mixture is in the homogeneous mixed-phase region.
32
33**Component D is assumed to be the "background" component (ie, all contrasts
34are calculated with respect to component D).** So the scattering contrast
35for a C/D blend = [SLD(component C) - SLD(component D)]\ :sup:`2`.
36
37Depending on which case is being used, the number of fitting parameters - the
38segment lengths (ba, bb, etc) and $\chi$ parameters (Kab, Kac, etc) - vary.
39The *scale* parameter should be held equal to unity.
40
41The input parameters are the degrees of polymerization, the volume fractions,
42the specific volumes, and the neutron scattering length densities for each
43component.
44
45.. figure:: img/rpa_1d.jpg
46
47    1D plot using the default values (w/500 data points).
48
49References
50----------
51
52A Z Akcasu, R Klein and B Hammouda, *Macromolecules*, 26 (1993) 4136
53"""
54
55from numpy import inf
56
57name = "rpa"
58title = "Random Phase Approximation"
59description = """
60This formalism applies to multicomponent polymer mixtures in the
61homogeneous (mixed) phase region only.
62Case 0: C/D binary mixture of homopolymers
63Case 1: C-D diblock copolymer
64Case 2: B/C/D ternary mixture of homopolymers
65Case 3: B/C-D mixture of homopolymer b and diblock copolymer C-D
66Case 4: B-C-D triblock copolymer
67Case 5: A/B/C/D quaternary mixture of homopolymers
68Case 6: A/B/C-D mixture of two homopolymers A/B and a diblock C-D
69Case 7: A/B-C-D mixture of a homopolymer A and a triblock B-C-D
70Case 8: A-B/C-D mixture of two diblock copolymers A-B and C-D
71Case 9: A-B-C-D four-block copolymer
72See details in the model function help
73"""
74category = ""
75
76CASES = [
77    "C+D binary mixture",
78    "C:D diblock copolymer",
79    "B+C+D ternary mixture",
80    "B+C:D binary mixture",
81    "B:C:D triblock copolymer",
82    "A+B+C+D quaternary mixture",
83    "A+B+C:D ternary mixture",
84    "A+B:C:D binary mixture",
85    "A:B+C:D binary mixture",
86    "A:B:C:D quadblock copolymer",
87]
88
89#   ["name", "units", default, [lower, upper], "type","description"],
90parameters = [
91    ["case_num", CASES, 0, [0, 10], "", "Component organization"],
92
93    ["Na", "", 1000.0, [1, inf], "", "Degree of polymerization"],
94    ["Phia", "", 0.25, [0, 1], "", "volume fraction"],
95    ["va", "mL/mol", 100.0, [0, inf], "", "specific volume"],
96    ["La", "fm", 10.0, [-inf, inf], "", "scattering length"],
97    ["ba", "Ang", 5.0, [0, inf], "", "segment length"],
98
99    ["Nb", "", 1000.0, [1, inf], "", "Degree of polymerization"],
100    ["Phib", "", 0.25, [0, 1], "", "volume fraction"],
101    ["vb", "mL/mol", 100.0, [0, inf], "", "specific volume"],
102    ["Lb", "fm", 10.0, [-inf, inf], "", "scattering length"],
103    ["bb", "Ang", 5.0, [0, inf], "", "segment length"],
104
105    ["Nc", "", 1000.0, [1, inf], "", "Degree of polymerization"],
106    ["Phic", "", 0.25, [0, 1], "", "volume fraction"],
107    ["vc", "mL/mol", 100.0, [0, inf], "", "specific volume"],
108    ["Lc", "fm", 10.0, [-inf, inf], "", "scattering length"],
109    ["bc", "Ang", 5.0, [0, inf], "", "segment length"],
110
111    ["Nd", "", 1000.0, [1, inf], "", "Degree of polymerization"],
112    ["Phid", "", 0.25, [0, 1], "", "volume fraction"],
113    ["vd", "mL/mol", 100.0, [0, inf], "", "specific volume"],
114    ["Ld", "fm", 10.0, [-inf, inf], "", "scattering length"],
115    ["bd", "Ang", 5.0, [0, inf], "", "segment length"],
116
117    ["Kab", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
118    ["Kac", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
119    ["Kad", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
120    ["Kbc", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
121    ["Kbd", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
122    ["Kcd", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
123]
124
125category = "shape-independent"
126
127source = ["rpa.c"]
128
129HIDE_NONE = set()
130HIDE_A = set("Na Phia va La Kab Kac Kad".split())
131HIDE_AB = set("Nb Phib vb Lb Kbc Kbd".split()).union(HIDE_A)
132def hidden(pars):
133    case_num = pars.get("case_num", parameters[0][2])
134    if case_num < 2:
135        return HIDE_A
136    elif case_num < 5:
137        return HIDE_AB
138    else:
139        return HIDE_NONE
140
141oldname = 'RPAModel'
142oldpars = dict(
143    case_num="lcase_n",
144)
Note: See TracBrowser for help on using the repository browser.