Exercise (Nonlinear oscillator for a complex field).
Consider a field ψ∈C satisfying the equation
idψdt=−ωψ+g|ψ|2ψ.
(a) Find analytically a solution of this equation when (i) g=0 and (ii) g≠0. [Hint. Note that d|ψ|2/dt=0.]
(b) Show by explicit calculation that Eq. (1) can be written as
idψdt=∂E∂ψ∗
where star (*) denotes complex conjugation and E is an energy function,
E=g2|ψ|4−ω|ψ|2.
(c) Write explicitely the equation
idψdt=(1−i)∂E∂ψ∗
and prove that dE/dt≤0.
(d) Write code to solve numerically Eq. (3) with arbitrary initial condition ψ(t=0)=ψ0 and relate your result to the solution found in (a).
[Hint. You may use Euler's method for numerical integration.]