%%                        MTEX Workshop 2020
%
%%                         Exercises Day 2
%
%% Exercise 2.1
% 
%% a) 
% Generate a symmetry group that consist of three fold axis in direction
% (111) and a two fold axis perpendicular to it. Visualize the symmetry
% group using the command plot.
%
% useful commands: rotation.byAxisAngle, crystalSymmetry.byElements


%% b)
% Turn the above symmetry into a Laue group by adding the inversion and
% plot it again.
%
% useful commands: crystalSymmetry/add, rotation.inversion


%% c)
% Add to the above symmetry a four fold axis in direction (001). Which
% symmetry group do we obtain?

%% d)
% Verify, that a mirroring at a plane with normal (111) is nothing else
% then a rotation around the axis (111) about 180 degree followed by an
% inversion.


%% Exercise 2.2
%
%% a) 
% Define trigonal crystal symmetry 321 and a random crystal direction.
% Compute all symmetrically equivalent crystal directions without using the
% command symmetrise and check that your result is correct.
%
% useful commands: Miller.rand


%% b)
% Compute the angles between all symmetrically equivalent directions from
% a)
%
% useful commands: angle, angle_outer, symmetrise
% useful options: noSymmetry

%% c) 
% Find a crystal direction such that there are only two symmetrically
% equivalent directions with respect to the symmetry 321
%
% useful commands: unique, multiplicity
% useful options: noSymmetry

%% d)
% What are the common symmetries of the point groups 321 and m-3?
% Can you do this without using the command disjoined?
% Do the common symmetries again form a point group?
%
% useful commmands: symmetry/disjoined


%% Exercises 2.3
%
% Define a crystal symmetry such that (110) is not parallel to {110}.
% Verify this using the command angle.


%% Exercise 2.4
%
%% a)
% Generate 1000 random orientations with symmetry 112. Compute the
% rotational angle of all these orientations and display the coresponding
% histogram.
%
% useful commands: histogram, orientation.rand, angle


%% b)
% What is the maximum rotational angle? What is the corresponding axis?


%% c)
% Plot the position of the {111} planes with respect to the random
% orientations from a) without using the command plotPDF.


%% d)
% Visualize the random orientations from a) in the Z - inverse pole figure
% without using the command plotIPDF.
%
% usefull options: fundamentalSector


%% e)
% Redo a) - d) for the symmetries 222 and 432.


%% Exercise 2.5
%
% Consider orthorhombic crystal symmetry and inspect the following pole
% figures:

cs = crystalSymmetry('222');

ori = secret('2_5'); % some secret orientations

% plot pole figures
h = Miller({0,0,1},{0,1,0},{1,0,0},{1,1,0},{1,1,1},cs)
plotPDF(ori,h,'MarkerSize',4)

%% a)
% How many prefered orientations are displayed? Why the number of spots
% differes so much between the different pole figures?
%
% useful commands: calcCluster

%% b)
% Determine the prefered orientation(s) approximately and annotate them to
% the pole figure.


%% c)
% Replace the crystal symmetry by the corresponding Laue group? Plot the
% pole figures. How many poles do you expect and how many do you observe?


%% Exercise 2.6
% 
% Consider cubic crystal symmetry and inspect the following inverse pole
% figures:

cs = crystalSymmetry('m-3m')
ori = secret('2_6'); % some secret orientations

plotIPDF(ori,[vector3d.Z,vector3d.X],'MarkerSize',3)

%% a)
% Determine approximately the preferred orientation.


%% b)
% What is the percentage of orientations within a 5 degree ball around the
% preferrd orientation?


%% c)
% Visualize those orientations in 3d Euler angle space, in 3d axis angle
% space in phi2 sections and in sigma sections


%% Exercise 2.7
%
%% a) 
% Consider hexagonal symmetry with two different setups x||a and x||a*.
% Define the orientatation (20,30,40) with respect to both setups and
% visualize them in the three dimensional Euler angle space and the 
% three dimensional axis angle space. What do you observe?


%% b)
% Visualize both orientations in a (10-10) amd (11-2,1) pole figure plot.
% Are those the same or different? Why?


%% c)
% Visualize both orientations in an (1,0,0) and (1,1,1) inverse pole figure
% plot. Are those the same or different? Why?


%% d)
% Define the crystal direction (11-21) for both setups and compute the
% resulting specimen directions for any combination of setups, i.e., setup
% 1/2 for the orientation times setup 1/2 for the crystal direction. What
% does the resulting specimen direction depend on? Why?


%% e)
% Define the orientation (11-21)[1-100] with respect to both setups. Are
% they the same?
%
% useful commands: orientation.byMiller, transformReferenceFrame


%% Exercise 2.8
%
%% a)
% Consider cubic crystal symmetry and orthorhombic specimen symmetry and
% define the Brass, Goss, Cube and Copper standard orientations.
%
% useful commands: specimenSymmetry

%% b)
% Determine the multiplicity of each of the standard orientations.

%% c)
% Visualize the orientatios in the different 3d and 2d orientation
% representations. How is the multiplicity related to the geometrical
% position within the orientation space?

%% Exercise 2.9
%
%% a) 
% Most fundamental sectors of crystal symmetries are triangles. The
% fundamental sector of which crystal symmetry is a quadrangle? Visualize
% it.


%% b)
% In fact the fundamental sector for this symmetry could by replaced by a
% triangle. Which one? Define and visualize it.

