d^{3} r\,  \Bigg[ \frac{A}{2} \left( S^{(3)}({\mathbf{r}}) \right)^{2} + \frac{B}{4}  \left( S^{(3)}({\mathbf{r}}) \right)^{4} \nonumber \\ && + \frac{C}{2} \left( \nabla S^{(3)}({\mathbf{r}}) \right)^{2} - D E({\mathbf{r}}) S^{(3)}({\mathbf{r}}) \Bigg].\end{aligned}$$ $E({\mathbf{r}})$ is the electric field, $A$, $B$, $C$ and $D$ are the LGD coefficients that describe the material, and $\eta$ is the inverse volume of a unit cell. Minimizing equation  with respect to $S^{(3)}({\mathbf{r}})$ gives the familiar equation $$\label{Fmin}
0 = A S^{(3)}({\mathbf{r}}) + B \left( S^{(3)}({\mathbf{r}})\right)^{3} -C \nabla^{2} S^{(3)}({\mathbf{r}}) - D E({\mathbf{r}}),$$ which can be solved for the pseudospin. The critical temperature is set by $A$, which changes sign at the ferroelectric transition, while $B$ determines the zero-temperature polarization. In the paraelectric phase, $D$ is determined by the dielectric susceptibility and $C$ and $A$ set the correlation length $\xi=\sqrt{C/A}$.

We expand equation  in powers of $h_{i}^{(3)}$ to obtain $$\label{expand_2}
S^{(3)}_i = \frac{S f_S (\Omega)}{\Omega} h^{(3)}_i + \frac{1}{2 \Omega} \left( \frac{d}{d\Omega} \frac{Sf_{S}(\Omega)}{\Omega} \right) \left( h^{(3)}_{i} \right)^{3},$$ where ${h}_i$ and $h_i^{(3)}$ are defined by equation . To proceed further, we note that the discretized second derivative of a function $f_j=f(x_j)$ is $$\left . \frac{d^{2}f(x) }{dx^{2}} \right |_{x=x_j} \approx \frac{f_{j-1} - 2f_j + f_{j+1}}{a^{2}}.$$ Then, equation  can be re-written as $$h^{(3)}_i = \frac{J_0}{S} S^{(3)}_i + \frac{J_1}{S} 