% average velocity of dislocation at T=300K, a=10 [b], 
% c=0.001, K/2e=0.1 in a 41960 (10 um) by 10240 [b] cell.
% If the dislocation is hopelessly stuck during the 
% simulation, the velocity is taken to be 0.

clear;
B = 0.011597;
lambda_critical = 1000.04;

% stress [e/b^2], velocity [vs], lambda [b]
sv = [
0.000500 0.040735 5714.53
0.000450 0.036209 10/0.195E-2
0.000400 0.031665 10/0.219E-2
0.000350 0.026688 10/0.275E-2
0.000300 0.021755 10/0.333E-2
0.000250 0.016695 10/0.409E-2
0.000240 0.015066 10/0.471E-2
0.000200 0.009932 10/0.589E-2
0.000190 0.007818 1386.23
0.000180 0.007261 1399.01
0.000170 0.004840 1034.40
0.000165 0.003160 935.12
0.000162 0.003088 1080.43
0.000160 0.000000 41960/47.75
0.000150 0.000000 41960/48
0.000140 0.000000 41960/44.82
0.000130 0.000000 41960/45.23
0.000120 0.000000 41960/44.89
0.000050 0.000000 41960/47
];

clf;
plot (sv(:,1), sv(:,2)./(sv(:,1)/B), 'o');
xlabel('2\sigma/\mu(T)');
ylabel('v/(\sigma b/B(T))');
axis ([0 max(sv(:,1)) 0 1]);
title('Average dislocation velocity in Cu simulation at T=300K, a=10, c=0.001, K/2e=0.1');
hold on; plot ([2.0E-4 2.0E-4], [0 1], 'r--');
text (0.7E-4, 0.9, 'Friedel theory threshold');
plot ([1.60E-4 1.625E-4], [0 1]);
text (0.5E-4, 0.7, 'Simulation threshold');
text (3.5E-4, 0.3, 'Plastic deformation');
text (0.3E-4, 0.2, 'Elastic deformation');
input ('press a key .. ');
print -depsc velocity.eps

clf;
plot (sv(:,1), sv(:,3)/lambda_critical, '*');
hold on; plot ([0 max(sv(:,1))], [1 1], 'r--');
axis ([0 max(sv(:,1)) 0 5]);
text (3E-4, 1.15, 'Friedel theory prediction');
xlabel('2\sigma/\mu(T)');
ylabel('\lambda / (K/2\epsilon)^{-1/2}L');
title('Average free length on dislocation, \lambda, in Cu simulation at T=300K, a=10, c=0.001, K/2e=0.1');
print -depsc lambda.eps

% simulation flow stress = 1.6E-4 [e/b^2] = 0.8E-4 u(T) ~ 3.5 MPa 
% analytical flow stress = 2.0E-4 [e/b^2] = 1E-4 u(T);
% experimental flow stress = analytical * 0.85 to 0.9
% but there is no easy experimental determination of K/2e
