Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. The following error occurred converting from function_handle to double:
  2. Error using double
  3. Conversion to double from function_handle is not possible.
  4.  
  5. clear all
  6. nn=3;
  7. mm=3;
  8. totalatom=mm*nn;
  9. vf=1e6;
  10. el=1.6e-19;
  11. energy=1e-19;
  12. hbar=1.054e-34;
  13. omega=energy/hbar;
  14. ep0=8.854e-12;
  15. refindex=2.71+complex(1.41);
  16. permitrel=5.356+complex(0,1)*7.642;
  17. permit=ep0*permitrel;
  18. c=3e8;
  19. intensity=10e4;
  20. power=1;
  21. pulsedur=1e-15;
  22. photonflux=intensity/energy;
  23. photonnumber=power*pulsedur/energy;
  24. a0=(hbar*refindex*photonflux/(2*photonnumber*omega*permit*c));
  25. % Hamiltonian Of Graphene Without Perturbation
  26. h=ones(totalatom,totalatom);
  27. for i=1:totalatom;
  28. for j=1:totalatom;
  29. if j==i-1;
  30. h(i,j)=2;
  31. elseif j==i+1;
  32. h(i,j)=2;
  33. % elseif j==i+3;
  34. % h(i,j)=2;
  35. else
  36. h(i,j)=0;
  37. end
  38. end
  39. end
  40.  
  41.  
  42. %syms e;
  43. dive=1e-8;
  44. green=@(e) e*double(eye(totalatom))-h-dive*double(eye(totalatom))*complex(0,1);
  45. gret=@(e) eye(totalatom)/green;
  46. gless=@(e)complex(0,1)*gret; % Remark: Here The Fermi-Dirac Distribution Is Not Write It Will Product To Finall Answer
  47. gless=@(e) subs(gless,e,e-energy);
  48.  
  49. sigma=ones(totalatom,totalatom);
  50. coupling=0;
  51. for l=1:totalatom
  52. for m=1:totalatom
  53. for p=1:totalatom
  54. if p==l+1
  55. mlp=complex(0,1)*el*vf*a0*square(3)/2;
  56. elseif p==l-1
  57. mlp=-complex(0,1)*el*vf*a0*square(3)/2;
  58. elseif p==l
  59. continue
  60. elseif p==l+2
  61. break
  62. end
  63. for q=1:totalatom
  64. if q==m+1
  65. mqm=complex(0,1)*el*vf*a0*square(3)/2;
  66. elseif q==m-1
  67. mqm=-complex(0,1)*el*vf*a0*square(3)/2;
  68. elseif q==m
  69. mqm=0;
  70. elseif q==m+2
  71. break
  72. end
  73. coupling=@(e) mlp*mqm*gless(p,q)+coupling;
  74. end
  75. end
  76. sigma(l,m)=@(e) coupling*photonnumber;
  77. coupling=0;
  78. end
  79. end
  80. %Lesser Green Function Photon
  81. glessphoton=@(e) gret*sigma*ctranspose(gret);
  82. diag=@(e) trace(glessphoton);
  83. resp=integral(@(e) diag,0,inf);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement