Skip to content

Kronrod-Extensions-Library/kes

Repository files navigation

Kronrod Extensions Search

The Makefile can generate 5 useful programs:

  • quadrature by calling make quadrature
  • kes by calling make kes
  • ekes by calling make ekes
  • rekes by calling make rekes
  • genzkeister by calling make genzkeister

There are also two test programs generated by make test and make enumtest. Just type make without arguments to build all.

The polynomial type can be specified as argument to make via POLY=P where P is one of:

  • LEGENDRE Legendre polynomials
  • CHEBYSHEVT Chebyshev polynomials of the first kind
  • CHEBYSHEVU Chebyshev polynomials of the second kind
  • LAGUERRE Laguerre polynomials
  • HERMITE physicists' Hermite polynomials
  • HERMITEPRO probabilists' Hermite polynomials

and the default is LEGENDRE if nothing else is provided.

All code can be compiled to produce minimal output by setting PRINTLOG=0. For detailed help, run the programs without any arguments.

High-order quadrature rules

The program quadrature computes quadrature nodes and weights for Gauss-Legendre, Gauss-Laguerre, Gauss-Hermite or Gauss-Chebyshev quadrature rules. Computation works by root-finding and an explicit formula for the weights given the nodes.

Nested Kronrod Extensions

The program kes computes nested Kronrod extensions from an initial rule and a list of polynomial extension degrees. Output contains the defining polynomials and optionally the nodes and weights for for each quadrature extension.

Example:

  1. Compute the nodes and weights for a K = (1,2,4,8,16) Kronrod extension:

    ./kes -cn -cw 1 2 4 8 16 > rule.txt
    
  2. Plot nodes and weights of this rule:

    python plot_weights.py rule.txt
    

Map existence of single extensions

The program ekes computes single higher-order Kronrod-Patterson extensions for a given polynomial type and arbitrary values of order n and extension degree p.

  1. Call ekes like:

    ./ekes n p > map.txt
    

    for specific values of n and p.

  2. Plot the map:

    python plot_map.py map.txt
    

Exhaustive search for Kronrod Extensions

  1. Call rekes like:

    ./rekes n pmax recmax > recs_n_pmax_recmax.dat
    

    for all interesting values of n, pmax and recmax.

  2. Call graph_rules.py to generate a dot file:

    python graph_rules.py recs_n_pmax_recmax.dat
    

    This will give a file called graph_n_pmax_recmax.dot

  3. Make a figure by calling dot either of:

    circo graph_n_pmax_recmax.dot -Tpng -o graph_n_pmax_recmax.png
    dot graph_n_pmax_recmax.dot -Tpng -o graph_n_pmax_recmax.png
    
  4. Call get_all_rules.sh in a directory with recs_*.dat files. This will give a file called all_rules.dat containing line by line the extension tower.

  5. Call build_rulecomputer.py like:

    python build_rulecomputer.py all_rules.dat
    

    This will give a file called compute_all_rules.sh containing shell commands to compute nodes and weights of all rules.

Genz-Keister Construction

The program genzkeister builds multivariate sparse quadrature rules by applying the Genz-Keister construction. This works for all symmetric quadratures (Legendre, Chebyshev, Hermite). The number of dimensions is a compile-time argument given to make by the DIMENSION=D. The default is POLY=LEGENDRE polynomials in DIMENSION=1 dimensions.

Scientific Work

The research report "Exhaustive search for higher-order Kronrod-Patterson Extensions" 1 describes the mathematical theory and implementation details that stand behind this code.

License

This project is covered by the GNU Public License, version 2 or above.

Citation

This repository contains source code for published scientific work. The usual citation requirements apply. For citation of this project please use the following bibtex snippet:

@misc{kes,
    author = {R. Bourquin},
    title = {Exhaustive search for higher-order Kronrod-Patterson Extensions},
    year = {2014, 2015, 2016, 2017},
    url = {https://github.com/Kronrod-Extensions-Library/kes}
}