Hello, I am trying to plot the transmission coefficient vs energy for the double barrier potential, but I get an error. May I know what I have done wrong here?
6 views (last 30 days)
Show older comments
V_0 = 0.2800; % Barrier strength in eV
hbar = 1.054571596e-34; % Reduced Planck constant
m = 5.465629128e-32; % 0.06*m_e
L = 1.00000e12; % Well width of the RTD
a = 1.00000e11; % Barrier width
x = 0.2801:0.0001:0.6000;
k = @(x) sqrt(2*m*x)/hbar;
etta = @(x) sqrt(2*m*(x-V_0))/hbar;
gamma = @(x) V_0/(x*sqrt(1-(V_0/x)));
nu = @(x) (2-(V_0/x))/(sqrt(1-(V_0/x)));
b = @(x) sin(k*L);
d = @(x) sin(2*k*L);
s = @(x) sin(etta*a);
u = @(x) sin(2*etta*a);
y = @(x) (1-gamma*b^2+nu*u^2-nu*gamma^2*d*u*s^2+4*gamma^4*b^2*s^4)^(-1);
plot(x,y), xlabel('E'), ylabel('T(E)')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/767431/image.png)
0 Comments
Answers (1)
Alan Stevens
on 14 Oct 2021
See the following
V_0 = 0.2800; % Barrier strength in eV
hbar = 1.054571596e-34; % Reduced Planck constant
m = 5.465629128e-32; % 0.06*m_e
L = 1.00000e12; % Well width of the RTD
a = 1.00000e11; % Barrier width
x = 0.2801:0.0001:0.6000;
k = @(x) sqrt(2*m*x)/hbar;
etta = @(x) sqrt(2*m*(x-V_0))/hbar;
gamma = @(x) V_0./(x.*sqrt(1-(V_0./x))); %%%%%% ./ and .* %%%%%%%%
nu = @(x) (2-(V_0./x))./(sqrt(1-(V_0./x))); %%%%%% ./ and .* %%%%%%%%
b = @(x) sin(k(x)*L); % k is a function of x %
d = @(x) sin(2*k(x)*L); % k is a function of x %
s = @(x) sin(etta(x)*a); % etta is a function of x %
u = @(x) sin(2*etta(x)*a); % etta is a function of x %
y = @(x) (1-gamma(x).*b(x).^2+nu(x).*u(x).^2-... % gamma, b,nu, u etc are
nu(x).*gamma(x).^2.*d(x).*u(x).*s(x).^2+... % all functions of x
4*gamma(x).^4.*b(x).^2.*s(x).^4).^(-1); % Also note ./ and .*
plot(x,y(x)), xlabel('E'), ylabel('T(E)') % y is a function of x
2 Comments
Alan Stevens
on 15 Oct 2021
Edited: Alan Stevens
on 15 Oct 2021
I guess doublebarrier_transmission is the name of your program, but the listing above plots y(x) vs x ok.
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!