Changeset 18a2bfc in sasmodels
- Timestamp:
- Oct 4, 2017 6:25:40 PM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- ced5bd2
- Parents:
- a8631ca
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/flexible_cylinder.py
ra8631ca r18a2bfc 101 101 # Accuracy tests based on content in test/utest_other_models.py 102 102 # Currently fails in OCL 103 # [{'length': 1000.0, 103 # [{'length': 1000.0, # test T1 104 104 # 'kuhn_length': 100.0, 105 105 # 'radius': 20.0, … … 110 110 111 111 # Additional tests with larger range of parameters 112 [{'length': 1000.0, 112 [{'length': 1000.0, # test T2 113 113 'kuhn_length': 100.0, 114 114 'radius': 20.0, … … 117 117 'background': 0.0001, 118 118 }, 1.0, 0.000595345], 119 [{'length': 10.0, 119 [{'length': 10.0, # test T3 120 120 'kuhn_length': 800.0, 121 121 'radius': 2.0, … … 124 124 'background': 0.001, 125 125 }, 0.1, 1.55228], 126 [{'length': 100.0, 126 [{'length': 100.0, # test T4 127 127 'kuhn_length': 800.0, 128 128 'radius': 50.0, … … 132 132 }, 1.0, 0.000938456] 133 133 ] 134 135 # There are a few branches in the code that ought to have test values: 136 # 137 # For length > 4 * kuhn_length 138 # if length > 10 * kuhn_length then C is scaled by 3.06 (L/b)^(-0.44) 139 # q*kuhn_length <= 3.1 => Sexv_new 140 # dS/dQ < 0 has different behaviour from dS/dQ >= 0 141 # T2 q*kuhn_length > 3.1 => a_long 142 # 143 # For length <= 4 * kuhn_length 144 # q*kuhn_length <= max(1.9/Rg_short, 3.0) => Sdebye((q*Rg)^2) 145 # q*Rg < 0.5 uses Pade approx, q*Rg > 1.0 uses math lib 146 # T3,T4 q*kuhn_length > max(1.9/Rg_short, 3.0) => a_short 147 # 148 # Note that the transitions between branches may be abrupt. You can see a 149 # several percent change around length=10*kuhn_length and length=4*kuhn_length 150 # using the following: 151 # 152 # sascomp flexible_cylinder -calc=double -sets=10 length=10*kuhn_length,10.000001*kuhn_length 153 # sascomp flexible_cylinder -calc=double -sets=10 length=4*kuhn_length,4.000001*kuhn_length 154 # 155 # The transition between low q and high q around q*kuhn_length = 3 seems 156 # to be good to 4 digits or better. This was tested by computing the value 157 # on each branches near the transition point and reporting the relative error 158 # for kuhn lengths of 10, 100 and 1000 and a variety of length:kuhn_length 159 # ratios. -
sasmodels/models/lib/wrc_cyl.c
ra8631ca r18a2bfc 192 192 double ans; 193 193 194 194 195 if( L > 4*b ) { // L > 4*b : Longer Chains 195 196 if (q*b <= 3.1) { … … 200 201 } else { // L <= 4*b : Shorter Chains 201 202 if (q*b <= q0short) { // q*b <= fmax(1.9/Rg_short, 3) 203 //printf("branch C-%d q=%g L=%g b=%g\n", square(q*Rg_short)<DEBYE_CUTOFF, q, L, b); 204 // Note that q0short is usually 3, but it will be greater than 3 205 // small enough b, depending on the L/b ratio: 206 // L/b == 1 => b < 2.37 207 // L/b == 2 => b < 1.36 208 // L/b == 3 => b < 1.00 209 // L/b == 4 => b < 0.816 202 210 // 2017-10-01 pkienzle: moved low q approximation into Sdebye() 203 //printf("branch C-%d q=%g L=%g b=%g\n", square(q*Rg_short)<DEBYE_CUTOFF, q, L, b);204 211 ans = Sdebye(square(q*Rg_short)); 205 212 } else { // q*b > max(1.9/Rg_short, 3)
Note: See TracChangeset
for help on using the changeset viewer.