tui for probabilistic evolution theory solution of ordinary differential equations with multinomial right-hand-sides
This program solves the initial value problem of ordinary differential equations with multinomial right-hand-side functions. Four different initial value problems are put in the source code. The code can be manipulated to accomodate other initial value problems with multinomial right-hand-sides.
The calculations are performed using rational arithmetic. In this way, error accumulation because of finite nature of double arithmetic is avoided.
ODE preset is for choosing the initial value problem. The ODEs are van der Pol, quartic anharmonic oscillator, Henon-Heiles and Rabinovich-Fabrikant. All initial values for all functions are taken as 1/2.
The ODEs are given below.
The van der Pol ODE is
where there are two sought functions. The definition
can be used to rewrite in the form
using the heuristic H4 used in beam search for pure quadratization. We will take
The Quartic anharmonic oscillator ODE is
where there are two sought functions. The definition
can be used to rewrite in the form
using the heuristic H4 used in beam search for pure quadratization. We will take
The Henon-Heiles ODE is
where there are four sought functions. The definition
can be used to rewrite in the form
using the heuristic H4 used in beam search for pure quadratization. We will take
The Rabinovich-Fabrikant ODE is
where there are two sought functions. The definition
can be used to rewrite in the form
using the heuristic H4 used in beam search for pure quadratization. We will take
t_max is for choosing the maximum time. The system gives the solution between 0 and t_max in 10 equal intervals.
num_iter is the number of iterations. It determines the number of terms to take from the Taylor expansion of the solution. For convergent series, more terms mean better approximation.
f_num determines the function for which the solution will be given. There are only two choices here. Even if the ODE has more than two unknowns, it is possible to print the solution for only two of them for now.
p_prec is the printing precision. All calculations are performed in exact arithmetic. The rational number is converted to floating point number at the last step using very high number of bits for representation (using facilities of multiprecision library). The printing precision determines how many digits to print after the dot.
When the Run button is pressed, the output is updated. The calculation is performed from scratch for each run to give a realistic observation of the computation time of prevth. Therefore, even the pure quadratization is performed again for each run.
Install GNU Multiprecision by
sudo apt install libgmp-dev
Build tui-prevth by
cmake -B build .
Compile tui-prevth by
cd build && make
Run by
./a.out
The program has been tested to work with GNU compiler g++-10 and above.