|
|
|
# Introduction
|
|
|
|
The ASLDA functional contains terms that may be a source of numerical instabilities. See [here](https://gitlab.fizyka.pw.edu.pl/wtools/wslda/-/wikis/Functionals#stabilization-of-aslda-functional) for more info. In this tutorial, we present a practical method of dealing with such problems.
|
|
|
|
The ASLDA functional contains terms that may cause numerical instability. See [here](Functionals#stabilization-of-aslda-functional) for more info. In this tutorial, we present a practical method of dealing with such problems.
|
|
|
|
|
|
|
|
# Inspecting the initial state
|
|
|
|
|
|
|
|
In order to obtain stable integration, one needs to set correct in `predefines.h` values of
|
|
|
|
In order to obtain stable integration, one needs to set the correct values in `predefines.h` values of
|
|
|
|
```c
|
|
|
|
#define SLDA_STABILIZATION_RETAIN_ABOVE_DENSITY 1.0e-5
|
|
|
|
#define SLDA_STABILIZATION_EXCLUDE_BELOW_DENISTY 1.0e-7
|
| ... | ... | @@ -15,11 +15,11 @@ One can do this by inspecting the initial state. In the examples below, we study |
|
|
|
|
|
|
|
The aim is to retain the intact region where a physics of interest happens and remove the region where density attains small values.
|
|
|
|
|
|
|
|
# Testing the stabilizator
|
|
|
|
In the plot below we present the total energy evolution as we run the simulation. The curves correspond to different settings of the stabilization parameters. It is clearly seen that the energy is conserved once the parameters are set correctly, in this case:
|
|
|
|
# Testing the stabilizer
|
|
|
|
In the plot below, we show the total energy evolution as the simulation runs. The curves correspond to different settings of the stabilization parameters. It is clearly seen that the energy is conserved once the parameters are set correctly, in this case:
|
|
|
|
```c
|
|
|
|
#define SLDA_STABILIZATION_RETAIN_ABOVE_DENSITY 5.0e-4
|
|
|
|
#define SLDA_STABILIZATION_EXCLUDE_BELOW_DENISTY 5.0e-6
|
|
|
|
```
|
|
|
|
Otherwise, we may get unstable integration after some time, which typically is manifested as non-conservation of the energy or particle number.
|
|
|
|
Otherwise, we may experience unstable integration over time, typically manifested as non-conservation of energy or particle number.
|
|
|
|
 |