Shapes & spaces

Nonlinear Schrodinger wave evolution calculator on a periodic interval

Evolve a periodic cubic nonlinear Schrodinger field and compare time-step refinement and mass drift.

Your numbers

Valid JSON. Initial complex samples [real,imaginary] on uniform periodic grid; iψ_t=-1/2 ψ_xx+g|ψ|²ψ.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The calculation evolves a complex wave according to i times its time derivative equal to minus one half its second spatial derivative plus g times its intensity times the wave. Stating this convention is essential because other normalizations move factors of two or reverse the nonlinear sign.

THE FORMULADeclare convention i*psi_t=-(1/2)psi_xx+g|psi|²psi. GridNpower2 periodicL. Strang step nonlinearhalf psi*=exp(-ig|psi|²dt/2), FFT, kineticfactor exp(-i k²dt/2), IFFT, nonlinearhalf. Nonlinearphaseamplitude afterkinetic appropriate. mass=h sumabs²; energy=h sum(.5abs(spectralderivative)²+.5gabsψ⁴). Compare dt/2 solution on samegrid; optionalNdouble requiresactualinterpolation andindependentcomparison, not claimedautomatically. Guardblowup/nonfinite/workcap; reporttemporalestimate notglobalerrorbound.

A worked example

With the prefilled inputs, massFinal = 2.0000000000000004. Initial complex samples [real,imaginary] on uniform periodic grid; iψ_t=-1/2 ψ_xx+g|ψ|²ψ.

Good to know

Periodic iψ_t=−½ψ_xx+g|ψ|²ψ,Strang nonlinear/kinetic splitting;direct DFT and dt/2 result returned. Spatial aliasing is unchecked; no mesh-doubling or rigorous global error certificate.

Choosing the equation convention

The calculation evolves a complex wave according to i times its time derivative equal to minus one half its second spatial derivative plus g times its intensity times the wave. Stating this convention is essential because other normalizations move factors of two or reverse the nonlinear sign.

The spatial interval is periodic: its right endpoint is identified with its left endpoint. A wave that should reflect from walls is outside this problem. Initial samples must represent a periodic complex field rather than two unrelated endpoint values.

Nonlinear Schrodinger wave evolution calculator on a periodic intervalCubic NLS: a constant field rotates in phaset = 0ψ(1) = cos1 − i sin1|ψ(x,t)| = 1constant magnitudeMass = L; energy = L/2
Scroll across to see the full diagram.
For iψt=−ψxx/2+|ψ|²ψ and initial field1, ψ(t)=exp(−it). The unit-circle phase vector at t=1 and the unchanged magnitude are exact; on L=2π, mass is2π and energy isπ.

Compare with the One dimensional wave equation calculator from initial displacement and velocity. Evolve a complexdispersive nonlinearfield withmass/Hamiltoniandiagnostics; realwaveequationhastwoinitialfieldsanddifferentdynamics.

Complex samples and resolution

Initial complex samples [real,imaginary] on uniform periodic grid; iψ_t=-1/2 ψ_xx+g|ψ|²ψ.Enter thirty-two, sixty-four or one hundred twenty-eight equally spaced complex samples as real and imaginary pairs. The repeated endpoint is omitted. A positive interval length determines the Fourier frequencies, and the nonlinear coefficient is limited in magnitude to twenty; all inputs belong to the declared dimensionless normalization.

This implementation uses a direct discrete Fourier transform, so the work budget is tied to the number of steps times the square of the grid size. The cap is twenty million for that product. A supported sample count does not ensure that a narrow pulse or nonlinear high-frequency content is spatially resolved.

Splitting the two exactly solvable flows

The kinetic flow is diagonal in Fourier coordinates: each frequency receives a unit-modulus phase factor. The nonlinear flow is diagonal in physical coordinates and changes each sample's phase according to its intensity. Neither isolated step changes the corresponding sample norm.

A symmetric step applies half the nonlinear flow, a full kinetic flow and the remaining nonlinear half. This ordering gives second-order temporal accuracy under appropriate smoothness. Using an old intensity after the kinetic step would not implement the same nonlinear subflow.

Mass and temporal refinement diagnostics

Discrete mass is the grid spacing times the sum of squared magnitudes. The nonlinear phase step and the consistently normalized transform flow preserve it up to arithmetic error. The result reports initial mass, final mass and their difference; this release does not calculate or display an energy-conservation diagnostic.

The solver performs the requested step size and a second evolution with half that size for twice as many steps. It returns the finer final samples together with the L2 difference between those two evolutions. That difference measures time-step sensitivity on one spatial grid, not a rigorous global error bound or a spatial-aliasing estimate.

A constant-wave worked example

Start with the constant field one, choose g equal to one and evolve for one unit of time. Its kinetic contribution vanishes because only the zero Fourier frequency is present. The exact solution at every node is exp of minus i times time.

At time one the real part is about 0.540302306 and the imaginary part about minus 0.841470985. On an interval of length two pi, mass is two pi. More generally a constant unit field has mass equal to the entered length. The prefill uses length two and total time0.02, so every final sample should equal cos0.02 minus i sin0.02, with mass approximately two.

Reading the wave figure

Plot magnitude and phase or real and imaginary components with explicit labels. Magnitude alone can look unchanged even when the phase has evolved substantially. A static comparison of the initial and final profiles makes that distinction visible without using decorative reveal animation.

Phase near a zero amplitude is intrinsically unstable as a plotted quantity. A sudden displayed jump may reflect branch wrapping rather than a physical discontinuity. The figure should avoid connecting phase values blindly across a branch cut or a nearly vanishing sample.

When to refine or stop

Reduce the time step when the coarse-to-fine L2 difference is too large for the intended exploration. Spatial refinement is a separate user comparison: this release does not double the grid, interpolate the data automatically or estimate unresolved Fourier tails. It likewise does not present an energy-drift test, so conserved mass must not be mistaken for a complete accuracy certificate.

Nonfinite input or evolution beyond the bounded DFT budget requires a clear failure. The model remains periodic, one-dimensional and cubic, with no reflecting-wall condition or physical calibration supplied automatically. Its useful output is the finer sampled wave and transparent temporal and mass diagnostics for precisely that entered system. Periodic iψ_t=−½ψ_xx+g|ψ|²ψ,Strang nonlinear/kinetic splitting;direct DFT and dt/2 result returned. Spatial aliasing is unchecked; no mesh-doubling or rigorous global error certificate.

A few questions, answered

Why does a constant wave still change?

Its nonlinear phase evolves even when its magnitude and spatial derivative are constant.

Does conserved mass prove the solution is accurate?

No; phase error and spatial aliasing can remain. This release reports mass drift and a half-time-step comparison, not energy drift or a grid-refinement estimate.

Can this model use fixed reflecting walls?

No; this version identifies the two interval endpoints periodically.

Is the time-step comparison a rigorous error bound?

No; it is a temporal sensitivity estimate on the selected spatial grid.

Find your calculator

Start typing to explore the library.