Sie sind auf Seite 1von 2

23/11/18 11:55 AM C:\Users\shivp\OneDrive\D...\Project.

m 1 of 2

clc;
clear all;

%% Creation of Dialog Box for taking inputs from user


prompt= {'\fontsize{10} Enter number of Pseudo-Concentric shell(n):' ,'\fontsize{10}
Enter Diameter of atom (in Angstrom):' };
title = 'Input';
definput={'30',' 5'};
opts.Interpreter = 'tex';
answer = inputdlg(prompt,title,[3 100],definput,opts);

%% Assigning values to variables n & d

n = str2num(answer{1});
d = str2num(answer{2});

%%

for k=1:n
M(k)=(1/3)*((10*((k)^3))+15*((k)^2)+11*k+3); % Total number of atoms
N(k)=10*((k)^2)+2; % Total number of atoms on surface
sur(k)=N(k)*100/M(k); % Percentage surface
d(k)=2*k+1; % Calculation of Diameter
end

for i=2:n
if(sur(i-1)-sur(i)<=1)
shell=i;
break
else
shell=0;
end

end

%%Plot
plot(d,100-sur,'r-o');
hold on
plot(d,sur,'-o');
hold off

xlabel('Particle size (in Angstrom)' );


ylabel('% of atom in Bulk/on surface' );
legend('Bulk Atoms','Surface Atoms','Location','southeast');
23/11/18 11:55 AM C:\Users\shivp\OneDrive\D...\Project.m 2 of 2

if(shell>0)
str=sprintf('The number of shell after which percentage of atom in Bulk/on surface \n
between two consecutive shell is less than 1 = %d' , shell);
text(5,95,str, 'FontSize', 10);

end

Das könnte Ihnen auch gefallen