I have an FFT code that solves a particular case of the steady Euler equations where a Poisson equation is solved, what is a good way to quantify the error? Is what I am doing ok?Since I do not have an analytic solution to compare with  what I have done is I have computed the solution on a very fine grid and then computed the error as such:Let $x_f$ be the fine solution and $x_i$ the solution for coarser grids, the error for each grid $i$ is:$error_i = \frac{\|x_f-x_i\|}{\|x_f\|}$I then plot the error in a loglog plot as a function of number of grid points N. The slope ratio is 1 to 1, so would it mean the scheme is 1st order accurate?I also have the residual given by $res = \|LHS-RSH\|$ where the terms represent the left hand side minus the right hand side of the equation and have performed a similar plot, I am not sure what is the best way to interpret it though. Any help or input would be appreciated.
How can I quantify the error of FFT-based poisson solvers?
discretization;fourier analysis;error estimation
Here is a general procedure to do such error plots that I usually follow:Find such $N$ so that the solution is converged.Plot the error (for example $\frac{\|x_f-x_i\|}{\|x_f\|}$ as you did). You can use log-log plot (polynomial convergence will be a line) or log-linear plot (exponential convergence will be a line).Optionally, plot the expected convergence rate --- in your case plot the function $c N^{-1}$, where $c$ is a constant that you adjust so that this function agrees with your convergence graph for the smallest $N$ shown. If the two lines agree on your graph, then you have a first order convergence. It will be apparent from the graph once you plot it. Use $cN^{-2}$ for quadratic convergence and so on.Note about the error formula:Sometimes you can plot some value (for example an energy $E$ in the Schroedinger equation) that converges to the exact value as you increase $N$. In that case, you can just plot $E-E_{conv}$, where you determine $E_{conv}$ from the step 1.