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?

9 次查看(过去 30 天)
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)')

回答(1 个)

Alan Stevens
Alan Stevens 2021-10-14
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 个评论
Craig Egan Allistair Tan
I have no issues getting the plots of k(x), etta(x), gamma(x), and nu(x) vs x, but if I try to plot y(x) vs x or even b(x) vs x, I get an error, and this is the error message that will pop up. How do I fix this? Thanks for the help, by the way.
Alan Stevens
Alan Stevens 2021-10-15
编辑:Alan Stevens 2021-10-15
I guess doublebarrier_transmission is the name of your program, but the listing above plots y(x) vs x ok.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by