Coder Social home page Coder Social logo

nightlan1015297 / finite-square-well Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenyingshan1114/finite-square-well

0.0 0.0 0.0 107 KB

Use Newton's method to calculate the eigenenergy of a finite square well system.

C++ 72.26% Python 27.74%

finite-square-well's Introduction

C++ Finite Square Well In quantum mechanics, the energy eigenvalues of finite potential square well is given by transcendental equation. Therefore, it can be solved numerically, using a computer or graphically. In this file, one-variable Newton's method is used to find the roots of eigenenergys.

System conditions

Consider an electron in a quantum square well potential of depth $V=-13.6 \ \mathrm{eV}$ and half-width $a=20a_0$ where $a_0$ is the Bohr radius.

Energy Equations

The energy eigenvalues, $E>V$, are given by the transcendental equations. For the odd states,

$$\sqrt{-E} = \sqrt{E-V}\tan\left(\frac{a}{\hbar}\sqrt{2m(E-V)}\right)$$

, and the even states

$$\sqrt{-E} = -\sqrt{E-V}\cot\left(\frac{a}{\hbar}\sqrt{2m(E-V)}\right)$$

Newton's Method

The Newton's method is a way to solve for $x^*$ such that $f(x^*)=0$. It is based on Taylor expansion of a general function $f(x)$ around the root $x^*$. Suppose that there is an initial guess near the root called $x_1$, and the error may be written as $\delta x=x_1-x^*$. Then, the Taylor expansion of $f(x^*)$ is

$$f(x^*) = f(x_1 - \delta x) = f(x_1) - \delta x \frac{df(x_1)}{dx} + O(\delta x^2)$$

and it can also be written as

$$\delta x = \frac{f(x_1)}{f'(x_1)} + O(\delta x^2)$$

where $O(\delta x^2)$ term can be viewed as the truncation error. $\delta x$ can be used to correct the initial guess

$$x_2 = x_1 - \delta x = x_1 - \frac{f(x_1)}{f'(x_1)}$$

Therefore, this procedure may be iterated as

$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$$

to improve our guess further until the desired accuracy is obtained. Otherwise, the equation can modified as

$$x_{n+1} = x_n - r\frac{f(x_n)}{f'(x_n)}$$

where $0 < r < 1$ to decrease the distance between $x_{n+1}$ and $x_{n}$ and find the root closest to out initial guess.

Initial Guess

The eigenenergys of an infinite square well with the same width is

$$E_n = \frac{n^2\pi^2 \hbar^2}{8ma^2} - 13.6$$

Use the value of each $n$ as the initial guess of the finite square well.

finite-square-well's People

Contributors

chenyingshan1114 avatar nightlan1015297 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.