Changeset 4c42410 in sasview


Ignore:
Timestamp:
Apr 28, 2015 11:53:47 AM (10 years ago)
Author:
smk78
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:
ce62e75
Parents:
da53353
Message:

Polydispersity help removed to pd_help.rst
Smearing help removed to sm_help.rst
Magnetic help removed to mag_help.rst

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/fitting/media/fitting_help.rst

    r98b30b4 r4c42410  
    473473.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    474474 
    475 ..  _Polydispersity_Distributions: 
    476  
    477 Polydispersity Distributions 
    478 ---------------------------- 
    479  
    480 Calculates the form factor for a polydisperse and/or angular population of  
    481 particles with uniform scattering length density. The resultant form factor  
    482 is normalized by the average particle volume such that  
    483  
    484 P(q) = scale*\<F*F\>/Vol + bkg 
    485  
    486 where F is the scattering amplitude and the\<\>denote an average over the size  
    487 distribution.  Users should use PD (polydispersity: this definition is  
    488 different from the typical definition in polymer science) for a size  
    489 distribution and Sigma for an angular distribution (see below). 
    490  
    491 Note that this computation is very time intensive thus applying polydispersion/ 
    492 angular distrubtion for more than one paramters or increasing Npts values  
    493 might need extensive patience to complete the computation. Also note that  
    494 even though it is time consuming, it is safer to have larger values of Npts  
    495 and Nsigmas. 
    496  
    497 The following five distribution functions are provided 
    498  
    499 *  *Rectangular_Distribution_* 
    500 *  *Array_Distribution_* 
    501 *  *Gaussian_Distribution_* 
    502 *  *Lognormal_Distribution_* 
    503 *  *Schulz_Distribution_* 
    504  
    505 .. _Rectangular_Distribution: 
    506  
    507 Rectangular Distribution 
    508 ------------------------ 
    509  
    510 .. image:: pd_image001.png 
    511  
    512 The xmean is the mean of the distribution, w is the half-width, and Norm is a  
    513 normalization factor which is determined during the numerical calculation.  
    514 Note that the Sigma and the half width *w*  are different. 
    515  
    516 The standard deviation is 
    517  
    518 .. image:: pd_image002.png 
    519  
    520 The PD (polydispersity) is 
    521  
    522 .. image:: pd_image003.png 
    523  
    524 .. image:: pd_image004.jpg 
    525  
    526 .. _Array_Distribution: 
    527  
    528 Array Distribution 
    529 ------------------ 
    530  
    531 This distribution is to be given by users as a txt file where the array  
    532 should be defined by two columns in the order of x and f(x) values. The f(x)  
    533 will be normalized by SasView during the computation. 
    534  
    535 Example of an array in the file 
    536  
    537 30        0.1 
    538 32        0.3 
    539 35        0.4 
    540 36        0.5 
    541 37        0.6 
    542 39        0.7 
    543 41        0.9 
    544  
    545 We use only these array values in the computation, therefore the mean value  
    546 given in the control panel, for example ‘radius = 60’, will be ignored. 
    547  
    548 .. _Gaussian_Distribution: 
    549  
    550 Gaussian Distribution 
    551 --------------------- 
    552  
    553 .. image:: pd_image005.png 
    554  
    555 The xmean is the mean of the distribution and Norm is a normalization factor  
    556 which is determined during the numerical calculation. 
    557  
    558 The PD (polydispersity) is 
    559  
    560 .. image:: pd_image003.png 
    561  
    562 .. image:: pd_image006.jpg 
    563  
    564 .. _Lognormal_Distribution: 
    565  
    566 Lognormal Distribution 
    567 ---------------------- 
    568  
    569 .. image:: pd_image007.png 
    570  
    571 The /mu/=ln(xmed), xmed is the median value of the distribution, and Norm is a  
    572 normalization factor which will be determined during the numerical calculation.  
    573 The median value is the value given in the size parameter in the control panel,  
    574 for example, “radius = 60â€ᅵ. 
    575  
    576 The PD (polydispersity) is given by /sigma/ 
    577  
    578 .. image:: pd_image008.png 
    579  
    580 For the angular distribution 
    581  
    582 .. image:: pd_image009.png 
    583  
    584 The mean value is given by xmean=exp(/mu/+p2/2). The peak value is given by  
    585 xpeak=exp(/mu/-p2). 
    586  
    587 .. image:: pd_image010.jpg 
    588  
    589 This distribution function spreads more and the peak shifts to the left as the  
    590 p increases, requiring higher values of Nsigmas and Npts. 
    591  
    592 .. _Schulz_Distribution: 
    593  
    594 Schulz Distribution 
    595 ------------------- 
    596  
    597 .. image:: pd_image011.png 
    598  
    599 The xmean is the mean of the distribution and Norm is a normalization factor 
    600 which is determined during the numerical calculation. 
    601  
    602 The z = 1/p2– 1. 
    603  
    604 The PD (polydispersity) is 
    605  
    606 .. image:: pd_image012.png 
    607  
    608 Note that the higher PD (polydispersity) might need higher values of Npts and  
    609 Nsigmas. For example, at PD = 0.7 and radisus = 60 A, Npts >= 160, and  
    610 Nsigmas >= 15 at least. 
    611  
    612 .. image:: pd_image013.jpg 
    613  
    614 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    615  
    616 .. _Smearing_Computation: 
    617  
    618 Smearing Computation 
    619 -------------------- 
    620  
    621 Slit_Smearing_  
    622  
    623 Pinhole_Smearing_ 
    624  
    625 2D_Smearing_ 
    626  
    627 .. _Slit_Smearing: 
    628  
    629 Slit Smearing 
    630 ------------- 
    631  
    632 The sit smeared scattering intensity for SAS is defined by 
    633  
    634 .. image:: sm_image002.gif 
    635  
    636 where Norm = 
    637  
    638 .. image:: sm_image003.gif 
    639  
    640 Equation 1 
    641  
    642 The functions |inlineimage004| and |inlineimage005| 
    643 refer to the slit width weighting function and the slit height weighting  
    644 determined at the q point, respectively. Here, we assumes that the weighting  
    645 function is described by a rectangular function, i.e., 
    646  
    647 .. image:: sm_image006.gif 
    648  
    649 Equation 2 
    650  
    651 and 
    652  
    653 .. image:: sm_image007.gif 
    654  
    655 Equation 3 
    656  
    657 so that |inlineimage008| |inlineimage009| for |inlineimage010| and u. 
    658  
    659 The |inlineimage011| and |inlineimage012| stand for 
    660 the slit height (FWHM/2) and the slit width (FWHM/2) in the q space. Now the  
    661 integral of Equation 1 is simplified to 
    662  
    663 .. image:: sm_image013.gif 
    664  
    665 Equation 4 
    666  
    667 Numerical Implementation of Equation 4 
    668 -------------------------------------- 
    669  
    670 Case 1 
    671 ------ 
    672  
    673 For |inlineimage012| = 0 and |inlineimage011| = constant. 
    674  
    675 .. image:: sm_image016.gif 
    676  
    677 For discrete q values, at the q values from the data points and at the q  
    678 values extended up to qN= qi + |inlineimage011| the smeared  
    679 intensity can be calculated approximately 
    680  
    681 .. image:: sm_image017.gif 
    682  
    683 Equation 5 
    684  
    685 |inlineimage018| = 0 for *Is* in *j* < *i* or *j* > N-1*. 
    686  
    687 Case 2 
    688 ------ 
    689  
    690 For |inlineimage012| = constant and |inlineimage011| = 0. 
    691  
    692 Similarly to Case 1, we get 
    693  
    694 |inlineimage019| for qp= qi- |inlineimage012| and qN= qi+ |inlineimage012|. |inlineimage018| = 0 
    695 for *Is* in *j* < *p* or *j* > *N-1*. 
    696  
    697 Case 3 
    698 ------ 
    699  
    700 For |inlineimage011| = constant and  
    701 |inlineimage011| = constant. 
    702  
    703 In this case, the best way is to perform the integration, Equation 1,  
    704 numerically for both slit height and width. However, the numerical integration  
    705 is not correct enough unless given a large number of iteration, say at least  
    706 10000 by 10000 for each element of the matrix, W, which will take minutes and  
    707 minutes to finish the calculation for a set of typical SAS data. An  
    708 alternative way which is correct for slit width << slit hight, is used in  
    709 SasView. This method is a mixed method that combines method 1 with the  
    710 numerical integration for the slit width. 
    711  
    712 .. image:: sm_image020.gif 
    713  
    714 Equation 7 
    715  
    716 for qp= qi- |inlineimage012| and 
    717 qN= qi+ |inlineimage012|. |inlineimage018| = 0 for 
    718 *Is* in *j* < *p* or *j* > *N-1*. 
    719  
    720 .. _Pinhole_Smearing: 
    721  
    722 Pinhole Smearing 
    723 ---------------- 
    724  
    725 The pinhole smearing computation is done similar to the case above except  
    726 that the weight function used is the Gaussian function, so that the Equation 6  
    727 for this case becomes 
    728  
    729 .. image:: sm_image021.gif 
    730  
    731 Equation 8 
    732  
    733 For all the cases above, the weighting matrix *W* is calculated when the  
    734 smearing is called at the first time, and it includes the ~ 60 q values  
    735 (finely binned evenly) below (\>0) and above the q range of data in order  
    736 to cover all data points of the smearing computation for a given model and  
    737 for a given slit size. The *Norm*  factor is found numerically with the  
    738 weighting matrix, and considered on *Is* computation. 
    739  
    740 .. _2D_Smearing: 
    741  
    742 2D Smearing 
    743 -----------  
    744  
    745 The 2D smearing computation is done similar to the 1D pinhole smearing above  
    746 except that the weight function used was the 2D elliptical Gaussian function 
    747  
    748 .. image:: sm_image022.gif 
    749  
    750 Equation 9 
    751  
    752 In Equation 9, x0 = qcos/theta/ and y0 = qsin/theta/, and the primed axes  
    753 are in the coordinate rotated by an angle /theta/ around the z-axis (below)  
    754 so that x’0= x0cos/theta/+y0sin/theta/ and y’0= -x0sin/theta/+y0cos/theta/. 
    755  
    756 Note that the rotation angle is zero for x-y symmetric elliptical Gaussian  
    757 distribution. The A is a normalization factor. 
    758  
    759 .. image:: sm_image023.gif 
    760  
    761 Now we consider a numerical integration where each bins in /theta/ and R are  
    762 *evenly* (this is to simplify the equation below) distributed by /delta//theta/  
    763 and /delta/R, respectively, and it is assumed that I(x’, y’) is constant  
    764 within the bins which in turn becomes 
    765  
    766 .. image:: sm_image024.gif 
    767  
    768 Equation 10 
    769  
    770 Since we have found the weighting factor on each bin points, it is convenient  
    771 to transform x’-y’ back to x-y coordinate (rotating it by -/theta/ around z  
    772 axis). Then, for the polar symmetric smear 
    773  
    774 .. image:: sm_image025.gif 
    775  
    776 Equation 11 
    777  
    778 where 
    779  
    780 .. image:: sm_image026.gif 
    781  
    782 while for the x-y symmetric smear 
    783  
    784 .. image:: sm_image027.gif 
    785  
    786 Equation 12 
    787  
    788 where 
    789  
    790 .. image:: sm_image028.gif 
    791  
    792 Here, the current version of the SasView uses Equation 11 for 2D smearing  
    793 assuming that all the Gaussian weighting functions are aligned in the polar  
    794 coordinate. 
    795  
    796 In the control panel, the higher accuracy indicates more and finer binnng  
    797 points so that it costs more in time. 
    798  
    799 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    800  
    801 .. _Polarisation_Magnetic_Scattering: 
    802  
    803 Polarisation/Magnetic Scattering 
    804 -------------------------------- 
    805  
    806 Magnetic scattering is implemented in five (2D) models  
    807  
    808 *  *SphereModel* 
    809 *  *CoreShellModel* 
    810 *  *CoreMultiShellModel* 
    811 *  *CylinderModel* 
    812 *  *ParallelepipedModel* 
    813  
    814 In general, the scattering length density (SLD) in each regions where the  
    815 SLD (=/beta/) is uniform, is a combination of the nuclear and magnetic SLDs and  
    816 depends on the spin states of the neutrons as follows. For magnetic scattering,  
    817 only the magnetization component, *M*perp, perpendicular to the scattering  
    818 vector *Q* contributes to the the magnetic scattering length. 
    819  
    820 .. image:: mag_vector.bmp 
    821  
    822 The magnetic scattering length density is then 
    823  
    824 .. image:: dm_eq.gif 
    825  
    826 where /gamma/ = -1.913 the gyromagnetic ratio, /mu/B is the Bohr magneton, r0  
    827 is the classical radius of electron, and */sigma/* is the Pauli spin. For  
    828 polarised neutron, the magnetic scattering is depending on the spin states.  
    829  
    830 Let's consider that the incident neutrons are polarized parallel (+)/ 
    831 anti-parallel (-) to the x' axis (See both Figures above). The possible  
    832 out-coming states then are + and - states for both incident states 
    833  
    834 Non-spin flips: (+ +) and (- -) 
    835 Spin flips:     (+ -) and (- +) 
    836  
    837 .. image:: M_angles_pic.bmp 
    838  
    839 Now, let's assume that the angles of the *Q*  vector and the spin-axis (x')  
    840 against x-axis are /phi/ and /theta/up, respectively (See Figure above). Then,  
    841 depending upon the polarisation (spin) state of neutrons, the scattering length  
    842 densities, including the nuclear scattering length density (/beta/N) are given  
    843 as, for non-spin-flips 
    844  
    845 .. image:: sld1.gif 
    846  
    847 for spin-flips 
    848  
    849 .. image:: sld2.gif 
    850  
    851 where 
    852  
    853 .. image:: mxp.gif 
    854  
    855 .. image:: myp.gif 
    856  
    857 .. image:: mzp.gif 
    858  
    859 .. image:: mqx.gif 
    860  
    861 .. image:: mqy.gif 
    862  
    863 Here, the M0x, M0y and M0z are the x, y and z components of the magnetization  
    864 vector given in the xyz lab frame. The angles of the magnetization, /theta/M  
    865 and /phi/M as defined in the Figure (above) 
    866  
    867 .. image:: m0x_eq.gif 
    868  
    869 .. image:: m0y_eq.gif 
    870  
    871 .. image:: m0z_eq.gif 
    872  
    873 The user input parameters are M0_sld = DMM0, Up_theta = /theta/up,  
    874 M_theta = /theta/M, and M_phi = /phi/M. The 'Up_frac_i' and 'Up_frac_f' are  
    875 the ratio 
    876  
    877 (spin up)/(spin up + spin down) 
    878  
    879 neutrons before the sample and at the analyzer, respectively. 
    880  
    881 *Note:* The values of the 'Up_frac_i' and 'Up_frac_f' must be in the range 
    882 between 0 and 1. 
    883  
    884 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    885  
    886475.. _Key_Combinations: 
    887476 
Note: See TracChangeset for help on using the changeset viewer.