Difference between revisions of "Analysis of MLSM performance"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
Line 71: Line 71:
 
rapidly. Care from the user side must be taken, to choose $\sigma$
 
rapidly. Care from the user side must be taken, to choose $\sigma$
 
appropriately, with respect to plot above.
 
appropriately, with respect to plot above.
 +
 +
[[File:diffusion3d.png|800px]]

Revision as of 15:10, 20 October 2016

For starters, we can solve simple Diffusion equation $ \nabla^2 u = \frac{\partial u}{\partial t} $.

We solved the equation on a square $\Omega = [0, a] \times [0, a]$ with Dirichlet boundary conditions $ \left. u\right|_{\partial \Omega} = 0 $ and initial state $ u(t = 0) = 1$.

An analytical solution for this domain is known, and we use it to evaluate or own solution. \begin{equation} u(\vec{p}, t) = \sum_{\substack{n=1 \\ n \text{ odd}}}^\infty\sum_{\substack{m=1 \\ m \text{ odd}}}^\infty \frac{1}{\pi^2} \frac{16 a^2}{nm} \sin\left(\frac{\pi n}{a}p_x\right) \sin\left(\frac{\pi m}{a}p_y\right) e^{-\frac{\pi^2 (n^2+m^2)}{a^2}t} \end{equation} Because the solution is given in the series form, we only compare to the finite approximation, summing to $N = 100$ instead of infinity.

A picture of our solution (with smaller and larger node density):

Square heat.png

Analysis of our method

Convergence with respect to number of nodes

Node convergence.png

We tested the method with a fixed time step of $ \Delta t = 1\cdot 10^{-5}$ on a unit square ($a = 1$). Monomial basis of $6$ monomials was used and $12$ closest nodes counted as support for each node. After more than $250$ nodes of discretization in each dimension the method diverges, which is expected. The stability criterion for diffusion equation in two dimensions is $\Delta t \leq \frac{1}{4} \Delta x^2$, where $\Delta x$ is the spatial discretization step in one dimension. In our case, at $250$ nodes per side, the right hand side yields $\frac{1}{4}\cdot\frac{1}{250}\cdot\frac{1}{250} = 4\times 10^{-6}$, so our method is stable within the expected region.

Node convergence 5.png

Above is another image of convergence, this time using monomial basis $\{1, x, y, x^2, y^2\}$ and Gaussian basis with discretization step $ \Delta t = 5 \cdot 10^{-6}$ and 5 support nodes. Total node count was $N = 2500$. Error was calculated after $0.01$ time units have elapsed.

Convergence with respect to number of time steps

Timestep convergence.png

We tested the method on a fixed node count with different time steps on the same domain as above. For large time steps the method diverges, but once it starts converging the precision increases steadily as the time step decreases, until it hits its lower limit. This behaviour is expected. The error was calculated against the analytical solution above after $0.005$ units of time have passed. A monomial basis up to order 2 inclusive ($m = 6$) was used and the support size was $n = 12$.

Using Gaussian basis

Gauss sigma dependence.png

We tested the method on a fixed node count of $N = 2500$ with spatial step discretization of $\Delta x = \frac{1}{50}$. We used the Gaussian basis of $m = 5$ functions with support size $n = 13$. Error was calculated against analytical solution above after 0.01 time units. A time step of $\Delta t = 10^{-5}$ was used.

As we can see from the graph, there exists an interval where the choice of $\sigma$ does not matter much, but outside of this interval, the method diverges rapidly. Care from the user side must be taken, to choose $\sigma$ appropriately, with respect to plot above.

Diffusion3d.png