You are on page 1of 3

Question 3b)

Appendix :

Matlab program for question 3b

% Imperfections in Crystalline Solids


% Chapter 10 Fig.10.15
% find the equilibrium pile up positions

options =
optimset('Display','final','MaxIter',1e4,'MaxFunEvals',1e4,'TolFun',1e-5);

% Number of dislocation are 100


Ndis = [5:5:100];
%Ndis = [5:30:245];

%shaer stress in mpa


tau=10;
%shaer modulus in mpa
mu=48000;
% poissons ratio
nv=0.344;
%a is lattice parametr in nm
a=0.361

b= a/1.41

A=(mu* b/ 2*3.142*(1- nv))

h= tau/A

y = [length(Ndis):-1:1];
x = cell(length(Ndis),1);
xmin = zeros(size(y));
res = cell(length(Ndis),1);
for i = 1:length(Ndis),

x0 = [-Ndis(i):1:-1];

% inline function
netforce = inline('sum(1./(ones(size(x))''*x-x''*ones(size(x))-
eye(length(x))),2)''-1./x');
x{i} = fsolve(netforce,x0,options);

% function implemented in netforce.m


%x = fsolve(@netforce,x0,options);

res{i} = netforce(x{i});
end

fs = 17;
figure(1);
for i = 1:length(Ndis),
p1 = plot(x{i},y(i)*ones(size(x{i})),'bo');
set(p1,'MarkerSize',3);
set(p1,'MarkerFaceColor','b');
if i == 1
t1 = text(x{i}(1)-1,y(i)+0.3,sprintf('N =
%d',Ndis(i)),'FontSize',fs);
hold on
else
t1 = text(x{i}(1)-1,y(i)+0.3,sprintf('%d',Ndis(i)),'FontSize',fs);
end
xmin(i) = min(x{i});
drawnow
end

plot(-[Ndis]*2, [y], 'r--');


hold off
ylim([0 length(Ndis)+1]);
set(gca,'FontSize',fs);
set(gca,'YTick',[]);
xlabel('x (arbitrary units)');

You might also like