Welcome to w_elliptic’s documentation!

w_elliptic is a small, header-only C++11 library for the computation of Weierstrass elliptic and related functions. The library has been developed with a particular focus on the application to dynamical systems, and it offers the following features:

  • it allows the definition of Weierstrassian functions in terms of real invariants \(g_2\) and \(g_3\);
  • the Weierstrassian functions \(\wp\), \(\wp^\prime\), \(\zeta\), \(\sigma\) and \(\wp^{-1}\) are supported;
  • for each function (apart from \(\wp^{-1}\)) two overloads are available, one with complex argument and one with real argument. The real argument overload will use only real arithmetic;
  • the three standard C++ floating-point types (float, double and long double) are supported.

Quickstart

Here follows a simple usage example for the library:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <complex>
#include <iostream>

// Include the w_elliptic.hpp header.
#include "w_elliptic.hpp"

int main()
{
    // Initialise a class for the computation of the Weierstrassian functions
    // in double precision, with real invariants g2 = 1 and g3 = 2.
    w_elliptic::we<double> w(1,2);

    // Computation of P with real argument.
    std::cout << w.P(1.2) << '\n';
    // Output: 0.923915...

    // Computation of P with complex argument.
    std::cout << w.P(std::complex<double>(1.2,3.4)) << '\n';
    // Output: (-1.07706...+0.268321...j)

    // Computation of zeta with real argument.
    std::cout << w.zeta(0.12) << '\n';
    // Output: 8.33330...

    // Computation of inverse P: will yield a pair of values in the
    // fundamental parallelogram.
    auto Pinv = w.Pinv(-4.);
    std::cout << Pinv[0] << '\n';
    // Output: (2.61673...+0.500504...j)
    std::cout << Pinv[1] << '\n';
    // Output: (1.30836...+1.95823...j)

    // Print a human-readable summary of the 'w' object:
    std::cout << w << '\n';
    // Output:
    // Invariants: [1,2]
    // Delta: -1712
    // Roots: [(0.898160...,0),(-0.449080...,0.595835...),(-0.449080...,-0.595835...)]
    // Periods: [(2.61673...,0),(1.30836...,2.45874...)]
    // etas: [(0.669458...,0),(0.334729...,-0.571542...)]
    // q: (0,0.0522398...)
}

Installation

The library does not have any dependency, apart from a C++ compiler that understands C++11. As a header-only library, you will only need to include the w_elliptic.hpp header to start using it, no linking is needed.

Limitations

The library currently does not support neither complex invariants, nor the definition of Weierstrassian functions in terms of periods (rather than invariants).

Contents:

Indices and tables