Code:
// WKB.cpp : Defines the entry point for the console application.
//the Unit of length is nm, and energy unit is eV, the rest physical quantities are charaterized by I.U.
#include<iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main(void)
{
//define the constant
double q,pi,vf,h,Ef,V0,Ks,a,Q,v0,omega,lamda,alpha;
q=1.6E-19; //electron charge
pi=3.141592653;
vf=1E15; //fermi velocity for dirac electron in the unit of nm/s
h=6.63E-34/2/pi/1.6E-19;//reduced plank constant in the unit of eV.s
Ef=0.082825; //fermi energy level in the unit of eV
V0=4.66; //the work function of graphene sheet is 4.66eV
v0=0.2; // the potential barrier height in the unit of eV
omega=5E13; // Osscilation frequency of potential
Ks=2; //the dimensionlees dielectric constant is 2.3 for graphene sheet
a=100; //barrier width in the unit of nm
lamda=50; //fermi wavelength in the unit of nm
alpha=2; //the effective fine structure constant of graphene
Q=(Ks-1)/(Ks+1)/4*alpha*h*vf/q*10; //the constant of the image potential in unit of eV.nm
//define the variable
double phi; //phi is the incident angle
double F; //F is the applied electric field
double U; //U is the true potential profile
double x1,x2,x; //the critical boundray value
double dx;
double determine;
double ky,k11,k01,k02,k12,phi1,phi0,ts0,tsn,Tn,T1,sn;
//intialize the parameter
Tn=U=0;
x1=x2=x=0;
F=0.1/1.602E-19; //in the unit of eV/nm
errno_t err;
FILE(*fp);
err=fopen_s(&fp,"liang 1.txt","w");
if(err==NULL){
printf("cannot opent the file \n");
return 1;
}
for(phi=0;phi<=pi/2;phi=phi+0.005)
{
ky=(2*pi*sin(phi))/lamda;
k11=sqrt(((Ef+h*omega)*(Ef+h*omega))/(h*h*vf*vf)-ky*ky);
k12=sqrt(((Ef-v0+h*omega)*(Ef-v0+h*omega))/(h*h*vf*vf)-ky*ky);
k01=sqrt((Ef*Ef)/(h*h*vf*vf)-ky*ky);
k02=sqrt(((Ef-v0)*(Ef-v0))/(h*h*vf*vf)-ky*ky);
phi1=atan(ky/k11);
phi0=atan(ky/k01);
ts0=(cos(phi0)*cos(phi0))/(1-cos(k02*a)*cos(k02*a)*sin(phi0)*sin(phi0));
tsn=(cos(phi1)*cos(phi1))/(1-cos(k02*a)*cos(k02*a)*sin(phi1)*sin(phi1));
//calculate the critical boundary value in A
x1=(V0-v0-Ef*sin(phi))-sqrt((v0-V0+Ef*sin(phi))*(v0-V0+Ef*sin(phi))-4*F*Q)/2/F;
x2=(V0-v0-Ef*sin(phi))+sqrt((v0-V0+Ef*sin(phi))*(v0-V0+Ef*sin(phi))-4*F*Q)/2/F;
//printf("%lf %lf %lf %lf\n", x1, x2);
//calculate the transmission coefficient
dx=(x2-x1)/1000;
for(x=x1+dx;x<=x2-dx;x=x+dx)
{
U=V0-v0-F*x-Q/x;
determine=U/h/omega;
if(determine<1)
{
T1=ts0*tsn*((2*_j1(U/h/omega))/_j0(U/h/omega))*((2*_j1(U/h/omega))/_j0(U/h/omega))*
(sin((k12-k02)*a/2)*sin((k12-k02)*a/2))/(cos(phi1)*cos(phi1))*(sin(phi0)*sin(phi1)*cos((k02+k12)*a/2)*cos((k02+k12)*a/2)+
cos((phi0+phi1)/2)*cos((phi0+phi1)/2));
Tn=Tn+T1;
}
else
{
break;
}
}
sn=Tn;
fprintf(fp,"%7.5lf \n",sn);
}
fclose(fp);
return 0;
}
No errors appear in the process of building and compile. But when i run the code on the platform VS2010, no results were obtained. Only some tips are shown at the bottom of section of output:
'my calculation.exe': Loaded 'C:\Users\liang\Documents\Visual Studio 2010\Projects\my calculation\Debug\my calculation.exe', Symbols loaded.
'my calculation.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'my calculation.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'my calculation.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'my calculation.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[4812] my calculation.exe: Native' has exited with code 1 (0x1).
I have tried many times, but always failed. Who could help me solve this problem. Thanks!