software:mtex
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| software:mtex [2019/07/17 09:33] – [How to produce average elastic tensors from ODF with MTeX] matthias | software:mtex [2020/10/06 17:14] (current) – matthias | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| These pages do not intend to provide a full MTeX manual. We will just show tips and tricks which are useful to the community. | These pages do not intend to provide a full MTeX manual. We will just show tips and tricks which are useful to the community. | ||
| + | |||
| + | Note that the syntax of MTeX has been significantly changed from MTeX 5.1 to MTeX 5.4 (current version). Some of the following commands might not work depending on your version! | ||
| ===== How to produce pole figures with MTeX ===== | ===== How to produce pole figures with MTeX ===== | ||
| Depending on what you have as input data, the procedure might change. | Depending on what you have as input data, the procedure might change. | ||
| + | |||
| + | ==== Option 0: Plot individual orientations from an indexing ==== | ||
| + | |||
| + | Once you ran an indexing, you can plot the grain orientations in '' | ||
| + | |||
| + | First, you should extract a list of Euler angles for the indexed grains, which can be done using [[processing: | ||
| + | < | ||
| + | -31.88 273.49 206.05 | ||
| + | -55.09 133.91 157.65 | ||
| + | 83.39 235.30 204.46 | ||
| + | -47.58 78.99 149.71 | ||
| + | -60.87 17.28 33.07 | ||
| + | </ | ||
| + | |||
| + | Here is an example of a script that will load these orientations and plot them in a pole figures. The example is for olivine and can be adjusted to your needs. | ||
| + | |||
| + | < | ||
| + | %% | ||
| + | % Define crystal and sample symmetry | ||
| + | cs_ol = crystalSymmetry(' | ||
| + | ss = specimenSymmetry() | ||
| + | % Plotting convention | ||
| + | plotx2east | ||
| + | % File with Euler angles | ||
| + | fname = fullfile('/ | ||
| + | '',' | ||
| + | |||
| + | %% | ||
| + | % Load file and create the corresponding list of orientations | ||
| + | ori = load(fname) | ||
| + | n = size(ori); | ||
| + | n = n(1); | ||
| + | |||
| + | for i = 1:n | ||
| + | phi1 = ori(i, | ||
| + | Phi = ori(i, | ||
| + | phi2 = ori(i, | ||
| + | ori0(i) = orientation(' | ||
| + | end | ||
| + | |||
| + | %% | ||
| + | % Plot grain orientations | ||
| + | h = Miller({1, | ||
| + | plotPDF(ori0, | ||
| + | |||
| + | |||
| + | </ | ||
| ==== Option 1: You have a list of Euler angles as input ==== | ==== 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 [[software: | + | For this option you need to have a text file with a list of Euler angles in the following format. There is also a [[software: |
| | | ||
| Line 22: | Line 71: | ||
| - Load MTeX into MatLab and make sure that your workspace to the right is empty. | - Load MTeX into MatLab and make sure that your workspace to the right is empty. | ||
| - Click on '' | - Click on '' | ||
| - | - In the new window, click on the '' | + | - In the new window, click on the '' |
| + | - Click '' | ||
| - Now, load the //.cif// file of your phase. | - Now, load the //.cif// file of your phase. | ||
| - Click '' | - Click '' | ||
| - | - 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), | + | |
| - | | + | |
| - | | + | |
| + | | ||
| + | * c) For plotting orientation spot colored depending on the density of points, one need to use the fonction ' | ||
| + | ** | ||
| + | Another way to do it : define euler angles list as an EBSD object** | ||
| - | ==== Option 2: ... ==== | + | First, import your list of Euler angles by : '' |
| - | ... | + | then define the property of the EBSD object to be created, one by one : |
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | Finaly you can create an EBSD object : | ||
| + | |||
| + | '' | ||
| + | |||
| + | From here you can use tis new object as a regular EBSD object. | ||
| + | |||
| + | ==== Option 2: You have a list of quaternions as input ==== | ||
| + | Sometimes it's easier to deal with quaternions because you don't spend hours figuring out which convention was used for making them (there is only one convention for quaternions). MTeX can also read quaternions so there shouldn' | ||
| + | |||
| + | 0.18819093551927868 -0.011978786894112407 0.5338129942637391 -0.8243084177709855 | ||
| + | 0.9558327208154278 | ||
| + | 0.42400840011908053 -0.2054132067385653 | ||
| + | 0.557578365011369 | ||
| + | | ||
| + | |||
| + | Furthermore, | ||
| + | - Load MTeX into MatLab and make sure that your workspace to the right is empty. | ||
| + | - Click on '' | ||
| + | - In the new window, click on the '' | ||
| + | - Click '' | ||
| + | - Now, load the //.cif// file of your phase. | ||
| + | - Click '' | ||
| + | - The import wizard created a script in your editor with four sections. Execute all sections starting from top by clicking '' | ||
| + | - In the workspace to the right, some parameters should have appeared. They need to be there to continue. To avoid the importing procedure next time, save the current script. | ||
| + | * a) For plotting each and every point in a pole figure: Define a new variable: '' | ||
| + | * b) For plotting a smoothened pole figure, type '' | ||
| ===== How to produce average elastic tensors from ODF with MTeX ===== | ===== How to produce average elastic tensors from ODF with MTeX ===== | ||
| Line 37: | Line 126: | ||
| ==== Prerequisites ==== | ==== Prerequisites ==== | ||
| For calculating the average elastic tensors from a textured polycrystalline sample, you need several things beforehand: | For calculating the average elastic tensors from a textured polycrystalline sample, you need several things beforehand: | ||
| + | * Have MTeX ready (either installed or open the " | ||
| * An ODF in Matlab (can be loaded by using the import wizard, see 'How to produce pole figures with MTeX' above for more info) | * 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 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) | ||
| Line 42: | Line 132: | ||
| ==== Loading the single crystal tensor ==== | ==== 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. | + | 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 like so: Use '' | ||
| < | < | ||
| Line 54: | Line 147: | ||
| </ | </ | ||
| - | or you import | + | Please note that the three dots at the end of each row are necessary. |
| - | Now, you have to tell Matlab that the variable //MQuartz// is not just any tensor | + | === Option 2: Import with the import assistant === |
| + | For this, save your matrix as comma-separated values in a text file (//.txt//), like so: | ||
| + | |||
| + | < | ||
| + | 96.6, 33.6, 21.3, | ||
| + | 33.6, 96.6, 21.3, -3.7, | ||
| + | 21.3, 21.3, 163.1, | ||
| + | 3.7, -3.7, | ||
| + | 0., 0., 0., 0., | ||
| + | 0., 0., 0., 0., 3.7, 31.5 | ||
| + | </ | ||
| + | |||
| + | Then, in //Matlab// go to the '' | ||
| + | |||
| + | === Option 3: Use the MTeX import assistant === | ||
| + | The easiest way if you ask me. You also need the tensor as comma-separated values in a //.txt// file, as shown for option 2. | ||
| + | - In your command line, scroll all the way up until you see the three buttons for importing ODF/ | ||
| + | - Click on any of them. A new window opens. | ||
| + | - Switch to the tab //Tensor//, then click on '' | ||
| + | - Click '' | ||
| + | - Click '' | ||
| + | - 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 | ||
| CQuartz = stiffnessTensor(MQuartz, | CQuartz = stiffnessTensor(MQuartz, | ||
| | | ||
| Line 79: | Line 198: | ||
| ==== Calculating the average elastic tensor ==== | ==== 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! | + | 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, | + | THill = calcTensor(odf, |
| + | |||
| + | ===== Transferring ODF data from MAUD to MTeX ===== | ||
| + | ==== How to get a texture in MAUD ==== | ||
| + | MAUD is capable of calculating textures, as well as ODFs and pole figures by using the algorithm //E-WIMV//. This option can be found when marking a phase, clicking on the eye and choosing the tab '' | ||
| + | - '' | ||
| + | - '' | ||
| + | |||
| + | ==== Import the MAUD texture into MTeX ==== | ||
| + | Unfortunately, | ||
| + | |||
| + | The best way is to use the pole figure data instead. Depending on the symmetry, MAUD will create a certain amount of pole figures, which you can export by clicking '' | ||
| + | |||
| + | Here is a step-by-step guide: | ||
| + | - Open the //Import Wizard// by typing '' | ||
| + | - Choose the tab '' | ||
| + | - Click on the '' | ||
| + | - Click '' | ||
| + | - Also, check if the cell parameters are correct and modify the point group if necessary | ||
| + | - Click '' | ||
| + | - Modify the variable //h// in the created //.m// file by exchanging all x-indices with y-indices and vice-versa in every(!!!) line! This has to be done because MAUD uses a left(? | ||
| + | - Add the following line to your script and run it: | ||
| + | |||
| + | odf = calcODF(pf) | ||
| + | |||
| + | Now you have an ODF in MTeX, which should be almost identical to the one from MAUD. | ||
| + | |||
| + | ===== Component analysis ===== | ||
| + | |||
| + | A component analysis provides you with the components, which " | ||
| + | |||
| + | Example: Figure a) shows the inverse pole figure (IPF) of a textured material with tetragonal symmetry. Although the raw data consists of dozens of individual crystals, there are only two distinct " | ||
| + | |||
| + | {{: | ||
| + | {{ : | ||
| + | |||
| + | //Left: Figure a): HW = 10; right: Figure b): HW = 15// | ||
| + | |||
| + | ==== Procedure in MTeX ==== | ||
| + | |||
| + | //See https:// | ||
| + | |||
| + | Have an odf ready in the workspace. Then, use the command | ||
| + | [ori, vol] = calcComponents(odf) | ||
| + | (works only in MTeX 5.4.0 or later). Then, call ' | ||
| + | < | ||
| + | ori = orientation (show methods, plot) | ||
| + | size: 7 x 1 | ||
| + | crystal symmetry : Sample (4/mmm) | ||
| + | specimen symmetry: mmm | ||
| + | |||
| + | Bunge Euler angles in degree | ||
| + | | ||
| + | 225.667 154.883 358.816 | ||
| + | 326.8 136.584 197.771 | ||
| + | 219.344 72.8023 126.642 | ||
| + | 180.004 | ||
| + | 89.9998 | ||
| + | 303.529 75.4564 352.913 | ||
| + | 90.0032 90.0012 224.993 | ||
| + | |||
| + | vol = | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | You can see that MTeX calculated - very surprisingly - even seven components. To visualize these components, you can implement them in your pre-made figure, like so (see Figure c): | ||
| + | annotate(ori,' | ||
| + | |||
| + | {{: | ||
| + | {{ : | ||
| + | //Left: Figure c): HW = 10; right: Figure d): HW = 15// | ||
| + | |||
| + | These components are obviously not correct. Apparently, the texture is sharper in certain areas than it looks like in the figure. That´s why MTeX finds more components than there are actually there. To solve this issue, one has to smoothen the odf. This is done by increasing the halfwidth of the kernel (HW) when calculating the odf at the very beginning. The IPF above was created by using a HW of 10. This is how it looks like after increasing it to 15 (fig b). You can see that the IPF slightly changed. However, the data is still the same. When we calculate the components again, it looks a little bit better: | ||
| + | < | ||
| + | Bunge Euler angles in degree | ||
| + | | ||
| + | | ||
| + | 359.975 98.2499 315.004 | ||
| + | 90.0001 89.9999 | ||
| + | 89.9998 90.0166 224.972 | ||
| + | |||
| + | vol = | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | The number of components decreased to four. Their location in the IPF seems also much more reasonable (see Figure d). Now, you can decide either to increase the HW even more to hopefully get only the two components, which you expected, or you continue. | ||
| + | |||
| + | ==== Interpreting the results ==== | ||
| + | You now have to find out, which component belongs to which point in the IPF. For this step, it is helpful to plot the Euler sections: | ||
| + | figure | ||
| + | plotSection(odf,' | ||
| + | Note that for the cases of compression and tension experiments you have to change the specimen symmetry to ' | ||
| + | |||
| + | Now, try to assign your components to the location in the plot with the help of the given Euler angles. Some of them might be easy to find, other angles don´t seem to match the location in the plot at all. This is because some are represented differently. Try to subtract 90°, 180° or 360° from the angles. If this is not enough to assign the angles, try to subtract the angle from 90°. | ||
| + | < | ||
| + | Example: phi2 = 250° | ||
| + | This could mean one of the following opitions: | ||
| + | a) phi2 = 250° (not for crystal symmetry = tetragonal) | ||
| + | b) phi2 = 250° - 180° = 70° | ||
| + | c) phi2 = 90° - (250° - 180°) = 20° | ||
| + | </ | ||
| + | |||
| + | If the values still don´t make sense you should consider modifying the HW to make sure that you can always follow what is going on. | ||
| + | |||
| + | The parameter '' | ||
| + | |||
| + | By performing this analysis on different samples (by using the same HW), you can not only see how certain textures evolve over time but also support this observation with numbers. | ||
software/mtex.1563348786.txt.gz · Last modified: by matthias
