Looking for Jacobi elliptic functions in Sympy - sympy

Iā€™m trying to solve a Sturm-Liouville problem involving elliptic functions, using pre-existing code, that requires symbolic arguments for these functions.
I found numerical routines for elliptic functions in Scipy and mpmath. I found reference to jcn and jdn in Sympy 2009, but could not import them from Sympy version 1.6.2.

Related

Sympy symbolic computation for recursive stochastic equations

Can sympy stats be used to solve problems like this one? https://stats.stackexchange.com/questions/583577/unconditional-variance-of-ar2-garch1-1
I would really like to see a worked out sympy solution!

Piecewise function in sympy

I would like to define the piecewise function below using the sympy module and then calculate a Fourier series for it.
Unfortunately I have no idea how exactly this works and have not found anything helpful on the internet.
Thanks in advance
piecewise function

Passing 2D numpy array to C++ for PDE integration

I have a code that is implementing finite differences method for integration of a certain partial differential equation. As I want to boost the code, I would like to pass the 2D numpy array from my Python code to a C++ function that will implement the integrator. I have read here few questions on this subject, but I wanted to ask here what should be more suitable for this mission, SWIG or Cython ? (or a different method?)

Which algorithm do DGGEV or DSYGV Eigen solvers in LAPACK implement? Is it 'QZ' algorithm which MATLAB uses?

Which algorithm do DGGEV or DSYGV Eigen solvers in LAPACK implement? Is it 'QZ' algorithm which MATLAB uses?
http://www.netlib.org/lapack/explore-html/d9/d52/dggev_8f_source.html
http://www.netlib.org/lapack/explore-html/d5/d2e/dsygv_8f.html
Does anybody know where can I find implementation of QZ algorithm (generalized Schur decomposition) to calculate Eigen values & vectors in C++?
EDIT:
I implemented some of LAPACK routines and mentioned some observations in this link:
https://scicomp.stackexchange.com/questions/16220/eigenvectors-matlab-vs-lapack-dggev-or-dggevx
MATLAB used to have a list of LAPACK rountine used by eig function in its documentation, but decided to remove it for some reason.
Here is a screenshot of the table from the archived docs of R2009a:
I can't guarantee things haven't changed since then.
EDIT:
The doc page of the qz function had a similar table of LAPACK rountines:
For reference, you could also look at how other scientific frameworks implement this function:
Octave: Has the equivalent qz function. Here is the source code: http://hg.octave.org/octave/file/tip/libinterp/corefcn/qz.cc
SciPy: Also implements the generalized Schur decomposition. You can see it also ends up calling DGGES from LAPACK.
Julia: Here is a reference to Julia's implementation of Schur decomposition: https://github.com/JuliaLang/julia/blob/master/base/linalg/factorization.jl#L697ā€Œā€‹, https://github.com/JuliaLang/julia/blob/master/base/linalg/lapack.jl#L3358
R: Here is an equivalent R package for generalized eigenvalue problem. You can inspect the source code: http://cran.r-project.org/web/packages/geigen/index.html

symbolic computation in C++

I need to do analytical integration in C++. For example, I should integrate expressions like this: exp[I(x-y)], I is an imaginary number.
How can I do this in C++?
I tried GiNaC but it can just integrate polynomials. I also tried SymbolicC++. It can integrate functions like sine, cosine or exp(x) and ln(x), but it is not very powerful. For example, it can not integrate x*ln(x) which can be easily obtained by use of Mathematica or by integration by parts.
Are there any other tools or libraries which are able to do symbolic computation like analytical integration in C++?
If you need to do symbolic integration, then you're probably not going to get anything faster than running it in mathematica or maxima - they're already highly optimised. So unless your equations have a very specific formulae that you can exploit in a way that Mathematica or Maxima can not then you're probably out of luck -- and at very least you're not going to get that kind of custom manipulation from an off-the-shelf library.
You may be justified in writing your own code to get a speed boost if you needed to do numerical solutions. ( I know that I did for generating numerical solutions to PDEs).
The other C++ libraries I am aware of that do symbolic computation are
SymEngine (https://github.com/symengine/symengine)
Piranha (https://github.com/bluescarni/piranha)
If I am not mistaken, SymEngine does not yet support integration; however, Piranha does. The documentation for Piranha is somewhat limited at the moment and is under development, but you can see the integration function here. Note that the second link uses the syntax for the Python wrapper Piranha. However, Piranha "is a computer-algebra library for the symbolic manipulation of sparse multivariate polynomials and other closely-related symbolic objects (such as Poisson series)", so I do not think it can integrate the particular functions in which you may be interested.
Though it is not C++, you may also be interested in SymPy for Python, which can perform some of the more complicated symbolic integration you may be interested in. The documentation for SymPy's integrate is here.
A couple of days ago, I was searching for a symbolic math library like SymPy for C++, because I bedazzled by its speed comparing to Python or most of the other programming languages.
I found Vienna Math Library, an awesome library with very modern syntax, and SymPy's features to the best of my knowledge. This library also has an integral function that can be used for your problem.
It was good enough for solving IK (Inverse Kinematics) of 3 degrees of freedom articulated manipulator.