User Tools

Site Tools


takin:help:tutorial

Takin Tutorials

Demos for using the resolution convolution are available in the source distribution which can be downloaded here. To use these demos, please unpack the archive from the link. The full documentation for Takin and further tutorials can be found here.

Magnon demo

  1. Open the convolution dialog using “Resolution” → “Convolution…” in Takin's main menu.
  2. Select “File” → “Open…” in the convolution dialog's menu and navigate to the folder where you downloaded and extracted the data archive (see above). Go to the sub-folder “data/demos/magnon_afm” and open the file “magnon_convolution.taz”.
  3. Click the “Start Sim.” button to calculate a resolution-convolution simulation.
  4. You can visualise and change the magnetic model (here: an antiferromagnetic chain) by loading it into the magnon calculation module. To do so, select “Tools” → “Magnetic Dynamics” in Takin's main window.
  5. In the magnon dialog, select “File” → “Open…” from the menu and select the file “model.magdyn” from the sub-folder “data/demos/magnon” of the extracted data archive. You can edit and save the model, and the results will be immediately visible in the convolution dialog when doing a resimulation.

Phonon demo

  1. Open the convolution dialog using “Resolution” → “Convolution…” in Takin's main menu.
  2. Select “File” → “Open…” in the convolution dialog's menu and navigate to the folder where you downloaded and extracted the data archive (see above). Go to the sub-folder “data/demos/phonon” and open the file “phonon_simple_py.taz”.
  3. Click the “Start Sim.” button to calculate a resolution-convolution simulation.

The demo convolution uses the Python backend for creating S(q,E) models. In the example, the model file can be found in the file “sqw_phonon.py”. In there, the most important (and only mandatory) interface function for Takin is “TakinSqw(h, k, l, E)”, which receives the (hkl) coordinates (in rlu) and the energy transfer E (in meV) of each random Monte-Carlo neutron events from Takin, and has to return the dynamical structure factor S(h, k, l, E) for the queried coordinate. How the structure factor is calculated is up to the user. In the example, a simple sinusoidal phonon dispersion branch with a DHO shape in energy is created.

Each parameter in the Python S(q,E) model script (here: “sqw_phonon.py”) which is global and whose name begins with “g_” is a parameter that can be changed directly from Takin and that can also be defined as a fit parameter. In the convolution dialog, they can be inspected and modified by clicking on the “Parameters…” button.

To fit a parameter, follow these steps:

  1. Fitting a parameter is done by checking the respective “Fit” column in the parameters dialog and giving the parameter a non-zero error. Initial values for fitting can be set via the “Value” column.
  2. If at least one parameter has been declared a fit parameter, the convolution fitting can be started by clicking “Start Fit”.
  3. If the curve appears to be completely at zero in the plot window, try increasing the “Scale” factor, for example to “1e4” or “1e5”.
takin/help/tutorial.txt · Last modified: 2023/09/21 09:26 by Tobias Weber