This program solves the Cahn Hilliard equation using the an implicit pseudospectral method.
The Cahn-Hilliard equation is defined as
with M being a mobility and the functional of free-energy given by
where is a parameter related to the interfacial energy and is the bulk free-energy density given by
where W is the height ot the thermodynamic barrier.
The following figure is a result for the system with M=1.0, W=2.0, , dx=0.1, dt=0.01. The initial condition is given by a normal distribution
And the system is evolved until N = 2000 steps.