Software · Tutorials – Perform cubic Hermite spline interpolation in Julia

Tutorial on CubicHermiteSpline.jl

This is a tutorial on how to use the Julia package CubicHermiteSpline.jl, which performs a cubic Hermite spline interpolation on an array of data points, $(x_i, y_i)$, given that their associated gradients, $k_i=(dy/dx)_i$, are known in advance.New v0.3.0 can now perform bivariate cubic Hermite spline interpolation for 2D data points (regular and irregular grids are both supported). v0.2.2 can now compute the 1st order derivative of the interpolated function. Read More ›

Research · Software · Tutorials – Form factor of a homogeneous sphere

Julia in Practice: Building Scattering.jl from Scratch (6)

In this post we will first coin the term form factor for arbitrary particles by generalizing the idea of the atomic form factor. We then derive an analytical expression for the form factor of a homogeneous sphere. The functionality is implemented in two submodules: scatterer.jl and formfactor.jl. These two modules will be gradually extended by adding more types of particles as the project goes on. Read More ›

Research · Software · Tutorials – Fundamentals of X-Ray Scattering

Julia in Practice: Building Scattering.jl from Scratch (5)

In this post we will present a concise review of the fundamental theory of X-ray scattering, including electromagnetic waves, flux and intensity, scattering cross section and scattering length, scattering by an electron, interference, and atomic form factor. Although the specific properties of X-rays are used, the derivation is applicable to other incident beams, such as neutrons. The derivation presented here is different from most of literature with an emphasis on a consistent treatment on the wave nature of the incident beam. The notations used in this post mostly follow the book by Roe1. Roe, R. J. Methods of X-Ray and Neutron Scattering in Polymer Science; Oxford University Press, 2000. ↩ Read More ›

Software · Tutorials – A Jupyter notebook like blog post for demonstration

Usage and Testing of rotation.jl

Numerical experiments are carried out to demonstrate the usage as well as serving as a test for the rotation.jl submodule. This is an appendix to the previous post. The format of this post mimics the Jupyter notebook. The output of a code block after run is captured by Literate.jl and rendered here as a markdown code block in the format of the text language. Read More ›

Research · Software · Tutorials – Rotations and their representations

Julia in Practice: Building Scattering.jl from Scratch (4)

In this post we implement submodules rotation.jl of Scattering.jl to rotate a vector in the reference coordinate system to the internal coordinate system of the scatterer. Three representations of a rotaion operation are discussed and implemented. The conversion among and math operations on these representations are also implemented. Read More ›