Changeset 404ebbd in sasmodels for sasmodels/models/polymer_micelle.py
- Timestamp:
- Jul 30, 2017 12:56:22 AM (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:
- 48462b0
- Parents:
- a151caa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/polymer_micelle.py
r925ad6e r404ebbd 16 16 which then defines a micelle core of $radius\_core$, which is a separate parameter 17 17 even though it could be directly determined. 18 The Gaussian random coil tails, of gyration radius $rg$, are imagined uniformly 18 The Gaussian random coil tails, of gyration radius $rg$, are imagined uniformly 19 19 distributed around the spherical core, centred at a distance $radius\_core + d\_penetration.rg$ 20 20 from the micelle centre, where $d\_penetration$ is of order unity. … … 27 27 .. math:: 28 28 P(q) = N^2\beta^2_s\Phi(qR)^2+N\beta^2_cP_c(q)+2N^2\beta_s\beta_cS_{sc}s_c(q)+N(N-1)\beta_c^2S_{cc}(q) 29 29 30 30 \beta_s = v\_core(sld\_core - sld\_solvent) 31 31 32 32 \beta_c = v\_corona(sld\_corona - sld\_solvent) 33 33 34 where $N = n\_aggreg$, and for the spherical core of radius $R$ 34 where $N = n\_aggreg$, and for the spherical core of radius $R$ 35 35 36 .. math:: 36 .. math:: 37 37 \Phi(qR)= \frac{\sin(qr) - qr\cos(qr)}{(qr)^3} 38 38 … … 49 49 50 50 .. math:: 51 51 52 52 S_{sc}(q)=\Phi(qR)\psi(Z)\frac{sin(q(R+d.R_g))}{q(R+d.R_g)} 53 53 54 54 S_{cc}(q)=\psi(Z)^2\left[\frac{sin(q(R+d.R_g))}{q(R+d.R_g)} \right ]^2 55 55 56 56 \psi(Z)=\frac{[1-exp^{-Z}]}{Z} 57 57 … … 60 60 61 61 $P(q)$ above is multiplied by $ndensity$, and a units conversion of 10^{-13}, so $scale$ 62 is likely 1.0 if the scattering data is in absolute units. This model has not yet been 62 is likely 1.0 if the scattering data is in absolute units. This model has not yet been 63 63 independently validated. 64 64 … … 71 71 """ 72 72 73 from numpy import inf 73 from numpy import inf, pi 74 74 75 75 name = "polymer_micelle" … … 80 80 to block copolymer micelles. To work well the Gaussian chains must be much 81 81 smaller than the core, which is often not the case. Please study the 82 reference to Pedersen and full documentation carefully. 82 reference to Pedersen and full documentation carefully. 83 83 """ 84 84 … … 106 106 source = ["lib/sas_3j1x_x.c", "polymer_micelle.c"] 107 107 108 demo = dict(scale=1, background=0, 109 ndensity=8.94, 110 v_core=62624.0, 111 v_corona=61940.0, 112 sld_solvent=6.4, 113 sld_core=0.34, 114 sld_corona=0.8, 115 radius_core=45.0, 116 rg=20.0, 117 d_penetration=1.0, 118 n_aggreg=6.0) 119 108 def random(): 109 import numpy as np 110 radius_core = 10**np.random.uniform(1, 3) 111 rg = radius_core * 10**np.random.uniform(-2, -0.3) 112 d_penetration = np.random.randn()*0.05 + 1 113 n_aggreg = np.random.randint(3, 30) 114 # volume of head groups is the core volume over the number of groups, 115 # with a correction for packing fraction of the head groups. 116 v_core = 4*pi/3*radius_core**3/n_aggreg * 0.68 117 # Rg^2 for gaussian coil is a^2n/6 => a^2 = 6 Rg^2/n 118 # a=2r => r = Rg sqrt(3/2n) 119 # v = 4/3 pi r^3 n => v = 4/3 pi Rg^3 (3/2n)^(3/2) n = pi Rg^3 sqrt(6/n) 120 tail_segments = np.random.randint(6, 30) 121 v_corona = pi * rg**3 * np.sqrt(6/tail_segments) 122 V = 4*pi/3*(radius_core + rg)**3 123 pars = dict( 124 background=0, 125 scale=1e7/V, 126 ndensity=8.94, 127 v_core=v_core, 128 v_corona=v_corona, 129 radius_core=radius_core, 130 rg=rg, 131 d_penetration=d_penetration, 132 n_aggreg=n_aggreg, 133 ) 134 return pars 120 135 121 136 tests = [
Note: See TracChangeset
for help on using the changeset viewer.