Changeset 9aa4881 in sasmodels


Ignore:
Timestamp:
Oct 17, 2016 11:46:14 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
92ce163
Parents:
f719764
Message:

fix error introduced with sas_J1c() usage 'correction'; accidentally introduced a factor of 4 error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_cylinder.c

    r5bddd89 r9aa4881  
    55    double radius, double thickness, double length, double theta, double phi); 
    66 
    7 // twovd = 2 * volume * delta_rho 
     7// vd = volume * delta_rho 
    88// besarg = q * R * sin(alpha) 
    99// siarg = q * L/2 * cos(alpha) 
    10 double _cyl(double twovd, double besarg, double siarg); 
    11 double _cyl(double twovd, double besarg, double siarg) 
     10double _cyl(double vd, double besarg, double siarg); 
     11double _cyl(double vd, double besarg, double siarg) 
    1212{ 
    13     return twovd * sinc(siarg) * sas_J1c(besarg); 
     13    return vd * sinc(siarg) * sas_J1c(besarg); 
    1414} 
    1515 
     
    3030    const double core_qr = q*radius; 
    3131    const double core_qh = q*0.5*length; 
    32     const double core_twovd = 2.0 * form_volume(radius,0,length) 
    33                             * (core_sld-shell_sld); 
     32    const double core_vd = form_volume(radius,0,length) * (core_sld-shell_sld); 
    3433    const double shell_qr = q*(radius + thickness); 
    3534    const double shell_qh = q*(0.5*length + thickness); 
    36     const double shell_twovd = 2.0 * form_volume(radius,thickness,length) 
    37                              * (shell_sld-solvent_sld); 
     35    const double shell_vd = form_volume(radius,thickness,length) * (shell_sld-solvent_sld); 
    3836    double total = 0.0; 
    3937    // double lower=0, upper=M_PI_2; 
     
    4442        const double alpha = 0.5*(Gauss76Z[i]*M_PI_2 + M_PI_2); 
    4543        SINCOS(alpha, sn, cn); 
    46         const double fq = _cyl(core_twovd, core_qr*sn, core_qh*cn) 
    47             + _cyl(shell_twovd, shell_qr*sn, shell_qh*cn); 
     44        const double fq = _cyl(core_vd, core_qr*sn, core_qh*cn) 
     45            + _cyl(shell_vd, shell_qr*sn, shell_qh*cn); 
    4846        total += Gauss76Wt[i] * fq * fq * sn; 
    4947    } 
     
    6967    const double core_qr = q*radius; 
    7068    const double core_qh = q*0.5*length; 
    71     const double core_twovd = 2.0 * form_volume(radius,0,length) 
    72                             * (core_sld-shell_sld); 
     69    const double core_vd = form_volume(radius,0,length) * (core_sld-shell_sld); 
    7370    const double shell_qr = q*(radius + thickness); 
    7471    const double shell_qh = q*(0.5*length + thickness); 
    75     const double shell_twovd = 2.0 * form_volume(radius,thickness,length) 
    76                              * (shell_sld-solvent_sld); 
     72    const double shell_vd = form_volume(radius,thickness,length) * (shell_sld-solvent_sld); 
    7773 
    78     const double fq = _cyl(core_twovd, core_qr*sin_alpha, core_qh*cos_alpha) 
    79         + _cyl(shell_twovd, shell_qr*sin_alpha, shell_qh*cos_alpha); 
     74    const double fq = _cyl(core_vd, core_qr*sin_alpha, core_qh*cos_alpha) 
     75        + _cyl(shell_vd, shell_qr*sin_alpha, shell_qh*cos_alpha); 
    8076    return 1.0e-4 * fq * fq; 
    8177} 
Note: See TracChangeset for help on using the changeset viewer.