Mittag-Leffler
Are Mittag-Leffler function implemented in Sagemath ?
Are Mittag-Leffler function implemented in Sagemath ?
There does not seem to be an implementation in Sage.
There is an implementation in R in the MittagLeffleR R package.
It can be used from Sage.
To install this R package for Sage's R, run this in a terminal:
$ sage --R
Then at the R prompt (>
) type:
> install.packages('MittagLeffleR')
and choose a download mirror in the numbered list.
Once the installation is complete, quit R:
> q()
Next time you launch Sage:
$ sage
you can load the MittagLeffleR R package:
sage: r.library('MittagLeffleR')
Then you can run commands such as:
sage: r('mlf(2, 0.7)')
[1] 20.96643
sage: r('dml(1, 0.8)')
[1] 0.2557438
sage: r('dml(1, 0.6, second.type=TRUE)')
[1] 0.4832354
sage: r('pml(2, 0.7, 1.5)')
[1] 0.6597308
sage: r('qml(p = c(0.25, 0.5, 0.75), tail = 0.6, scale = 100)')
[1] 11.64327 60.56854 284.67928
sage: r('rml(10, 0.7, 1)')
[1] 2.863445e-01 2.189476e+00 1.013715e+00 2.465789e+00 4.260511e-01
[6] 4.568785e-01 7.676349e-02 6.497517e-05 5.912041e-01 5.403624e-01
Here is a Mittag-Leffler function based on that:
def mittag_leffler(z, a, b=1, g=1):
r"""
Return the Mittag-Leffler function for these arguments.
"""
r.library('MittagLeffleR')
return r(f'mlf({z}, {a}, b={b}, g={g})').sage()
Usage:
sage: mittag_leffler(2, 0.7)
20.966433131482
In the same vein :
sage: mathematica.MittagLefflerE?
Signature: mathematica.MittagLefflerE(*args, **kwds)
Type: MathematicaFunction
String form: MittagLefflerE
File: /usr/local/sage-9/src/sage/interfaces/mathematica.py
Docstring:
MittagLefflerE[α, z] gives the Mittag–Leffler function E (z).
α
MittagLefflerE[α, β, z] gives the generalized Mittag–Leffler function
E (z).
α, β
which uses either a local Mathematica install or the (gratis, if not free) Wolfram engine.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2022-07-20 14:12:22 +0100
Seen: 197 times
Last updated: Jul 24 '22
Is there a way to set arbitrary function commuting rules?
Preload defined functions for later use
Use the properties of inverse functions to find the exact value of the expression
Is there any way to define an as-yet-unknown function?
plotting multiple functions from a for loop
what type of object is a function defined with the piecewise command?
How to plot many functions on the same graph
Generating functions and plotting them with different colors