Starlight Tools

Physics · Quantum mechanics · Client-side calculator

Particle in a Box Calculator: 1D Schrödinger Equation Solver

Compute infinite square-well energies, wavelengths, normalized wavefunctions, and visualize |psi(x)|^2. Adjust length units, particle preset, mass, and quantum number to see how the ladder changes.

Setup

1

Selected state (n = 1)

Energy E_n (J)
E_n = n^2 h^2 / (8 m L^2)
Energy E_n (eV)
Uses 1 eV = 1.602e-19 J
Wavelength lambda_n
lambda_n = 2L / n (one spatial period)
Nodes
Nodes = n − 1 (excluding walls)
Energy vs ground (n=1)

Energy ladder

Energy levels table

n Energy J Energy eV Wavelength Nodes

Wavefunction & probability density

psi_n(x) = sqrt(2/L) sin(n pi x/L). The probability curve is rescaled so |psi|^2 peaks at 1.

Advertisement

Release Updates

v1.1 (May 18, 2026)

  • Added particle presets for electron, proton, neutron, and hydrogen atom.
  • Added length units for m, nm, Å, and pm, with 1 nm as the default setup.
  • Added an energy levels table with copy buttons and CSV export for student-friendly results.
  • Expanded the learning content with a worked example, derivation, FAQ, and reference links.

Example: electron in a 1 nm box

For an electron confined to a 1 nm infinite square well, the ground-state energy is:

E₁ ≈ 0.376 eV

The third level is E₃ = 9E₁ ≈ 3.38 eV, because energy scales with n². This is why nanoscale confinement can create energy gaps large enough to matter in semiconductor and quantum-dot systems.

How this solver works

This Schrödinger equation solver is a visual particle-in-a-box calculator for the 1D infinite square well. It calculates the allowed energy levels and wavefunctions for a particle trapped in an infinite square well, then plots the wavefunction and the probability density so you can see what the math means. Think of it as a guided look at how quantum confinement creates discrete, ladder-like energy states instead of a smooth, continuous spectrum.

The model assumes perfectly rigid walls at x=0 and x=L. Inside the box, the Schrodinger equation becomes a standing-wave problem, so only specific sine-wave patterns are allowed. Each pattern is labeled by the quantum number n. As n increases, the wavefunction gains more nodes and the energy grows with n squared. The calculator uses the standard formulas for a 1D infinite square well to show the energy E_n in joules and electron volts, the wavelength for that mode, and the normalized wavefunction psi_n(x) along with |psi_n(x)|^2.

To use the calculator, start by entering the box length L and the particle mass. You can choose a common particle or enter a custom value, then pick the quantum number n you want to examine. Press Solve to update the energy readout, the energy ladder, and the plots. The ladder compares relative energy levels up to the number you select, while the graph shows the wavefunction shape and the probability density, which indicates where the particle is most likely to be found.

This tool is useful for building intuition about quantum wells and related systems. The same ideas appear in semiconductor quantum dots, nanowires, and thin films where electrons are confined to tiny regions. Students often use the particle-in-a-box model to understand why smaller systems have higher energy gaps, why heavier particles have lower energies, and how standing waves translate into measurable probabilities. Since everything runs in your browser, it is a quick, private way to explore the Schrodinger equation without setup or downloads.

Derivation of the 1D particle-in-a-box energy levels

1. Define the potential

The infinite square well has V(x)=0 inside the box from x=0 to x=L, while V(x) is infinite outside the box. The particle can exist only inside the well.

2. Apply the boundary conditions

The wavefunction must be zero at both walls, so psi(0)=0 and psi(L)=0. Those boundary conditions allow only standing sine waves that fit an integer number of half-wavelengths inside the box.

3. Normalize the wavefunction

Normalization requires the total probability across the box to equal 1. That gives psi_n(x)=sqrt(2/L) sin(n pi x/L), where n is a positive integer.

4. Calculate the allowed energies

Each allowed standing wave has wavelength lambda_n=2L/n. Substituting the corresponding momentum into the kinetic-energy expression gives E_n = n²h² / 8mL².

FAQ

What does this Schrödinger equation solver calculate?

It solves the 1D infinite square well, also called the particle-in-a-box model.

Is this a general Schrödinger equation solver?

No. It focuses on the analytic particle-in-a-box case rather than arbitrary potentials or time-dependent wavefunctions.

What is the formula for particle-in-a-box energy?

E_n = n²h² / 8mL².

Why does energy increase as the box gets smaller?

Because E is proportional to 1/L², stronger confinement produces higher allowed energies.

How many nodes does the nth wavefunction have?

The nth state has n − 1 internal nodes, excluding the walls.

Sources and references

Quick quantum facts

No degeneracy here

In a 1D box, each n is unique. Higher n simply adds nodes and raises energy by n^2.

n^2 scaling

Shorter box = higher energies

Cut L in half and the whole ladder rises by 4x. Stronger confinement raises the allowed energies.

E ∝ 1/L^2

Probability piles at antinodes

|psi|^2 is largest where the sine peaks. For odd n, the center is a maximum; for even n, it is a node.

Standing waves

Real boxes leak

Finite wells allow tunneling and change the energies. This ideal model is the clean textbook limit.

Idealization

Use it for intuition

The same math powers quantum dots, nanowires, and the particle-in-a-ring/2D well variants.

Nanotech link

Explore more tools