-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAvg_Taylor_factor_direction.m
More file actions
53 lines (40 loc) · 1.54 KB
/
Avg_Taylor_factor_direction.m
File metadata and controls
53 lines (40 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%This code is for calculating average Taylor factor using MTEX
clc;
clear;
cs = crystalSymmetry('432');
ss = specimenSymmetry('1');
%define a family of slip systems
sS = slipSystem.fcc(cs);
%%some plane strain
q = 0.5;
epsilon= strainTensor([1 0 0; 0 -q 0;0 0 q-1]);
%% Asking the euler angle input from User
prompt = 'Enter your file name having orientation of grain in apostrophe(''myfile.txt''):-';
name_of_file = input(prompt);
grain_orientation = dlmread(name_of_file);
Taylor_factor_direction=[];
theta=[];
for i=0:15:90
all_euler=[(grain_orientation(:,1)+i),(grain_orientation(:,2)),(grain_orientation(:,3))];
Taylor_factor=[];
loopcnt = 0;
for counter=1:1:size(all_euler,1)
euler = all_euler(counter,:)*degree;
ori = orientation('Euler',euler,cs,ss);
[M,~,W] = calcTaylor(inv(ori)*epsilon,sS.symmetrise);
Taylor_factor = [Taylor_factor;M];
loopcnt = loopcnt + 1;
end
%calculate average Taylor factor
Avg_Taylor_Factor=(sum(Taylor_factor,'all'))/loopcnt;
Taylor_factor_direction=[Taylor_factor_direction;Avg_Taylor_Factor];
theta=[theta;i];
end
plot(theta,Taylor_factor_direction,'-o','MarkerSize',5,'LineWidth',2,'LineStyle','-','linewidth',3,'Color','k');
xlim([0 90]);
xlabel('Angle from RD (degrees)','fontweight','bold','fontsize',32);
ylabel('Average Taylor Factor','fontweight','bold','fontsize',32);
set(gca,'FontSize',30,'fontweight','bold');
set(gcf,'color','w');
set(gca,'linewidth',3);
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);