Bonnor-Ebert is a simple C++ program that solves the Bonnor-Ebert differential equation
with two possible algorithms: Euler and classic Runge-Kutta. The output file Bonnor-Ebert_Eulero.dat
/ Bonnor-Ebert_RK.dat
contains also the values of the first derivate ψ'(ξ)
, concentration parameter g_0
and f_0
.
This data may be easily visualize thanks to the Jupyter Notebook file Bonnor-Ebert.ipynb
.
In order to build the software from the source code here provided, you will need:
cmake
(version >= 3.12);- A
C++17
compiler;
This project uses the header-only Argh!
library, which is already included in this repository in include/argh.h
;therefore, you do not need to install it on your system.
First of all, copy the source code provided in this repository on your OS. You may clone the repository where it is built in, running in the command line
git clone https://github.com/foglienimatteo/BonnorEbert
or download the source code from the webpage https://github.com/foglienimatteo/BonnorEbert.
Hereafter, run the following shell commands from the project directory:
mkdir build
cd build
cmake ..
make
The executable file Bonnor_Ebert
is generated in the build
directory.
In order to execute the Bonnor_Ebert
file (inside the build
directory), the syntax is the standar one:
./Bonnor_Ebert {euler/rungekutta} [options]
The command euler
tells the program to solve the differential equation with the Euler method, while rungekutta
with the classic Runge-Kutta one. You have to specify which between these two algorithms must be used.
The actual available options, for both euler
and rungekutta
commands, are the following:
-h, --help
: print the help message;-s <step>, --step=<step>
: set the step measure to be used solving the differential equation;-b <begin>, --begin=<begin>
: set the beginning value ofξ
, where the algothims starts;-e <end>, --end=<end>
: set the ending value ofξ
, where the algorithm ends;-c <cut>, --cut=<cut>
: set theξ
value at which we wants to cut the Bonnor-Ebert sphere.
Depending on the algorithm choosen, the output file (saved in the build
directory) will be Bonnor-Ebert_Eulero.dat
or Bonnor-Ebert_RK.dat
.
For each of these files, the output data are organized in 6 columns; from left to right, they are:
- the iteration index of the algorithm
i=0,1,2,...
- the corresponding
ξ
value - the function value in that point, i.e.
ψ(ξ)
- the first function derivate in that point, i.e.
ψ'(ξ)
- the concentration parameter
g_0
if the cut of the Bonnor-Ebert sphere occurs atξ_0=ξ
; - the parameter
f_0
if the cut of the Bonnor-Ebert sphere occurs atξ_0=ξ
;
In a table form, the data are disposed like this:
0 | 0.0001 | 0 | 0 | 0.9999 | 0 |
1 | 0.00011 | 0 | 1e-05 | 0.99989 | 1.21e-13 |
2 | 0.00012 | 1e-10 | 1.81818e-05 | 0.99988 | 2.61818e-13 |
3 | 0.00013 | 2.81818e-10 | 2.51515e-05 | 0.99987 | 4.25061e-13 |
... | ... | ... | ... | ... | ... |
Here we rememeber the definition of g_0
and f_0
:
In the main directory, it is provided a JupyterLab Notebook, called Bonnor-Ebert.ipynb
, where the skeleton of the data plotting and analysis is provided.
Unfortunately, the notous curl in the p_0/p_s
vs (R_0/R_s)^3
does not appear clearly, probably for a computational mistake somewhere in the source code.
The original equation can be rewrited in this simple system:
So, with the basic treatment of the differential equation numerical solutions:
Bonnor-Ebert is free software, and it is released under version 3 of the GNU General Public License.
Thanks goes to these wonderful people (emoji key):
Matteo Zeccoli Marazzini 🤔 🔧 |
This project follows the all-contributors specification. Contributions of any kind welcome!