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/multishell.cpp

    rf9bf661 rc451be9  
    8080        double sum = 0.0; 
    8181        double norm = 0.0; 
     82        double vol = 0.0; 
    8283 
    8384        // Loop over radius weight points 
     
    8889                        for(int k=0; k< (int)weights_w_thickness.size(); k++){ 
    8990                                dp[3] = weights_w_thickness[k].value; 
    90  
     91                                //Un-normalize SphereForm by volume 
    9192                                sum += weights_core_radius[i].weight*weights_s_thickness[j].weight 
    92                                         *weights_w_thickness[k].weight* MultiShell(dp, q); 
     93                                        *weights_w_thickness[k].weight* MultiShell(dp, q) 
     94                                        *pow(weights_core_radius[i].value+dp[6]*weights_s_thickness[j].value+(dp[6]-1)*weights_w_thickness[k].value,3); 
     95                                //Find average volume 
     96                                vol += weights_core_radius[i].weight*weights_s_thickness[j].weight 
     97                                        *weights_w_thickness[k].weight 
     98                                        *pow(weights_core_radius[i].value+dp[6]*weights_s_thickness[j].value+(dp[6]-1)*weights_w_thickness[k].value,3); 
    9399                                norm += weights_core_radius[i].weight*weights_s_thickness[j].weight 
    94100                                        *weights_w_thickness[k].weight; 
     
    96102                } 
    97103        } 
     104        if (vol != 0.0 && norm != 0.0) { 
     105                //Re-normalize by avg volume 
     106                sum = sum/(vol/norm);} 
    98107        return sum/norm + background(); 
    99108} 
Note: See TracChangeset for help on using the changeset viewer.