Changeset c915373 in sasmodels


Ignore:
Timestamp:
Aug 1, 2016 7:35:19 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
33875e3
Parents:
ec77322
Message:

polymer micelle: improve accuracy of kernel for low q

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/polymer_micelle_kernel.c

    r2c74c11 rc915373  
    3636    // Self-correlation term of the chains 
    3737    const double qrg2 = q*radius_gyr*q*radius_gyr; 
    38     const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(exp(-qrg2)-1+qrg2)/(qrg2*qrg2); 
     38    const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(expm1(-qrg2)+qrg2)/(qrg2*qrg2); 
    3939    const double term2 = n_aggreg * beta_corona * beta_corona * debye_chain; 
    4040 
    4141    // Interference cross-term between core and chains 
    42     const double chain_ampl = (qrg2 == 0.0) ? 1.0 : (1-exp(-qrg2))/qrg2; 
     42    const double chain_ampl = (qrg2 == 0.0) ? 1.0 : -expm1(-qrg2)/qrg2; 
    4343    const double bes_corona = sinc(q*(radius_core + d_penetration * radius_gyr)); 
    4444    const double term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona * 
Note: See TracChangeset for help on using the changeset viewer.