Page 1 of 1

Simulation of a twinned crystal

Posted: Fri Jan 22, 2016 7:17 am
by thanasis
Hello,

This is a sequel to my previous topic about single-crystal rotations. My follow-up question is whether we can simulate twinned crystals.

From what I understand, for multi-component systems, the fitted variables for each component must be entered into the Sys structures. However, the molecular and crystal orientations are entered under Exp.MolFrame and Exp.CrystalOrientation, i.e. in the experimental conditions.

Is to possible to simulate different orientations for each of the two components?

Thanks in advance.

Re: Simulation of a twinned crystal

Posted: Fri Jan 22, 2016 2:57 pm
by Stefan Stoll
The best way to simulate a twinned crystal is to use two orientations in Exp.CrystalOrientation (two rows with three Euler angles each). Of course, this works only if the spin centers in the two twinned domains are identical and the only difference is the orientation.

Code: Select all

clear
Sys.g = [2 2.1 2.2];
Sys.lw = 0.5;

Exp.mwFreq = 9.5;
Exp.Range = [300 360];

Exp.CrystalOrientation =[0 0 0; rand(1,3)*pi];

pepper(Sys,Exp);
If you have different amounts of spin centers in the two domains, use

Code: Select all

Opt.Output = 'separate';
[x,y] = pepper(Sys,Exp,Opt);

Weights = rand(1,2);
y = Weights(1)*y(1,:) + Weights(2)*y(2,:);

Re: Simulation of a twinned crystal

Posted: Sat Jan 23, 2016 6:17 pm
by thanasis
Thanks, that seems to be what i am looking for!

However, I have trouble making it work with rotatecrystal.

After I define the initial orientations of the the initial orientation and the rotation axis, when I instruct it to use the rotatecrystal function, it has a problem with the number of Euler angles:

Code: Select all

cori0 = [0 0 0; 0 10 0]*pi/180; 
nRot_L = [1;0;0];
rotatecrystal(cori0,nRot_L,pi/4);
Throws the error:

Code: Select all

Error using rotatecrystal (line 36)
First input (CryOri) must contain three numbers, the three Euler angles.

Re: Simulation of a twinned crystal

Posted: Mon Jan 25, 2016 10:10 pm
by Stefan Stoll
rotatecrystal only supports one crystal orientation at a time. You can loop over the orientations one by one to get the rotation done:

Code: Select all

clear, clc

cori0 = [0 0 0; 0 10 0]*pi/180;
nRot_L = [1;0;0];
for iOri = 1:size(cori0,1)
  cori_rot(iOri,:) = rotatecrystal(cori0(iOri,:),nRot_L,pi/4)
end