This program solves the time-independent Schrodinger equation for an infinite one-dimensional potential well using the Runge-Kutta method of order 4 and the secant method to determine the energy levels. The program also visualizes the wave function and probability density function.
To use this program, you will need to have the following dependencies installed:
- numpy
- matplotlib
You can install these packages by running:
pip install numpy matplotlib
The program can be run by executing the script in a python environment. Upon running the program, the user will be presented with a menu of options:
- Show the wave function and probability density function graph
- Show energy levels
- Exit
The user can select an option by inputting the corresponding number.
The following constants are used in the program:
m
: electron mass (9.1094e-31 kg)
hbar
: reduced Planck constant (1.0546e-34 Js)
e
: electron charge (1.6022e-19 C)
L
: length of the potential well (5.2918e-11 m)
N
: number of iterations desired (1000)
h
: step size (determined by L and N)
Function Descriptions
V(x)
: The potential energy function of the system. In this case, it is set to a constant value of 0.0.
f(r,x,E)
: The right-hand side of the time-independent Schrödinger equation.
rungeKutta4Orde2(Epred)
: The Runge-Kutta method of order 4 for solving the time-independent Schrödinger equation.
secantEnergi(Epred)
: The Secant method for determining the energy levels of the system.
pilihan1(Ehasilmain)
: The first menu option for displaying the wave function and probability density graph.
pilihan2()
: The second menu option for displaying the energy levels of the system.
printMenu()
: function to display the menu
The potential function used in the program is a infinite one-dimensional potential well. The potential function is defined as:
def V(x): return 0.0
This function can be modified to implement other potentials.
The physical constants and parameters used in the program (mass of the electron, reduced Planck constant, electron charge, and length of the potential well) are set to approximate values for the hydrogen atom. The values can be modified to suit the desired system.
The program uses the Runge-Kutta method of order 4 and the secant method to solve the time-independent Schrodinger equation and determine energy levels. The program uses matplotlib to visualize the wave function and probability density function.