Installation¶
Using a Conda Environment¶
pyRS preferred method is to create a conda environment with the required Python dependencies. Follow these steps:
Install basic dependencies: Conda, Python 3, and PyQt
Create a new Conda environment with additional dependencies:
$ conda create -n pyrs -c mantid -c mantid/label/nightly mantid-workbench -c conda-forge --file requirements.txt --file requirements_dev.txt
Activate the conda environment
$ conda activate pyrs
Caution
Do not update this newly created environment as some dependencies might not be backwards compatible.
Quick Start¶
Launch the Graphical Interface¶
pyRS graphical interface can launched using the pyrsplot executable
$ pyrsplot
you should be able to see pyRS’s MainWindow:
As listed in the MainWindow, pyrsplot can run 3 different usage modes as described in the next sections.
Data Manual Reduction¶
#TODO
Peak Fitting¶
#TODO
Strain/Stress Analysis¶
Mathematical Framework¶
PyRS models Strain and Stress tensor \(_{ij}\) fields using the following formulation:
Strain, aka unconstrained strain, \(\epsilon_{ij}\) is measured as the fraction change from a reference state \(d_0\).
Residual stress is determined by measuring stress along 3 orthogonal directions
where:
- \(\nu\)
Poisson’s ratio
- \(E\)
Young’s modulus
Notice that \(\epsilon_{ij}\) with \(i = j\) are principal strains. But not all all three orthogonal strains are equivalent to principal strains. The off-diagonal strain component, i.e., \(\epsilon_{ij}\) with \(i \neq j\) are all set to zero. It is very hard to measure these values in HB2B’s setup.
As a result, the stress in PyRS is calculated as follows:
where the second term in the sum is common to all 3 principle directions, \(\sigma_{11}\), \(\sigma_{22}\), and \(\sigma_{33}\).
in-plane strain: this is a special case in which the stress in one of the principal directions is zero, \(\sigma_{33}=0\). Therefore, the corresponding strain can be determined from the other principal components using Poisson’s ratio:
Resulting in a simplified set of equations for the in-plane stress case: