Changeset 0d41aeed in sasview


Ignore:
Timestamp:
Nov 24, 2014 9:35:22 AM (9 years ago)
Author:
Miguel Gonzalez <onzalezm@…>
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:
2cdcbb5
Parents:
afd42432
Message:

Added model for micelles with spherical cores (from J. Appl. Cryst. (2000) 33, 637-640). C model added to libSphere!

Location:
src/sans
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/sans/models/c_extension/libigor/libSphere.c

    r230f479 r0d41aeed  
    23302330} 
    23312331 
    2332  
     2332// Micelle with spherical core  
     2333// J.S. Pedersen, J. Appl. Cryst. 33, 637 (2000) 
     2334 
     2335double 
     2336MicelleSphericalCore(double dp[], double q) 
     2337{ 
     2338        double x, pi; 
     2339        double ndensity, v_core, v_corona, rho_solv, rho_core, rho_corona;      // local names of input params 
     2340        double radius_core, radius_gyr, d_penetration, n_aggreg, bkg, scale;    // local names of input params 
     2341        double beta_core, beta_corona, qr, qrg, qrg2, qrdrg, bes_core, bes_corona;  
     2342        double term1, term2, term3, term4, debye_chain, chain_ampl, i_micelle; 
     2343 
     2344        x = q; 
     2345         
     2346        scale = dp[0]; 
     2347        ndensity = dp[1];      // number density [1/cm^3] 
     2348        v_core = dp[2];        // volume block in core [A^3] 
     2349        v_corona = dp[3];      // volume block in corona [A^3] 
     2350        rho_solv = dp[4];      // sld of solvent [1/A^2] 
     2351        rho_core = dp[5];      // sld of core [1/A^2] 
     2352        rho_corona = dp[6];    // sld of corona [1/A^2] 
     2353        radius_core = dp[7];   // radius of core [A] 
     2354        radius_gyr = dp[8];    // radius of gyration of chains in corona [A] 
     2355        d_penetration = dp[9]; // close to unity, mimics non-penetration of gaussian chains 
     2356        n_aggreg = dp[10];     // aggregation number of the micelle 
     2357        bkg = dp[11];          // background 
     2358         
     2359        beta_core = v_core * (rho_core - rho_solv); 
     2360        beta_corona = v_corona * (rho_corona - rho_solv); 
     2361         
     2362         
     2363        // Self-correlation term of the core 
     2364 
     2365        qr = x*radius_core; 
     2366        if(qr == 0){bes_core = 1.0;} else {bes_core = 3.0*(sin(qr)-qr*cos(qr))/(qr*qr*qr);} 
     2367         
     2368        term1 = n_aggreg * n_aggreg * beta_core * beta_core * bes_core * bes_core; 
     2369 
     2370        // Self-correlation term of the chains 
     2371 
     2372        qrg = x*radius_gyr; 
     2373        qrg2 = qrg*qrg; 
     2374        if(qrg2 == 0){debye_chain = 1.0;} else {debye_chain = 2.0*(exp(-qrg2)-1+qrg2)/(qrg2*qrg2);} 
     2375         
     2376        term2 = n_aggreg * beta_corona * beta_corona * debye_chain; 
     2377 
     2378        // Interference cross-term between core and chains 
     2379 
     2380        if(qrg2 == 0){chain_ampl = 1.0;} else {chain_ampl = (1-exp(-qrg2))/qrg2;} 
     2381 
     2382        qrdrg = x * (radius_core + d_penetration * radius_gyr); 
     2383        if(qrdrg == 0){bes_corona = 1.0;} else {bes_corona = sin(qrdrg)/qrdrg;} 
     2384 
     2385        term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona * bes_core * chain_ampl * bes_corona; 
     2386 
     2387        // Interference cross-term between chains 
     2388 
     2389        term4 = n_aggreg * (n_aggreg - 1.0) * beta_corona * beta_corona * chain_ampl * chain_ampl * bes_corona * bes_corona; 
     2390 
     2391        // I(q)_micelle : Sum of 4 terms computed above 
     2392         
     2393        i_micelle = term1 + term2 + term3 + term4 ;  
     2394 
     2395        // rescale from [A^2] to [cm^2] 
     2396         
     2397        i_micelle *= 1.0e-16; 
     2398 
     2399        // "normalize" by number density --> intensity in [cm-1] 
     2400         
     2401        i_micelle *= ndensity; 
     2402         
     2403        //scale if desired 
     2404        i_micelle *= scale; 
     2405 
     2406        // add in the background 
     2407        i_micelle += bkg; 
     2408         
     2409        return(i_micelle); 
     2410         
     2411} 
     2412 
  • src/sans/models/c_extension/libigor/libSphere.h

    r230f479 r0d41aeed  
    3434double SC_ParaCrystal(double dp[], double q); 
    3535double FuzzySpheres(double dp[], double q); 
     36double MicelleSphericalCore(double dp[], double q); 
    3637 
    3738//function prototypes 
  • src/sans/perspectives/fitting/models.py

    r02cc1ea r0d41aeed  
    718718        self.multiplication_factor.append(RectangularHollowPrismModel) 
    719719        self.model_name_list.append(RectangularHollowPrismModel.__name__) 
     720 
     721        from sans.models.MySphereModel import MySphereModel 
     722        self.model_dictionary[MySphereModel.__name__] = MySphereModel 
     723#        self.shape_list.append(MySphereModel) 
     724        self.multiplication_factor.append(MySphereModel) 
     725        self.model_name_list.append(MySphereModel.__name__) 
     726 
     727        from sans.models.MicelleSphCoreModel import MicelleSphCoreModel 
     728        self.model_dictionary[MicelleSphCoreModel.__name__] = MicelleSphCoreModel 
     729#        self.shape_list.append(MicelleSphCoreModel) 
     730        self.multiplication_factor.append(MicelleSphCoreModel) 
     731        self.model_name_list.append(MicelleSphCoreModel.__name__) 
     732 
    720733 
    721734        #from sans.models.FractalO_Z import FractalO_Z 
Note: See TracChangeset for help on using the changeset viewer.