The modified equation of linear PDEs can be found in a systematic manner (https://www.sciencedirect.com/science/article/pii/0021999174900114). However, it does not seem to be that easy for nonlinear PDEs. The references I found about modified equations for nonlinear PDEs are not very specific and just state that the process involves lots of algebra.
I'm trying to find the modified equation of the KdV equation
$u_x + uu_x + u_{xxx} = 0$
using the standard discretitzation scheme:
$(u_j^{k+1}-u_j^{k-1})/2\tau + (u_{j+1}^k+u_j^k+u_{j-1}^k)(u_{j+1}^k-u_{j-1}^k)/6h + (u_{j-2}^k-2u_{j+1}^k+2u_{j-1}^k-u_{j-2}^k)/2h^3=0 $
When I start eliminating the 3rd time-derivative with the same approach as in the linear case, the number of terms starts blowing up. Trying to eliminate those creates even more inconvenient terms and I haven't found a systematic way to solve this problem.
Any comments are very much appreciated!
I guess the first term in the PDE should read $u_t$, otherwise the discretization makes no sense. Furthermore, I do not see why $$uu_x \approx (u_{j+1}^k+u_j^k+u_{j-1}^k)(u_{j+1}^k-u_{j-1}^k)/6h $$ should hold. If you use second order central finite differences you get $$uu_x \approx u_j^k \frac{u_{j+1}^k - u_{j-1}^k}{2 h}$$ In the discretization of $u_{xxx}$ an index and the signs are wrong: $$u_{xxx} \approx \frac{- u_{j-2}^k + 2u_{j-1}^k - 2u_{j-1}^k +u_{j+2}^k }{2 h^2}$$
In total your equation reads then $$\frac{u_j^{k+1} - u_j^{k-1}}{2 \tau} + u_j^k \frac{u_{j+1}^k - u_{j-1}^k}{2 h} + \frac{- u_{j-2}^k + 2u_{j-1}^k - 2u_{j-1}^k +u_{j+2}^k }{2 h^2} = 0$$