Ignore:
Timestamp:
Jan 7, 2010 5:04:25 PM (15 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
dfa8832
Parents:
4cbaf35
Message:

corrections on the definition of polydispersity as suggested by steve K: should be normalized by average volume

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_models/coreshellsphere.cpp

    rf9bf661 rc451be9  
    7575        double sum = 0.0; 
    7676        double norm = 0.0; 
     77        double vol = 0.0; 
    7778 
    7879        // Loop over radius weight points 
     
    8384                for(int j=0; j<weights_thick.size(); j++) { 
    8485                        dp[2] = weights_thick[j].value; 
     86                        //Un-normalize SphereForm by volume 
     87                        sum += weights_rad[i].weight 
     88                                * weights_thick[j].weight * CoreShellForm(dp, q)* pow(weights_rad[i].value+weights_thick[j].value,3); 
    8589 
    86                         sum += weights_rad[i].weight 
    87                                 * weights_thick[j].weight * CoreShellForm(dp, q); 
     90                        //Find average volume 
     91                        vol += weights_rad[i].weight * weights_thick[j].weight 
     92                                * pow(weights_rad[i].value+weights_thick[j].value,3); 
    8893                        norm += weights_rad[i].weight 
    8994                                * weights_thick[j].weight; 
    9095                } 
    9196        } 
     97 
     98        if (vol != 0.0 && norm != 0.0) { 
     99                //Re-normalize by avg volume 
     100                sum = sum/(vol/norm);} 
     101 
    92102        return sum/norm + background(); 
    93103} 
Note: See TracChangeset for help on using the changeset viewer.