Changes in / [8b935d1:3a66cf7] in sasmodels
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/raspberry.c
rbad8b12 r0433203 21 21 double Iq(double q, 22 22 double sld_lg, double sld_sm, double sld_solvent, 23 double volfraction_lg, double volfraction_sm, double surf _fraction,23 double volfraction_lg, double volfraction_sm, double surface_fraction, 24 24 double radius_lg, double radius_sm, double penetration) 25 25 { … … 37 37 sldL = sld_lg; 38 38 vfS = volfraction_sm; 39 fSs = surface_fraction; 39 40 rS = radius_sm; 40 aSs = surf_fraction;41 41 sldS = sld_sm; 42 42 deltaS = penetration; … … 48 48 VL = M_4PI_3*rL*rL*rL; 49 49 VS = M_4PI_3*rS*rS*rS; 50 Np = aSs*4.0*pow(((rL+deltaS)/rS), 2.0); 51 fSs = Np*vfL*VS/vfS/VL; 52 53 Np2 = aSs*4.0*(rS/(rL+deltaS))*VL/VS; 54 fSs2 = Np2*vfL*VS/vfS/VL; 50 51 Np = vfS*fSs*VL/vfL/VS; 52 55 53 slT = delrhoL*VL + Np*delrhoS*VS; 56 54 … … 59 57 60 58 f2 = delrhoL*delrhoL*VL*VL*sph_j1c(q*rL)*sph_j1c(q*rL); 61 f2 += Np 2*delrhoS*delrhoS*VS*VS*sph_j1c(q*rS)*sph_j1c(q*rS);62 f2 += Np 2*(Np2-1)*delrhoS*delrhoS*VS*VS*sfSS;63 f2 += 2*Np 2*delrhoL*delrhoS*VL*VS*sfLS;59 f2 += Np*delrhoS*delrhoS*VS*VS*sph_j1c(q*rS)*sph_j1c(q*rS); 60 f2 += Np*(Np-1)*delrhoS*delrhoS*VS*VS*sfSS; 61 f2 += 2*Np*delrhoL*delrhoS*VL*VS*sfLS; 64 62 if (f2 != 0.0){ 65 63 f2 = f2/slT/slT; 66 64 } 67 65 68 f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs 2*Np2*delrhoS*delrhoS*VS);66 f2 = f2*(vfL*delrhoL*delrhoL*VL + vfS*fSs*Np*delrhoS*delrhoS*VS); 69 67 70 68 f2+= vfS*(1.0-fSs)*pow(delrhoS, 2)*VS*sph_j1c(q*rS)*sph_j1c(q*rS); -
sasmodels/models/raspberry.py
rbad8b12 r0433203 44 44 from numpy import pi, inf 45 45 46 name = "raspberry "46 name = "raspberry_surface_fraction" 47 47 title = "Calculates the form factor, *P(q)*, for a 'Raspberry-like' structure \ 48 48 where there are smaller spheres at the surface of a larger sphere, such as the \ … … 50 50 description = """ 51 51 RaspBerryModel: 52 volf _Lsph= volume fraction large spheres53 radius_ Lsph= radius large sphere (A)54 sld_ Lsph= sld large sphere (A-2)55 volf _Ssph= volume fraction small spheres56 radius_ Ssph= radius small sphere (A)57 surf rac_Ssph= fraction of small spheres at surface58 sld_ Ssph= sld small sphere59 delta_Ssph = small sphere penetration (A)60 sld_solv = sld solvent52 volfraction_lg = volume fraction large spheres 53 radius_lg = radius large sphere (A) 54 sld_lg = sld large sphere (A-2) 55 volfraction_sm = volume fraction small spheres 56 radius_sm = radius small sphere (A) 57 surface_fraction = fraction of small spheres at surface 58 sld_sm = sld small sphere 59 penetration = small sphere penetration (A) 60 sld_solvent = sld solvent 61 61 background = background (cm-1) 62 62 Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41.""" … … 74 74 ["volfraction_sm", "", 0.005, [-inf, inf], "", 75 75 "volume fraction of small spheres"], 76 ["surf _fraction", "", 0.4, [-inf, inf], "",76 ["surface_fraction", "", 0.4, [-inf, inf], "", 77 77 "fraction of small spheres at surface"], 78 78 ["radius_lg", "Ang", 5000, [0, inf], "volume", … … 89 89 demo = dict(scale=1, background=0.001, 90 90 sld_lg=-0.4, sld_sm=3.5, sld_solvent=6.36, 91 volfraction_lg=0.05, volfraction_sm=0.005, surf _fraction=0.4,91 volfraction_lg=0.05, volfraction_sm=0.005, surface_fraction=0.4, 92 92 radius_lg=5000, radius_sm=100, penetration=0.0, 93 93 radius_lg_pd=.2, radius_lg_pd_n=10) … … 95 95 # For testing against the old sasview models, include the converted parameter 96 96 # names and the target sasview model name. 97 oldname = 'RaspBerryModel'98 oldpars = dict(sld_lg='sld_Lsph', sld_sm='sld_Ssph', sld_solvent='sld_solv',99 volfraction_lg='volf_Lsph', volfraction_sm='volf_Ssph',100 surf_fraction='surfrac_Ssph',101 radius_lg='radius_Lsph', radius_sm='radius_Ssph',102 penetration='delta_Ssph')103 104 97 105 98 # NOTE: test results taken from values returned by SasView 3.1.2, with
Note: See TracChangeset
for help on using the changeset viewer.