Reality is that which, when you stop believing in it, doesn’t go away.

― Philip K. Dick

I applied the smoothed operators to the actual solution of a scalar advection law, and wanted to show how the methods impact the solution. This should put the discussion of the past couple of weeks into a bit sharper and more relevant focus. We can also explore the impact of the degree of regularization chosen in the smoothing. The good things below are finding out that my analysis seems to completely coincide with the results, and in that case the results are the lowest error and highest quality solution. More surprisingly, the best result is obtained with a smoothed function, not the original discontinuous ones!

We will solve the scalar advection equation $u_t + u_x = 0$ for a square wave on a mesh of 200 cells in one dimension using a Sweby version of Fromm’s scheme. The solution will do one rotation on the grid using 400 time steps. I’ll plot the solution and the error plus display the L1, L2 and L-infinity norms of the error.

First with the standard unsmooth functions.

Error= 0.0314099 0.00649721 0.438233

Now with smooth functions all based on using the $\mbox{softsign}(x) = \tanh(10 x)$ and $\mbox{softabs}(x) = x\tanh(10 x)$.

Error= 0.0313124 0.00648103 0.4384

Now with smooth functions all based on using the $\mbox{softsign}(x) = x/(|x| + 0.1)$ and $\mbox{softabs}(x) = x^2 /(|x| + 0.1)$.

Error= 0.0350856 0.00694473 0.454124

Now with smooth functions all based on using the $\mbox{softsign}(x) = x/(|x| + 0.1)$ and $\mbox{softabs}(x) = |x| + 0.1$.

Error= 0.0257311 0.00578931 0.420996

What we see is that the smoothed operators produce high quality and lower error solutions in most cases. The one case with the linear version of the smoothed sign function the larger error is supported by the analysis I gave last week. Generally as the regularization allows the function to come as close as we might like to the original functions.

Advertisements