MATLAB Code: Stationary Schrodinger EQ, E Spec, Eigenvalues

In summary, the code creates three wave functions for a hydrogen atom. The wave function for the ground state is at the bottom, the wave function for the first excited state is in the middle, and the wave function for the second excited state is at the top.
  • #1
Baynie
2
1
Hello everyone,

For weeks I have been struggling with this quantum mechanics homework involving writing a code to determine the energy spectrum and eigenvalues for the stationary Schrodinger equation for the harmonic oscillator. I can't find any resources anywhere. If anyone could help me get started, get my matrices and equations set up, or has worked a similar problem/written a similar code before, any help would be greatly appreciated! Thanks in advance!

Homework Statement


media%2F942%2F942060f1-5b27-46f2-99b7-97012f312b07%2Fimage.png

media%2F790%2F790771bf-5a8e-4cc4-a1d7-a160db35df91%2Fimage.png

Homework Equations


Included in image above

The Attempt at a Solution


Her is the code I have written so far. I'm not sure if this is even close or on the right track
% Stationary Schrodinger Equation - QHO

clear
clc

hbar = 6.58E-16;
f = 400E-9;
w = 2*pi*f;
m = 1;
N = 101;
a = 0.1;
n = 1:N;
r = n*a;
l = 1;
x = a;
mwhbar = m*w*hbar;
y = r;

% Operators (Matrices)
T = diag(-1*ones(1,N-2),2) + diag(2*ones(1,N-1),1) + diag(-1*ones(1,N),0);
K = (1/(2*a^2)) * T; % Kinetic Energy Matrix

Veff = -(1./r) + l*(l + 1)./(2*(r.^2));
V = diag(Veff);
U = (1/(2*a^2)) * V; % Potential Energy Matrix

% Equations
H = -(1/2*a^2)*(eigen_f(n+1) - 2 * eigen_f(n) * eigen_f(n-1));
 

Attachments

  • media%2F942%2F942060f1-5b27-46f2-99b7-97012f312b07%2Fimage.png
    media%2F942%2F942060f1-5b27-46f2-99b7-97012f312b07%2Fimage.png
    49.6 KB · Views: 1,049
  • media%2F790%2F790771bf-5a8e-4cc4-a1d7-a160db35df91%2Fimage.png
    media%2F790%2F790771bf-5a8e-4cc4-a1d7-a160db35df91%2Fimage.png
    83.8 KB · Views: 806
Physics news on Phys.org
  • #2
UPDATE:

Here is an update on the code I've been working on. It is probably closer to where I'm supposed to be headed. I just have problems when it comes to calculating V and Veff clear
clc

N = 101;
a = .01;
n = 1:101;
r(1:N) = n.*a;
l = input('Enter angular quantum number l: ');
T = zeros(N);
V = zeros(N);
Veff = zeros(N);for i = 1:N
for j = 1:N
if i == j
T(i,j) = 2/(2*a^2);
elseif i == j-1 || j == i-1
T(i,j) = -1/(2*a^2);
end
end
endfor i = 1:N
Veff(i,i) = (1/r) + (l*(l+1))./(2.*r.^2);
V(i,i) = V(i,i).*Veff;
end

H = T + V;

[Psi,Energy] = eig(H);

E = diag(Energy);

fprintf('Lowest Eigenvalues:\n');
disp(E(1:3))Psi_0 = Psi(:,1);
Psi_0_Squared = Psi_0.^2;

Psi_1 = Psi(:,2);
Psi_1_Squared = Psi_1.^2;Range_a = a:a:N*a;Integral_0 = trapz(Range_a,Psi_0_Squared);
Integral_1 = trapz(Range_a,Psi_1_Squared);Normalized_Psi_0 = 1/sqrt(Integral_0)*Psi_0;
Normalized_Psi_1 = 1/sqrt(Integral_1)*Psi_1;

subplot(3,1,1);
plot(Range_a,Normalized_Psi_0,'r');
title('Wave Function: Ground State Hydrogen Atom');
xlabel('x');
ylabel('Psi_0(x)');subplot(3,1,2);
plot(Range_a,Normalized_Psi_1,'r');
title('Wave Function: First Excited State Hydrogen Atom');
xlabel('x');
ylabel('Psi_1(x)');subplot(3,1,3);
plot(Range_a,Normalized_Psi_1,'r');
title('Wave Function: First Excited State Hydrogen Atom');
xlabel('x');
ylabel('Psi_2(x)');
 

1. What is MATLAB Code: Stationary Schrodinger EQ?

MATLAB Code: Stationary Schrodinger EQ is a computer program written in the MATLAB programming language that solves the stationary Schrodinger equation, which is a fundamental equation in quantum mechanics that describes the behavior of a quantum system over time.

2. What is the purpose of solving the stationary Schrodinger equation?

The purpose of solving the stationary Schrodinger equation is to determine the allowed energy levels and corresponding wavefunctions of a quantum system. This information is crucial in understanding the behavior and properties of the system.

3. What is E Spec in relation to the stationary Schrodinger equation?

E Spec, or the expectation value of energy, is a key concept in quantum mechanics and is related to solving the stationary Schrodinger equation. It represents the average energy of a quantum system in a particular state.

4. What are eigenvalues in the context of the stationary Schrodinger equation?

Eigenvalues are the allowed energy levels of a quantum system, which are determined by solving the stationary Schrodinger equation. Each eigenvalue corresponds to a specific wavefunction and represents a possible energy state of the system.

5. How is MATLAB Code: Stationary Schrodinger EQ used in scientific research?

MATLAB Code: Stationary Schrodinger EQ is used by scientists in various fields, such as physics, chemistry, and materials science, to model and analyze quantum systems. It allows researchers to accurately calculate and predict the properties and behavior of these systems, leading to a better understanding of the fundamental laws of nature.

Similar threads

  • Advanced Physics Homework Help
Replies
5
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
917
  • Advanced Physics Homework Help
Replies
6
Views
3K
  • Advanced Physics Homework Help
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
3
Views
5K
  • Advanced Physics Homework Help
Replies
9
Views
870
  • Advanced Physics Homework Help
Replies
6
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
Back
Top