bogdanaKolic / Quadratization-of-ODEs

Research project on how a system of ODEs can be quadratized using Laurent monomials as substitution variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quadratization-of-ODEs

The quadratization problem

Assume that we are given a system of first order ordinary differential equations (ODEs). Our goal is to introduce a set of new variables(a quadratization of our system) which will be functions of our known variables, such that we can write the derivatives of all the variables as the degree at most 2 polynomials. Moreover, the less new variables introduced, the better. We are looking for the optimal quadratization - the one with the least number of substitutions possible.

Example: Consider a simple system with one equation $x' = x^7.$ We can introduce $y = x^6.$ Now, we have $x' = xy,$ and $y' = 6x^5x^7 = 6x^{12} = 6y^2.$ Clearly, the system is quadratized, moreover, as we only have one substitution variable y, this is the optimal quadratization.

However, the newly introduced variables are all in the form of monomials. If we allowed negative powers in the substitution variables (Laurent monomials), less new variables could be needed for the quadratization.

Example: Let us quadratize the following system with 2 variables: $x_1' = x_2^5$ , $x_2' = x_1^5$

From the first equation we get variable $y_1 = \frac{x_2^5}{x_1},$ and from the second, $y_2 = \frac{x_1^5}{x_2}.$ We can easily check that this is a quadratization of our system. For the sake of comparison, the optimal monomial quadratization of this system contains 4 new variables: $y_1 = x_1^4 $, $y_2 = x_2^4$, $y_3 = x_1^3x_2$ and $y_4 = x_1x_2^3$.

This program looks for the quadratization of the input system via Laurent monomials derived from the provided set of equations.

Instructions for use

Input systems can be either loaded from a file, generated randomly or (if they belong to the set of benchmark problems) generated by a dedicated function. In all cases, an additional arguments can be passed to indicate a strategy used to obtain a quadratization (passing no arguments means that no auxiliary substituions will be added to the search set):

  1. strategy - a string from the set {'from derivatives', 'random from derivatives', 'constant degree', 'roots of monom derivatives', 'optimal quadratization'}
  2. degree_sub - an integer indicating the degree of the additional monomial substitutions if strategy applied is 'constant degree'
  3. optquad - a string from the set {'monom3', 'circular(2,3)', 'cubic_cycle(3)', 'cubic_cycle(7)'}, saying that the additional substituions will be the optimal monomial quadratization of one of the 4 known systems.

Random tests

The function main_random() from the quadratization.py module quadratizes 10 randomly generated systems and prints the results.

Benchmark problems

The dedicated functions from benchmarks.py module, such as benchmark_tests(benchmark, repeat) or hilln_benchmark_tests(repeat) generate the related input systems and quadratize them, then print the solution to an automatically created file. Depending on the benchmark problem, additional arguments such as width, degree or order of the system can be passed to add more constraint.

Loading systems from file

For this purpose, quadratization.py contains a function main_from_file(filename), that quadratizes the system provided the path to the file and prints the result. The format of the input file should be:

n // integer representing the number of variables in the system

//followed by n lines, where the $i_{th}$ line represents the derivative of the variable $x_i$

.

.

.

$c*(p_0, p_1, ..., p_{n-1}) + ...$ // c - coefficient, $p_i$ - the power the $i_{th}$ variable has in the monomial

About

Research project on how a system of ODEs can be quadratized using Laurent monomials as substitution variables


Languages

Language:Python 97.8%Language:JetBrains MPS 2.2%