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 vues (au cours des 30 derniers jours)
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)')

Réponses (1)

Alan Stevens
Alan Stevens le 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 commentaires
Craig Egan Allistair Tan
Craig Egan Allistair Tan le 15 Oct 2021
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 le 15 Oct 2021
Modifié(e) : Alan Stevens le 15 Oct 2021
I guess doublebarrier_transmission is the name of your program, but the listing above plots y(x) vs x ok.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by