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

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

remove oldname/oldpars from new models

  • Property mode set to 100644
File size: 4.8 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
46References
47----------
48
49A Z Akcasu, R Klein and B Hammouda, *Macromolecules*, 26 (1993) 4136
50"""
51
52from numpy import inf
53
54name = "rpa"
55title = "Random Phase Approximation - unfinished work in progress"
56description = """
57This formalism applies to multicomponent polymer mixtures in the
58homogeneous (mixed) phase region only.
59Case 0: C/D binary mixture of homopolymers
60Case 1: C-D diblock copolymer
61Case 2: B/C/D ternary mixture of homopolymers
62Case 3: B/C-D mixture of homopolymer b and diblock copolymer C-D
63Case 4: B-C-D triblock copolymer
64Case 5: A/B/C/D quaternary mixture of homopolymers
65Case 6: A/B/C-D mixture of two homopolymers A/B and a diblock C-D
66Case 7: A/B-C-D mixture of a homopolymer A and a triblock B-C-D
67Case 8: A-B/C-D mixture of two diblock copolymers A-B and C-D
68Case 9: A-B-C-D four-block copolymer
69See details in the model function help
70"""
71category = ""
72
73CASES = [
74    "C+D binary mixture",
75    "C:D diblock copolymer",
76    "B+C+D ternary mixture",
77    "B+C:D binary mixture",
78    "B:C:D triblock copolymer",
79    "A+B+C+D quaternary mixture",
80    "A+B+C:D ternary mixture",
81    "A+B:C:D binary mixture",
82    "A:B+C:D binary mixture",
83    "A:B:C:D quadblock copolymer",
84]
85
86#   ["name", "units", default, [lower, upper], "type","description"],
87parameters = [
88    ["case_num", CASES, 0, [0, 10], "", "Component organization"],
89
90    ["Na", "", 1000.0, [1, inf], "", "Degree of polymerization"],
91    ["Phia", "", 0.25, [0, 1], "", "volume fraction"],
92    ["va", "mL/mol", 100.0, [0, inf], "", "specific volume"],
93    ["La", "fm", 10.0, [-inf, inf], "", "scattering length"],
94    ["ba", "Ang", 5.0, [0, inf], "", "segment length"],
95
96    ["Nb", "", 1000.0, [1, inf], "", "Degree of polymerization"],
97    ["Phib", "", 0.25, [0, 1], "", "volume fraction"],
98    ["vb", "mL/mol", 100.0, [0, inf], "", "specific volume"],
99    ["Lb", "fm", 10.0, [-inf, inf], "", "scattering length"],
100    ["bb", "Ang", 5.0, [0, inf], "", "segment length"],
101
102    ["Nc", "", 1000.0, [1, inf], "", "Degree of polymerization"],
103    ["Phic", "", 0.25, [0, 1], "", "volume fraction"],
104    ["vc", "mL/mol", 100.0, [0, inf], "", "specific volume"],
105    ["Lc", "fm", 10.0, [-inf, inf], "", "scattering length"],
106    ["bc", "Ang", 5.0, [0, inf], "", "segment length"],
107
108    ["Nd", "", 1000.0, [1, inf], "", "Degree of polymerization"],
109    ["Phid", "", 0.25, [0, 1], "", "volume fraction"],
110    ["vd", "mL/mol", 100.0, [0, inf], "", "specific volume"],
111    ["Ld", "fm", 10.0, [-inf, inf], "", "scattering length"],
112    ["bd", "Ang", 5.0, [0, inf], "", "segment length"],
113
114    ["Kab", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
115    ["Kac", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
116    ["Kad", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
117    ["Kbc", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
118    ["Kbd", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
119    ["Kcd", "", -0.0004, [-inf, inf], "", "Interaction parameter"],
120]
121
122category = "shape-independent"
123
124source = ["rpa.c"]
125
126HIDE_NONE = set()
127HIDE_A = set("Na Phia va La Kab Kac Kad".split())
128HIDE_AB = set("Nb Phib vb Lb Kbc Kbd".split()).union(HIDE_A)
129def hidden(pars):
130    case_num = pars.get("case_num", parameters[0][2])
131    if case_num < 2:
132        return HIDE_AB
133    elif case_num < 5:
134        return HIDE_A
135    else:
136        return HIDE_NONE
137
Note: See TracBrowser for help on using the repository browser.