User Tools

Site Tools


software:mtex

This is an old revision of the document!


MTeX

MTEX is a free Matlab toolbox for analyzing and modeling crystallographic textures by means of EBSD or pole figure data. It runs inside matlab and it is very useful to work and plot grain orientations. The homepage for MTeX is at http://mtex-toolbox.github.io/ with an extensive user manual at http://mtex-toolbox.github.io/documentation.html.

These pages do not intend to provide a full MTeX manual. We will just show tips and tricks which are useful to the community.

How to produce pole figures with MTeX

Depending on what you have as input data, the procedure might change.

Option 1: You have a list of Euler angles as input

For this option you need to have a text file with a list of Euler angles in the following format. There is also a TIMEleSS tool to create such a list from a Grainspotter .log file.

 70.469029217	237.905359456	160.103826456
 65.061195645	232.020366708	153.370063692
 -83.53256124	160.47139216	52.262899769
 81.812326561	201.132499009	220.391622469
 ...            ...             ...

Furthermore, have the correct .cif file ready. Now, go on with the following procedure:

  1. Load MTeX into MatLab and make sure that your workspace to the right is empty.
  2. Click on Import ODF data. A new window should open.
  3. In the new window, click on the + symbol to the right and choose the text file with the Euler angles. A window with a short example of your data is popping up. Below, assign each column to the correct Euler angle (usually phi1, Phi, phi2). Click Finish. The window will close and a short calculation is running. After that, the file name should be visible in the list. Click Next».
  4. Now, load the .cif file of your phase.
  5. Click Next» until the end or Finish immediately.
  6. In the workspace to the right, some parameters should have appeared. They need to be there to continue. If the workspace is empty, execute the whole script by clicking in each of the four sections (yellow background), followed by Ctrl+Enter. To avoid the importing procedure next time, save the current script.
  7. Type to the command line: plotPDF(odf,Miller({1,0,0},{0,1,0},{0,0,1},CS)) and press Enter. Depending on crystal symmetry other pole figures might be of interest.
  8. The pole figures should pop up. To see the intensity, click Insert Colorbar (a button in the figure window).

Option 2: ...

How to produce average elastic tensors from ODF with MTeX

Prerequisites

For calculating the average elastic tensors from a textured polycrystalline sample, you need several things beforehand:

  • Have MTeX ready (either installed or open the “startup.m” file)
  • An ODF in Matlab (can be loaded by using the import wizard, see 'How to produce pole figures with MTeX' above for more info)
  • The crystal system loaded in Matlab (can be loaded by using the import wizard, see 'How to produce pole figures with MTeX' above for more info)
  • The elastic tensor with all independent elastic constants

Loading the single crystal tensor

If you have these things ready, you can start by loading the elastic tensor into Matlab. Let's do it for quartz as an example.

Option 1: Manually

Type it in by hand and press Return afterwards, like so:

>> MQuartz =....
  [[86.74  6.99  11.91 -17.91   0.00   0.00];...
  [  6.99 86.74  11.91  17.91   0.00   0.00];...
  [ 11.91 11.91 107.20   0.00   0.00   0.00];...
  [-17.91 17.91   0.00  57.94   0.00   0.00];...
  [  0.00  0.00   0.00   0.00  57.94 -17.91];...
  [  0.00  0.00   0.00   0.00 -17.91  39.88]];

Please note that the three dots at the end of each row are necessary.

Option 2: Import with the import assistant

For this, save your matrix as comma-separated values in a text file (.txt). Then, in Matlab go to the Home tab and click Import Data. The import assistant will open. Check if the data is in the way you want to have it and change the Output Type to Numeric Matrix. Finally, click in the Import dropdown menu on the right Generate Script. Change the name of the file in the script to whatever you like (in this example I changed it to MQuartz).

Option 3: Use the MTeX import assistant

The easiest way if you ask me.

  1. In your command line, scroll all the way up until you see the three buttons for importing ODF/EBSD/pole figure data.
  2. Click on any of them. A new window opens.
  3. Switch to the tab Tensor, then click on + on the right side of the window and open the file where your tensor is stored.
  4. Click Next and load the CIF file of your phase. It doesn't matter if you imported it already before when you imported your Euler angles because it should be the same anyway.
  5. Click Next and Finish.
  6. Run all sections of your script.

Note that the created script has already a line for assigning the matrix to the tensor. The following step is not necessary if you are loading the tensor this way.

Assigning the matrix to an elastic tensor (only for options 1 and 2)

Now, you have to tell Matlab that the variable MQuartz is not just any matrix but the stiffness tensor. We do this by typing

CQuartz = stiffnessTensor(MQuartz,CS)

to the command line. You will get a printout like this one:

CQuartz = stiffnessTensor (show methods, plot)
  unit   : GPa                             
  rank   : 4 (3 x 3 x 3 x 3)               
  mineral: Quartz (321, X||a*, Y||b, Z||c*)
 
  tensor in Voigt matrix representation:
 86.74  6.99 11.91     0     0     0
  6.99 86.74 11.91     0     0     0
 11.91 11.91 107.2     0     0     0
     0     0     0 57.94     0     0
     0     0     0     0 57.94     0
     0     0     0     0     0 39.88

As you can see in this example, some of the constants have changed to zero, according to the symmetry.

Calculating the average elastic tensor

Now you can finally calculate the weighted tensor of the textured material. But be careful! A lot of memory is necessary for this kind of calculation!

THill = calcTensor(odf,MQuartz,'Hill')
software/mtex.1563368813.txt.gz · Last modified: 2019/07/17 13:06 by matthias