Changeset 38d4102 in sasview for src


Ignore:
Timestamp:
Apr 5, 2014 11:18:12 AM (11 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:
2380663
Parents:
164d64f
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/models/media/model_functions.rst

    r1c03e14 r38d4102  
    3535.. |bigdelta| unicode:: U+0394 
    3636.. |biggamma| unicode:: U+0393 
     37.. |bigpsi| unicode:: U+03A8 
    3738 
    3839.. |drho| replace:: |bigdelta|\ |rho| 
     
    164165- CylinderModel_ (including magnetic 2D version) 
    165166- HollowCylinderModel_ 
    166 - CappedCylinderModel 
    167 - CoreShellCylinderModel 
    168 - EllipticalCylinderModel 
     167- CappedCylinderModel_ 
     168- CoreShellCylinderModel_ 
     169- EllipticalCylinderModel_ 
    169170- FlexibleCylinderModel 
    170171- FlexCylEllipXModel 
     
    12401241and the 1D scattering intensity use the c-library from NIST. 
    12411242 
    1242 *2.1.14.1. Validation of the CylinderModel* 
     1243*2.1.14.2. Validation of the CylinderModel* 
    12431244 
    12441245Validation of our code was done by comparing the output of the 1D model to the output of the software provided by the 
     
    12471248.. image:: img/image065.JPG 
    12481249 
    1249 Figure 3: Comparison of the SasView scattering intensity for a cylinder with the output of the NIST SANS analysis 
    1250 software. The parameters were set to: *Scale* = 1.0, *Radius* = 20 |Ang|, *Length* = 400 |Ang|, 
     1250*Figure 3: Comparison of the SasView scattering intensity for a cylinder with the output of the NIST SANS analysis* 
     1251*software.* The parameters were set to: *Scale* = 1.0, *Radius* = 20 |Ang|, *Length* = 400 |Ang|, 
    12511252*Contrast* = 3e-6 |Ang^-2|, and *Background* = 0.01 |cm^-1|. 
    12521253 
     
    12621263.. image:: img/image066.JPG 
    12631264 
    1264 Figure 4: Comparison of the intensity for uniformly distributed cylinders calculated from our 2D model and the intensity 
    1265 from the NIST SANS analysis software. The parameters used were: *Scale* = 1.0, *Radius* = 20 |Ang|, *Length* = 400 |Ang|, 
    1266 *Contrast* = 3e-6 |Ang^-2|, and *Background* = 0.0 |cm^-1|. 
     1265*Figure 4: Comparison of the intensity for uniformly distributed cylinders calculated from our 2D model and the* 
     1266*intensity from the NIST SANS analysis software.* The parameters used were: *Scale* = 1.0, *Radius* = 20 |Ang|, 
     1267*Length* = 400 |Ang|, *Contrast* = 3e-6 |Ang^-2|, and *Background* = 0.0 |cm^-1|. 
    12671268 
    12681269 
     
    12801281 
    12811282The inside and outside of the hollow cylinder are assumed have the same SLD. 
     1283 
     1284*2.1.15.1 Definition* 
    12821285 
    12831286The 1D scattering intensity is calculated in the following way (Guinier, 1955) 
     
    13171320.. image:: img/image061.JPG 
    13181321 
    1319  
    1320 Figure. Definition of the angles for the oriented HollowCylinderModel. 
    1321  
    1322  
    1323  
    1324 Figure. Examples of the angles for oriented pp against the detector 
    1325 plane. 
     1322*Figure. Definition of the angles for the oriented HollowCylinderModel.* 
     1323 
     1324.. image:: img/image062.JPG 
     1325 
     1326*Figure. Examples of the angles for oriented pp against the detector plane.* 
    13261327 
    13271328REFERENCE 
    1328  
    1329 Feigin, L. A, and D. I. Svergun, "Structure Analysis by Small-Angle 
    1330 X-Ray and Neutron Scattering", Plenum Press, New York, (1987). 
     1329L. A. Feigin and D. I. Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, Plenum Press, 
     1330New York, (1987) 
    13311331 
    13321332 
     
    13361336**2.1.16 CappedCylinderModel** 
    13371337 
    1338 Calculates the scattering from a cylinder with spherical section end- 
    1339 caps(This model simply becomes the ConvexLensModel when the length of 
    1340 the cylinder L = 0. That is, a sphereocylinder with end caps that have 
    1341 a radius larger than that of the cylinder and the center of the end 
    1342 cap radius lies within the cylinder. See the diagram for the details 
     1338Calculates the scattering from a cylinder with spherical section end-caps. This model simply becomes the ConvexLensModel 
     1339when the length of the cylinder *L* = 0, that is, a sphereocylinder with end caps that have a radius larger than that 
     1340of the cylinder and the center of the end cap radius lies within the cylinder. See the diagram for the details 
    13431341of the geometry and restrictions on parameter values. 
    13441342 
    1345  
    1346  
    1347 *1.1. Definition* 
     1343*2.1.16.1. Definition* 
    13481344 
    13491345The returned value is scaled to units of [|cm^-1|\ |sr^-1|, absolute scale. 
    13501346 
    1351 The Capped Cylinder geometry is defined as: 
    1352  
    1353  
    1354  
    1355 r is the radius of the cylinder. All other parameters are as defined 
    1356 in the diagram. Since the end cap radius R >= r and by definition for 
    1357 this geometry h < 0, h is then defined by r and R as: 
    1358  
    1359 h = -1*sqrt(R^2 - r^2). 
    1360  
    1361 The scattering intensity I(q) is calculated as: 
    1362  
    1363  
    1364  
    1365 where the amplitude A(q) is given as: 
    1366  
    1367  
    1368  
    1369 The < > brackets denote an average of the structure over all 
    1370 orientations. <A^2(q)> is then the form factor, P(q). The scale factor 
    1371 is equivalent to the volume fraction of cylinders, each of volume, V. 
    1372 Contrast is the difference of scattering length densities of the 
    1373 cylinder and the surrounding solvent. 
    1374  
    1375 The volume of the Capped Cylinder is: 
    1376  
    1377 (with h as a positive value here) 
    1378  
    1379  
    1380  
    1381 and its radius of gyration: 
    1382  
    1383  
    1384  
    1385 The necessary conditions of R >= r is not enforced in the model. It is 
    1386 up to you to restrict this during analysis. 
    1387  
    1388 REFERENCES 
    1389  
    1390 H. Kaya, J. Appl. Cryst. (2004) 37, 223-230. 
    1391  
    1392 H. Kaya and N-R deSouza, J. Appl. Cryst. (2004) 37, 508-509. (addenda 
    1393 and errata) 
    1394  
    1395 TEST DATASET 
    1396  
    1397 This example dataset is produced by running the Macro 
    1398 CappedCylinder(), using 200 data points, *qmin* = 0.001 -1, *qmax* = 0.7 
    1399 -1 and the above default values. 
     1347The Capped Cylinder geometry is defined as 
     1348 
     1349.. image:: img/image112.JPG 
     1350 
     1351where *r* is the radius of the cylinder. All other parameters are as defined in the diagram. Since the end cap radius 
     1352*R* >= *r* and by definition for this geometry *h* < 0, *h* is then defined by *r* and *R* as 
     1353 
     1354*h* = -1 \* sqrt(*R*\ :sup:`2` - *r*\ :sup:`2`) 
     1355 
     1356The scattered intensity *I(q)* is calculated as 
     1357 
     1358.. image:: img/image113.JPG 
     1359 
     1360where the amplitude *A(q)* is given as 
     1361 
     1362.. image:: img/image114.JPG 
     1363 
     1364The < > brackets denote an average of the structure over all orientations. <\ *A*\ :sup:`2`\ *(q)*> is then the form 
     1365factor, *P(q)*. The scale factor is equivalent to the volume fraction of cylinders, each of volume, *V*. Contrast is the 
     1366difference of scattering length densities of the cylinder and the surrounding solvent. 
     1367 
     1368The volume of the Capped Cylinder is (with *h* as a positive value here) 
     1369 
     1370.. image:: img/image115.JPG 
     1371 
     1372and its radius of gyration 
     1373 
     1374.. image:: img/image116.JPG 
     1375 
     1376**The requirement that** *R* >= *r* **is not enforced in the model! It is up to you to restrict this during analysis.** 
     1377 
     1378This following example dataset is produced by running the MacroCappedCylinder(), using 200 data points, 
     1379*qmin* = 0.001 |Ang^-1|, *qmax* = 0.7 |Ang^-1| and the default values 
    14001380 
    14011381==============  ========  ============= 
     
    14111391==============  ========  ============= 
    14121392 
    1413  
    1414  
     1393.. image:: img/image117.JPG 
    14151394 
    14161395*Figure. 1D plot using the default values (w/256 data point).* 
    14171396 
    1418 For 2D data: The 2D scattering intensity is calculated similar to the 
    1419 2D cylinder model. At the theta = 45 deg and phi =0 deg with default 
    1420 values for other parameters, 
    1421  
    1422  
     1397For 2D data: The 2D scattering intensity is calculated similar to the 2D cylinder model. For example, for 
     1398|theta| = 45 deg and |phi| =0 deg with default values for other parameters 
     1399 
     1400.. image:: img/image118.JPG 
    14231401 
    14241402*Figure. 2D plot (w/(256X265) data points).* 
    14251403 
    1426  
    1427  
    1428 Figure. Definition of the angles for oriented 2D cylinders. 
    1429  
    1430  
    1431  
    1432 Figure. Examples of the angles for oriented pp against the detector 
    1433 plane. 
     1404.. image:: img/image061.JPG 
     1405 
     1406*Figure. Definition of the angles for oriented 2D cylinders.* 
     1407 
     1408.. image:: img/image062.jpg 
     1409 
     1410*Figure. Examples of the angles for oriented pp against the detector plane.* 
     1411 
     1412REFERENCE 
     1413H. Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230 
     1414H. Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda and errata) 
    14341415 
    14351416 
     
    14371418.. _CoreShellCylinderModel: 
    14381419 
    1439 **2.1.17. CoreShellCylinderModel*** 
    1440  
    1441 This model provides the form factor for a circular cylinder with a 
    1442 core-shell scattering length density profile. The form factor is 
    1443 normalized by the particle volume. 
    1444  
    1445 *1.1. Definition* 
    1446  
    1447 The output of the 2D scattering intensity function for oriented core- 
    1448 shell cylinders is given by (Kline, 2006): 
    1449  
    1450  
    1451  
    1452  
    1453  
    1454  
    1455  
    1456 where is the angle between the axis of the cylinder and the q-vector, 
    1457 *Vs* is the volume of the outer shell (i.e. the total volume, 
    1458 including the shell), *Vc* is the volume of the core, *L* is the 
    1459 length of the core, *r* is the radius of the core, *t* is the 
    1460 thickness of the shell, *c* is the scattering length density of the 
    1461 core, *s* is the scattering length density of the shell, solv is the 
    1462 scattering length density of the solvent, and *bkg* is the background 
    1463 level. The outer radius of the shell is given by *r+t* and the total 
    1464 length of the outer shell is given by *L+2t*. J1 is the first order 
    1465 Bessel function. 
    1466  
    1467  
    1468  
    1469 To provide easy access to the orientation of the core-shell cylinder, 
    1470 we define the axis of the cylinder using two angles and . Similarly to 
    1471 the case of the cylinder, those angles are defined on Figure 2 in 
    1472 Cylinder Model. 
    1473  
    1474 For P*S: The 2nd virial coefficient of the solid cylinder is calculate 
    1475 based on the (radius+thickness) and 2(length +thickness) values, and 
    1476 used as the effective radius toward S(Q) when P(Q)*S(Q) is applied. 
    1477  
    1478 The returned value is scaled to units of |cm^-1| and the parameters of 
    1479 the core-shell cylinder model are the following: 
     1420**2.1.17. CoreShellCylinderModel** 
     1421 
     1422This model provides the form factor for a circular cylinder with a core-shell scattering length density profile. The 
     1423form factor is normalized by the particle volume. 
     1424 
     1425*2.1.17.1. Definition* 
     1426 
     1427The output of the 2D scattering intensity function for oriented core-shell cylinders is given by (Kline, 2006) 
     1428 
     1429.. image:: img/image067.PNG 
     1430 
     1431where 
     1432 
     1433.. image:: img/image068.PNG 
     1434 
     1435.. image:: img/image239.PNG 
     1436 
     1437and |alpha| is the angle between the axis of the cylinder and the *q*\ -vector, *Vs* is the volume of the outer shell 
     1438(i.e. the total volume, including the shell), *Vc* is the volume of the core, *L* is the length of the core, *r* is the 
     1439radius of the core, *t* is the thickness of the shell, |rho|\ :sub:`c` is the scattering length density of the core, 
     1440|rho|\ :sub:`s` is the scattering length density of the shell, |rho|\ :sub:`solv` is the scattering length density of 
     1441the solvent, and *bkg* is the background level. The outer radius of the shell is given by *r+t* and the total length of 
     1442the outer shell is given by *L+2t*. *J1* is the first order Bessel function. 
     1443 
     1444.. image:: img/image069.JPG 
     1445 
     1446To provide easy access to the orientation of the core-shell cylinder, we define the axis of the cylinder using two 
     1447angles |theta| and |phi|\ . As for the case of the cylinder, those angles are defined in Figure 2 of the CylinderModel. 
     1448 
     1449NB: The 2nd virial coefficient of the cylinder is calculated based on the radius and 2 length values, and used as the 
     1450effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied. 
     1451 
     1452The returned value is scaled to units of |cm^-1| and the parameters of the core-shell cylinder model are the following 
    14801453 
    14811454==============  ========  ============= 
     
    14941467==============  ========  ============= 
    14951468 
    1496 The output of the 1D scattering intensity function for randomly 
    1497 oriented cylinders is then given by the equation above. 
    1498  
    1499 The *axis_theta* and axis *_phi* parameters are not used for the 1D 
    1500 output. Our implementation of the scattering kernel and the 1D 
    1501 scattering intensity use the c-library from NIST. 
    1502  
    1503 *2.1. Validation of the core-shell cylinder model* 
    1504  
    1505 Validation of our code was done by comparing the output of the 1D 
    1506 model to the output of the software provided by the NIST (Kline, 
    1507 2006). Figure 8 shows a comparison of the 1D output of our model and 
    1508 the output of the NIST software. 
    1509  
    1510 Averaging over a distribution of orientation is done by evaluating the 
    1511 equation above. Since we have no other software to compare the 
    1512 implementation of the intensity for fully oriented core-shell 
    1513 cylinders, we can compare the result of averaging our 2D output using 
    1514 a uniform distribution *p(,* *)* = 1.0. Figure 9 shows the result of 
    1515 such a cross-check. 
    1516  
    1517  
    1518  
    1519  
    1520  
    1521 Figure 8: Comparison of the SasView scattering intensity for a core- 
    1522 shell cylinder with the output of the NIST SANS analysis software. The 
    1523 parameters were set to: Scale=1.0, Radius=20 , Thickness=10 , 
    1524 Length=400 , Core_sld=1e-6 -2, Shell_sld=4e-6 -2, Solvent_sld=1e-6 -2, 
    1525 and Background=0.01 |cm^-1|. 
    1526  
    1527  
    1528  
    1529  
    1530  
    1531  
    1532  
    1533 Figure 9: Comparison of the intensity for uniformly distributed core- 
    1534 shell cylinders calculated from our 2D model and the intensity from 
    1535 the NIST SANS analysis software. The parameters used were: Scale=1.0, 
    1536 Radius=20 , Thickness=10 , Length=400 , Core_sld=1e-6 -2, 
    1537 Shell_sld=4e-6 -2, Solvent_sld=1e-6 -2, and Background=0.0 |cm^-1|. 
    1538  
    1539  
    1540  
    1541 Figure. Definition of the angles for oriented core-shell cylinders. 
    1542  
    1543  
    1544  
    1545 Figure. Examples of the angles for oriented pp against the detector 
    1546 plane. 
     1469The output of the 1D scattering intensity function for randomly oriented cylinders is then given by the equation above. 
     1470 
     1471The *axis_theta* and *axis_phi* parameters are not used for the 1D output. Our implementation of the scattering kernel 
     1472and the 1D scattering intensity use the c-library from NIST. 
     1473 
     1474*2.1.17.2. Validation of the CoreShellCylinderModel* 
     1475 
     1476Validation of our code was done by comparing the output of the 1D model to the output of the software provided by the 
     1477NIST (Kline, 2006). Figure 1 shows a comparison of the 1D output of our model and the output of the NIST software. 
     1478 
     1479.. image:: img/image070.JPG 
     1480 
     1481*Figure 1: Comparison of the SasView scattering intensity for a core-shell cylinder with the output of the NIST SANS* 
     1482*analysis software.* The parameters were set to: *Scale* = 1.0, *Radius* = 20 |Ang|, *Thickness* = 10 |Ang|, 
     1483*Length* = 400 |Ang|, *Core_sld* = 1e-6 |Ang^-2|, *Shell_sld* = 4e-6 |Ang^-2|, *Solvent_sld* = 1e-6 |Ang^-2|, 
     1484and *Background* = 0.01 |cm^-1|. 
     1485 
     1486Averaging over a distribution of orientation is done by evaluating the equation above. Since we have no other software 
     1487to compare the implementation of the intensity for fully oriented cylinders, we can compare the result of averaging our 
     14882D output using a uniform distribution *p(*\ |theta|,\ |phi|\ *)* = 1.0. Figure 2 shows the result of such a cross-check. 
     1489 
     1490.. image:: img/image071.JPG 
     1491 
     1492*Figure 2: Comparison of the intensity for uniformly distributed core-shell cylinders calculated from our 2D model and* 
     1493*the intensity from the NIST SANS analysis software.* The parameters used were: *Scale* = 1.0, *Radius* = 20 |Ang|, 
     1494*Thickness* = 10 |Ang|, *Length* =400 |Ang|, *Core_sld* = 1e-6 |Ang^-2|, *Shell_sld* = 4e-6 |Ang^-2|, 
     1495*Solvent_sld* = 1e-6 |Ang^-2|, and *Background* = 0.0 |cm^-1|. 
     1496 
     1497.. image:: img/image061.JPG 
     1498 
     1499*Figure. Definition of the angles for oriented core-shell cylinders.* 
     1500 
     1501.. image:: img/image062.JPG 
     1502 
     1503*Figure. Examples of the angles for oriented pp against the detector plane.* 
    15471504 
    154815052013/11/26 - Description reviewed by Heenan, R. 
     
    15541511**2.1.18 EllipticalCylinderModel** 
    15551512 
    1556 This function calculates the scattering from an oriented elliptical 
    1557 cylinder. 
    1558  
    1559 *For 2D (orientated system):* 
    1560  
    1561 The angles theta and phi define the orientation of the axis of the 
    1562 cylinder. The angle psi is defined as the orientation of the major 
    1563 axis of the ellipse with respect to the vector Q. A gaussian 
    1564 poydispersity can be added to any of the orientation angles, and also 
    1565 for the minor radius and the ratio of the ellipse radii. 
    1566  
    1567  
    1568  
    1569 *Figure. a= r_minor and * *n= r_ratio (i.e., r_major/r_minor).* 
    1570  
    1571 The function calculated is: 
    1572  
    1573  
    1574  
    1575 with the functions: 
    1576  
    1577  
    1578  
    1579  
    1580  
    1581  
    1582  
    1583 and the angle psi is defined as the orientation of the major axis of 
    1584 the ellipse with respect to the vector Q. 
    1585  
    1586 *For 1D (no preferred orientation):* 
    1587  
    1588 The form factor is averaged over all possible orientation before 
    1589 normalized by the particle volume: P(q) = scale*<f^2>/V . 
     1513This function calculates the scattering from an elliptical cylinder. 
     1514 
     1515*2.1.18.1 Definition for 2D (orientated system)* 
     1516 
     1517The angles |theta| and |phi| define the orientation of the axis of the cylinder. The angle |bigpsi| is defined as the 
     1518orientation of the major axis of the ellipse with respect to the vector *Q*\ . A gaussian polydispersity can be added 
     1519to any of the orientation angles, and also for the minor radius and the ratio of the ellipse radii. 
     1520 
     1521.. image:: img/image098.gif 
     1522 
     1523*Figure.* *a* = *r_minor* and |nu|\ :sub:`n` = *r_ratio* (i.e., *r_major* / *r_minor*). 
     1524 
     1525The function calculated is 
     1526 
     1527.. image:: img/image099.PNG 
     1528 
     1529with the functions 
     1530 
     1531.. image:: img/image100.PNG 
     1532 
     1533and the angle |bigpsi| is defined as the orientation of the major axis of the ellipse with respect to the vector *q*\ . 
     1534 
     1535*2.1.18.2 Definition for 1D (no preferred orientation)* 
     1536 
     1537The form factor is averaged over all possible orientation before normalized by the particle volume 
     1538 
     1539*P(q)* = *scale* \* <*F*\ :sup:`2`> / *V* 
    15901540 
    15911541The returned value is scaled to units of |cm^-1|. 
    15921542 
    1593 To provide easy access to the orientation of the elliptical, we define 
    1594 the axis of the cylinder using two angles , andY. Similarly to the 
    1595 case of the cylinder, those angles, and , are defined on Figure 2 of 
    1596 CylinderModel. The angle Y is the rotational angle around its own 
    1597 long_c axis against the q plane. For example, Y = 0 when the r_minor 
    1598 axis is parallel to the x-axis of the detector. 
    1599  
    1600 All angle parameters are valid and given only for 2D calculation 
    1601 (Oriented system). 
    1602  
    1603  
    1604  
    1605 *Figure. Definition of angels for 2D*. 
    1606  
    1607  
    1608  
    1609 Figure. Examples of the angles for oriented elliptical cylinders 
    1610  
    1611 against the detector plane. 
    1612  
    1613 *For P*S*: The 2nd virial coefficient of the solid cylinder is 
    1614 calculate based on the averaged radius (=sqrt(r_minor^2*r_ratio)) and 
    1615 length values, and used as the effective radius toward S(Q) when 
    1616 P(Q)*S(Q) is applied. 
     1543To provide easy access to the orientation of the elliptical cylinder, we define the axis of the cylinder using two 
     1544angles |theta|, |phi| and |bigpsi|. As for the case of the cylinder, the angles |theta| and |phi| are defined on 
     1545Figure 2 of CylinderModel. The angle |bigpsi| is the rotational angle around its own long_c axis against the *q* plane. 
     1546For example, |bigpsi| = 0 when the *r_minor* axis is parallel to the *x*\ -axis of the detector. 
     1547 
     1548All angle parameters are valid and given only for 2D calculation; ie, an oriented system. 
     1549 
     1550.. image:: img/image101.JPG 
     1551 
     1552*Figure. Definition of angles for 2D* 
     1553 
     1554.. image:: img/image062.JPG 
     1555 
     1556*Figure. Examples of the angles for oriented elliptical cylinders against the detector plane.* 
     1557 
     1558NB: The 2nd virial coefficient of the cylinder is calculated based on the averaged radius (= sqrt(*r_minor*\ :sup:`2` \* *r_ratio*)) 
     1559and length values, and used as the effective radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied. 
    16171560 
    16181561==============  ========  ============= 
     
    16281571==============  ========  ============= 
    16291572 
    1630  
     1573.. image:: img/image102.JPG 
    16311574 
    16321575*Figure. 1D plot using the default values (w/1000 data point).* 
    16331576 
    1634 *Validation of the elliptical cylinder 2D model* 
    1635  
    1636 Validation of our code was done by comparing the output of the 1D 
    1637 calculation to the angular average of the output of 2 D calculation 
    1638 over all possible angles. The Figure below shows the comparison where 
    1639 the solid dot refers to averaged 2D while the line represents the 
    1640 result of 1D calculation (for 2D averaging, 76, 180, 76 points are 
    1641 taken for the angles of theta, phi, and psi respectively). 
    1642  
    1643  
     1577*2.1.18.3 Validation of the EllipticalCylinderModel* 
     1578 
     1579Validation of our code was done by comparing the output of the 1D calculation to the angular average of the output of 
     1580the 2D calculation over all possible angles. The figure below shows the comparison where the solid dot refers to 
     1581averaged 2D values while the line represents the result of the 1D calculation (for the 2D averaging, values of 76, 180, 
     1582and 76 degrees are taken for the angles of |theta|, |phi|, and |bigpsi| respectively). 
     1583 
     1584.. image:: img/image103.GIF 
    16441585 
    16451586*Figure. Comparison between 1D and averaged 2D.* 
    16461587 
    1647  
    1648  
    1649 In the 2D average, more binning in the angle phi is necessary to get 
    1650 the proper result. The following figure shows the results of the 
    1651 averaging by varying the number of bin over angles. 
    1652  
    1653  
     1588In the 2D average, more binning in the angle |phi| is necessary to get the proper result. The following figure shows 
     1589the results of the averaging by varying the number of angular bins. 
     1590 
     1591.. image:: img/image104.GIF 
    16541592 
    16551593*Figure. The intensities averaged from 2D over different numbers of bins and angles.* 
    16561594 
    16571595REFERENCE 
    1658  
    1659 L. A. Feigin and D. I. Svergun Structure Analysis by Small-Angle X-Ray 
    1660 and Neutron Scattering, Plenum, New York, (1987). 
     1596L. A. Feigin and D. I. Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, Plenum, 
     1597New York, (1987) 
    16611598 
    16621599 
     
    16661603**2.1.19. FlexibleCylinderModel** 
    16671604 
    1668 This model provides the form factor, *P(q)*, for a flexible cylinder 
    1669 where the form factor is normalized by the volume of the cylinder: 
    1670 Inter-cylinder interactions are NOT included. P(q) = 
    1671 scale*<f^2>/V+background where the averaging < > is applied over all 
    1672 orientation for 1D. The 2D scattering intensity is the same as 1D, 
    1673 regardless of the orientation of the *q* vector which is defined as . 
    1674  
    1675  
    1676  
    1677 The chain of contour length, L, (the total length) can be described a 
    1678 chain of some number of locally stiff segments of length lp. The 
    1679 persistence length,lp, is the length along the cylinder over which the 
    1680 flexible cylinder can be considered a rigid rod. The Kuhn length (b = 
    1681 2*lp) is also used to describe the stiffness of a chain. The returned 
    1682 value is in units of |cm^-1|, on absolute scale. In the parameters, the 
    1683 sldCyl and sldSolv represent SLD (chain/cylinder) and SLD (solvent) 
    1684 respectively. 
     1605This model provides the form factor, *P(q)*, for a flexible cylinder where the form factor is normalized by the volume 
     1606of the cylinder. **Inter-cylinder interactions are NOT provided for.** 
     1607 
     1608*P(q)* = *scale* \* <*F*\ :sup:`2`> / *V* + *background* 
     1609 
     1610where the averaging < > is applied over all orientations for 1D. 
     1611 
     1612The 2D scattering intensity is the same as 1D, regardless of the orientation of the *q* vector which is defined as 
     1613 
     1614.. image:: img/image040.gif 
     1615 
     1616*2.1.19.1. Definition* 
     1617 
     1618.. image:: img/image075.JPG 
     1619 
     1620The chain of contour length, *L*, (the total length) can be described as a chain of some number of locally stiff 
     1621segments of length *l*\ :sub:`p`\ , the persistence length (the length along the cylinder over which the flexible 
     1622cylinder can be considered a rigid rod). The Kuhn length (*b* = 2 \* *l* :sub:`p`) is also used to describe the 
     1623stiffness of a chain. 
     1624 
     1625The returned value is in units of |cm^-1|, on absolute scale. 
     1626 
     1627In the parameters, the sldCyl and sldSolv represent the SLD of the chain/cylinder and solvent respectively. 
    16851628 
    16861629==============  ========  ============= 
     
    16961639==============  ========  ============= 
    16971640 
    1698  
     1641.. image:: img/image076.JPG 
    16991642 
    17001643*Figure. 1D plot using the default values (w/1000 data point).* 
    17011644 
    1702 Our model uses the form factor calculations implemented in a c-library 
    1703 provided by the NIST Center for Neutron Research (Kline, 2006): 
    1704  
    1705 From the reference, "Method 3 With Excluded Volume" is used. The model 
    1706 is a parametrization of simulations of a discrete representation of 
    1707 the worm-like chain model of Kratky and Porod applied in the 
    1708 pseudocontinuous limit. See equations (13,26-27) in the original 
    1709 reference for the details. 
     1645Our model uses the form factor calculations implemented in a c-library provided by the NIST Center for Neutron Research 
     1646(Kline, 2006). 
     1647 
     1648From the reference 
     1649 
     1650  "Method 3 With Excluded Volume" is used. The model is a parametrization of simulations of a discrete representation 
     1651  of the worm-like chain model of Kratky and Porod applied in the pseudocontinuous limit. See equations (13,26-27) in 
     1652  the original reference for the details. 
    17101653 
    17111654REFERENCE 
    1712  
    1713 Pedersen, J. S. and P. Schurtenberger (1996). Scattering functions of 
    1714 semiflexible polymers with and without excluded volume effects. 
    1715 Macromolecules 29: 7602-7612. 
    1716  
    1717 Correction of the formula can be found in: 
    1718  
    1719 Wei-Ren Chen, Paul D. Butler, and Linda J. Magid, "Incorporating 
    1720 Intermicellar Interactions in the Fitting of SANS Data from Cationic 
    1721 Wormlike Micelles" Langmuir, August 2006. 
     1655J. S. Pedersen and P. Schurtenberger. *Scattering functions of semiflexible polymers with and without excluded volume* 
     1656*effects*. *Macromolecules*, 29 (1996) 7602-7612 
     1657 
     1658Correction of the formula can be found in 
     1659W-R Chen, P. D. Butler and L. J. Magid, *Incorporating Intermicellar Interactions in the Fitting of SANS Data from* 
     1660*Cationic Wormlike Micelles*. *Langmuir*, 22(15) 2006 6539–6548 
    17221661 
    17231662 
     
    17271666**2.1.20 FlexCylEllipXModel** 
    17281667 
    1729 *Flexible Cylinder with Elliptical Cross-Section:* Calculates the 
    1730 form factor for a flexible cylinder with an elliptical cross section 
    1731 and a uniform scattering length density. The non-negligible diameter 
    1732 of the cylinder is included by accounting for excluded volume 
    1733 interactions within the walk of a single cylinder. The form factor is 
    1734 normalized by the particle volume such that P(q) = scale\*<f^2>/Vol + 
    1735 bkg, where < > is an average over all possible orientations of the 
    1736 flexible cylinder. 
    1737  
    1738 *1.1. Definition* 
    1739  
    1740 The function calculated is from the reference given below. From that 
    1741 paper, "Method 3 With Excluded Volume" is used. The model is a 
    1742 parameterization of simulations of a discrete representation of the 
    1743 worm-like chain model of Kratky and Porod applied in the pseudo- 
    1744 continuous limit. See equations (13, 26-27) in the original reference 
    1745 for the details. 
    1746  
    1747 NB: there are several typos in the original reference that have been 
    1748 corrected by WRC. Details of the corrections are in the reference 
    1749 below. 
    1750  
    1751 - Equation (13): the term (1-w(QR)) should swap position with w(QR) 
    1752  
    1753 - Equations (23) and (24) are incorrect. WRC has entered these into Mathematica and solved analytically. The results were converted to code. 
     1668This model calculates the form factor for a flexible cylinder with an elliptical cross section and a uniform scattering 
     1669length density. The non-negligible diameter of the cylinder is included by accounting for excluded volume interactions 
     1670within the walk of a single cylinder. The form factor is normalized by the particle volume such that 
     1671 
     1672*P(q)* = *scale* \* <*F*\ :sup:`2`> / *V* + *background* 
     1673 
     1674where < > is an average over all possible orientations of the flexible cylinder. 
     1675 
     1676*2.1.20.1. Definition* 
     1677 
     1678The function calculated is from the reference given below. From that paper, "Method 3 With Excluded Volume" is used. 
     1679The model is a parameterization of simulations of a discrete representation of the worm-like chain model of Kratky and 
     1680Porod applied in the pseudo-continuous limit. See equations (13, 26-27) in the original reference for the details. 
     1681 
     1682NB: there are several typos in the original reference that have been corrected by WRC. Details of the corrections are 
     1683in the reference below. Most notably 
     1684 
     1685- Equation (13): the term (1 - w(QR)) should swap position with w(QR) 
     1686 
     1687- Equations (23) and (24) are incorrect; WRC has entered these into Mathematica and solved analytically. The results 
     1688  were then converted to code. 
    17541689 
    17551690- Equation (27) should be q0 = max(a3/sqrt(RgSquare),3) instead of max(a3*b/sqrt(RgSquare),3) 
     
    17571692- The scattering function is negative for a range of parameter values and q-values that are experimentally accessible. A correction function has been added to give the proper behavior. 
    17581693 
    1759  
    1760  
    1761 The chain of contour length, L, (the total length) can be described a 
    1762 chain of some number of locally stiff segments of length lp. The 
    1763 persistence length, lp, is the length along the cylinder over which 
    1764 the flexible cylinder can be considered a rigid rod. The Kuhn length 
    1765 (b) used in the model is also used to describe the stiffness of a 
    1766 chain, and is simply b = 2*lp. 
    1767  
    1768 The cross section of the cylinder is elliptical, with minor radius a. 
    1769 The major radius is larger, so of course, the axis ratio (parameter 4) 
    1770 must be greater than one. Simple constraints should be applied during 
    1771 curve fitting to maintain this inequality. 
     1694.. image:: img/image077.JPG 
     1695 
     1696The chain of contour length, *L*, (the total length) can be described as a chain of some number of locally stiff 
     1697segments of length *l*\ :sub:`p`\ , the persistence length (the length along the cylinder over which the flexible 
     1698cylinder can be considered a rigid rod). The Kuhn length (*b* = 2 \* *l* :sub:`p`) is also used to describe the 
     1699stiffness of a chain. 
     1700 
     1701The cross section of the cylinder is elliptical, with minor radius *a*\ . The major radius is larger, so of course, 
     1702**the axis ratio (parameter 4) must be greater than one.** Simple constraints should be applied during curve fitting to 
     1703maintain this inequality. 
    17721704 
    17731705The returned value is in units of |cm^-1|, on absolute scale. 
    17741706 
    1775 The sldCyl = SLD (chain), sldSolv = SLD (solvent). The scale, and the 
    1776 contrast are both multiplicative factors in the model and are 
    1777 perfectly correlated. One or both of these parameters must be held 
    1778 fixed during model fitting. 
    1779  
    1780 If the scale is set equal to the particle volume fraction, f, the 
    1781 returned value is the scattered intensity per unit volume, I(q) = 
    1782 f*P(q). However, no inter-particle interference effects are included 
    1783 in this calculation. 
    1784  
    1785 For 2D data: The 2D scattering intensity is calculated in the same way 
    1786 as 1D, where the *q* vector is defined as . 
    1787  
    1788 REFERENCE 
    1789  
    1790 Pedersen, J. S. and P. Schurtenberger (1996). Scattering functions of 
    1791 semiflexible polymers with and without excluded volume effects. 
    1792 Macromolecules 29: 7602-7612. 
    1793  
    1794 Corrections are in: 
    1795  
    1796 Wei-Ren Chen, Paul D. Butler, and Linda J. Magid, "Incorporating 
    1797 Intermicellar Interactions in the Fitting of SANS Data from Cationic 
    1798 Wormlike Micelles" Langmuir, August 2006. 
    1799  
    1800  
    1801  
    1802 TEST DATASET 
    1803  
    1804 This example dataset is produced by running the Macro 
    1805 FlexCylEllipXModel, using 200 data points, *qmin* = 0.001 -1, *qmax* = 0.7 
    1806 -1 and the default values below. 
     1707In the parameters, *sldCyl* and *sldSolv* represent the SLD of the chain/cylinder and solvent respectively. The 
     1708*scale*, and the contrast are both multiplicative factors in the model and are perfectly correlated. One or both of 
     1709these parameters must be held fixed during model fitting. 
     1710 
     1711If the scale is set equal to the particle volume fraction, |phi|, the returned value is the scattered intensity per 
     1712unit volume, *I(q)* = |phi| \* *P(q)*. 
     1713 
     1714**No inter-cylinder interference effects are included in this calculation.** 
     1715 
     1716For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as 
     1717 
     1718.. image:: img/image008.PNG 
     1719 
     1720This example dataset is produced by running the Macro FlexCylEllipXModel, using 200 data points, *qmin* = 0.001 |Ang^-1|, 
     1721*qmax* = 0.7 |Ang^-1| and the default values below 
    18071722 
    18081723==============  ========  ============= 
     
    18191734==============  ========  ============= 
    18201735 
    1821  
     1736.. image:: img/image078.JPG 
    18221737 
    18231738*Figure. 1D plot using the default values (w/200 data points).* 
     1739 
     1740REFERENCE 
     1741J. S. Pedersen and P. Schurtenberger. *Scattering functions of semiflexible polymers with and without excluded volume* 
     1742*effects*. *Macromolecules*, 29 (1996) 7602-7612 
     1743 
     1744Correction of the formula can be found in 
     1745W-R Chen, P. D. Butler and L. J. Magid, *Incorporating Intermicellar Interactions in the Fitting of SANS Data from* 
     1746*Cationic Wormlike Micelles*. *Langmuir*, 22(15) 2006 6539–6548 
    18241747 
    18251748 
     
    22392162parameters were set to: Scale=1.0, Radius_a=20 , Radius_b=400 , 
    22402163 
    2241 Contrast=3e-6 -2, and Background=0.01 |cm^-1|. 
     2164Contrast=3e-6 |Ang^-2|, and Background=0.01 |cm^-1|. 
    22422165 
    22432166 
     
    22482171ellipsoids calculated from our 2D model and the intensity from the 
    22492172NIST SANS analysis software. The parameters used were: Scale=1.0, 
    2250 Radius_a=20 , Radius_b=400 , Contrast=3e-6 -2, and Background=0.0 cm 
     2173Radius_a=20 , Radius_b=400 , Contrast=3e-6 |Ang^-2|, and Background=0.0 cm 
    22512174-1. 
    22522175 
Note: See TracChangeset for help on using the changeset viewer.