Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. a=(1.8+6/18)*10^-10;
  2. b=0.8*10^-10;
  3. a0=sqrt((2.*9.1.*10^-31).*(9.*1.6.*10^-19)/(1.055*10^-34)^2);
  4. beta=5;
  5. u0=9.*1.6e-19;
  6. hb = 1.055E-34;
  7.  
  8.  
  9. E_f=(2.75+(beta/36)).*1.6e-19.*9;
  10. x = 0:0.0001:4;
  11.  
  12. g=((1-2*x)./(2*sqrt(x.*(1-x))));
  13.  
  14. m=sin(a0.*a.*sqrt(x));
  15.  
  16. n=sinh(a0.*b.*sqrt(1-x));
  17.  
  18. p=cos(a0*a*sqrt(x));
  19.  
  20. q=cosh(a0.*b.*sqrt(1-x));
  21.  
  22. y=(g.*m.*n)+(p.*q);
  23.  
  24. plot(x,y);
  25.  
  26. rectangle('Position',[0.2148 -1 0.3019 2], 'FaceColor', [1 0 0 0.3], 'EdgeColor','r');
  27. rectangle('Position',[0.9545 -1 1.1015 2], 'FaceColor', [1 0 1 0.3], 'EdgeColor','m');
  28. rectangle('Position',[2.412 -1 1.588 2], 'FaceColor', [0 1 0 0.3], 'EdgeColor','g');
  29.  
  30. annotation('textarrow',[0.199853587115666 0.199121522693997],...
  31. [0.597333333333333 0.464],'String',{'Band 1'});
  32.  
  33. annotation('textarrow',[0.425329428989751 0.424597364568082],...
  34. [0.605333333333333 0.471999999999999],'String',{'Band 2'});
  35.  
  36. annotation('textarrow',[0.759882869692533 0.759150805270864],...
  37. [0.602666666666666 0.469333333333333],'String',{'Band 3'});
  38.  
  39. %% Code useful for Task 2
  40. %Values:
  41. formatSpec = 'afirst=%1.11f, bfirst=%1.11f\n';
  42. fprintf(formatSpec,a,b) %Print the
  43.  
  44.  
  45.  
  46. M = 100; %number of iterations
  47. pi=3.141592654;
  48. kstart = -pi./(a+b); %Starting point
  49. kstop = pi./(a+b); %Stop point
  50.  
  51. %E=1;
  52. %x= (E/U0);
  53. delta_k = (kstop-kstart)/M; %Discretization step
  54. %%%%E1 = 0.1012
  55.  
  56. for n=0:1:M %begin cycle
  57.  
  58. k = kstart + n.*delta_k;
  59. k1(n+1) = k;
  60. v = cos(k.*a+k.*b);
  61. v1(n+1) = v;
  62. funp = @(x) ((1-(2*x))/(2*sqrt(x.*(1-x))) .* (sin(alpha0.*a.*sqrt(x))) .* sinh(alpha0 .* b .* sqrt(1-x)) + (cos(alpha0.*a.*sqrt(x))).*cosh(alpha0.*b.*sqrt(1-x)))-(cos(k*(a+b)));
  63. x1 = 0.1;
  64. Solx1 = fzero(funp,x1); %Solve a generic equation Sin(2x) = Cos(k) numerically
  65. Sol1(n+1) = Solx1;
  66. x2 = 2.0;
  67. Solx2 = fzero(funp,x2);
  68. Sol2(n+1) = Solx2;
  69. x3 = 4.0;
  70. Solx3 = fzero(funp,x3);
  71. Sol3(n+1) = Solx3;
  72.  
  73. end
  74. figure
  75. plot(k1,Sol1,'x') %Plot the graph using the vectors of numerical values as above
  76. axis([kstart kstop 0 6])
  77. hold on;
  78. plot(k1,Sol2,'x') %Plot the graph using the vectors of numerical values as above
  79. hold on;
  80. plot(k1,Sol3,'x') %Plot the graph using the vectors of numerical values as above
  81. hold on
  82.  
  83. xlabel('wavenumber')
  84. ylabel('Energy eV')
  85.  
  86. plot( [kstart, kstop] , [E_f/u0 , E_f/u0] );
  87.  
  88. %Task 3
  89.  
  90. %klst;
  91.  
  92. E0 = 2.412;
  93. Eneg = 2.416;
  94. Epos = 2.416;
  95.  
  96. dEdk = (Eneg - 2*E0 + Epos)/((delta_k)^2);
  97.  
  98. Mc = (hb^(2))/dEdk/u0
  99.  
  100. E01 = 2.059;
  101. Eneg1 = 2.052;
  102. Epos1 = 2.052;
  103.  
  104. dEdk1 = (Eneg1 - 2*E01 + Epos1)/((delta_k)^2);
  105.  
  106. Mv = (hb^(2))/dEdk1/u0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement