Description Usage Arguments Details Value Note See Also Examples
Functions to calculate the pair distribution function (PDF) and Q-dependent PDF given a matrix of atomic positions. The latter is relatively time-consuming.
1 2 3 4 5 6 7 8 | calcPDF(nanop, dr=.01, minR=.01, maxR=20,
scatterLength=NA, scatterFactor=NA,
type="neutron", Qmin=1e-16)
calcQDepPDF(nanop=NA, dr=.1, minR=1, maxR=20, dQ=.01, minQ=1, maxQ=20,
verbose=0, subdivisions = 100, order=1000,
rel.tol=.Machine$double.eps^.7,
addNoise=FALSE, noiseFun=NA,
totalScattParams=list(), preTotalScat=NA, ...)
|
nanop |
numeric matrix in which each row gives the coordinates of an atomic position in the nanoparticle. For |
dr |
numeric indicating the desired step size in r. |
minR |
numeric indicating the minimum value of r for which function should be evaluated. |
maxR |
numeric indicating the maximum value of r for which function should be evaluated. |
scatterLength |
numeric vector describing neutron scattering lengths for all atom types in the particles. If |
scatterFactor |
list containing X-ray scattering factor parameters, see |
type |
character; type of scattering. Either "X-ray" or "neutron". |
Qmin |
numeric used to approximate Q-dependent X-ray scattering factor via its value at point |
dQ |
numeric indicating the desired step size in Q in total scattering function calculations. |
minQ |
numeric indicating the minimum value of Q for which the total scattering function should be evaluated. |
maxQ |
numeric indicating the maximum value of Q for which the total scattering function should be evaluated. |
verbose |
numeric; if greater than zero a status report is given after computing the function every |
subdivisions |
numeric, the maximum number of subintervals for the Fourier integral calculation. |
order |
numeric, order of Gauss-Legendre quadrature. |
rel.tol |
numeric, relative accuracy requested for the Fourier integral calculation. |
addNoise |
logical indicating whether noise should be added to the total scattering structure function. If |
noiseFun |
function used to add noise to the total scattering structure function, applied only if |
totalScattParams |
list contacting objects |
preTotalScat |
list with elements |
... |
additional arguments for |
If preTotalScat
is not NA
calcQDepPDF
function calculates Fourier transform of the vector gQ$preTotalScat
. Otherwise it uses parameters specified in totalScattParams
to generate total scattering function first.
list with elements
r |
numeric vector of values at which the function was evaluated, |
gr |
numeric vector of function values. |
To normalize calcPDF
in the same way as calcQDepPDF
it should be multiplied by 4π r.
calcQDepPDF
is currently rather time-consuming.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ## simulate a particle
Cu <- createAtom("Cu")
part <- simPart(atoms=list(Cu), atomsShell=list(Cu), r=8,
rcore=6, latticep=4.08, latticepShell=3.89)
## uniform displacement of positions
partx1 <- displacePart(part, sigma=c(.005, 0.005))
## different displacement in core than shell
partx2 <- displacePart(part, sigma=c(.005, .02))
## calculate and plot PDF associated with both particles
gr1 <- calcPDF(partx1, maxR=24, scatterLength=c(4.87, 7.97), dr=.02)
gr2 <- calcPDF(partx2, maxR=24, scatterLength=c(4.87, 7.97), dr=.02)
plot(gr1$r, gr1$gr, type="l")
lines(gr2$r, gr2$gr, col=2)
## calculate scattering fucntion
gQ <- calcTotalScatt(part, type="neutron", dr=.02,
scatterLength=c(4.87, 7.97), sigma=c(.005, .02))
t1 <- which(gQ$Q > 30)[1]
t2 <- which(gQ$Q > 34.9)[1]
cut <- gQ$Q[t1:t2][which(abs(gQ$gQ[t1:t2])
==min(abs(gQ$gQ[t1:t2]) ))[1]]
## calculate Q-dependent PDF
gr3 <- calcQDepPDF(part, minR=0, maxR=24, dr=0.02, minQ=.771, maxQ=cut,
verbose=100, preTotalScat=list(Q=gQ$Q, gQ=gQ$gQ) )
## compare results with that obtained by calcPDF:
## ...normalization:
gr2 <- 4*pi*gr2$r*gr2$gr
## calculate and subtract gamma term:
gQSAS <- calcTotalScatt(part, type="neutron", minQ=0.001,
maxQ=0.771, dQ=0.005, dr=.02,
scatterLength=c(4.87, 7.97), sigma=c(.005, .02))
gammaR <- calcQDepPDF(part, minR=0.01, maxR=24,
maxQ=.771, minQ=0.001, dr=.02,
verbose=100, preTotalScat=list(Q=gQSAS$Q, gQ=gQSAS$gQ))
gr2 <- gr2 - gammaR$gr
## plot pair distribution functions associated with both technique:
plot(gr1$r, gr2, type="l")
lines(gr3$r, gr3$gr, col=2, lwd=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.