File Exchange

image thumbnail

The Mittag-Leffler function

version 1.3.0.0 (11.7 KB) by Roberto Garrappa
Evaluation of the Mittag-Leffler function with 1, 2 or 3 parameters

19 Downloads

Updated 07 Dec 2015

View License

Evaluation of the Mittag-Leffler (ML) function with 1, 2 or 3 parameters by means of the OPC algorithm [1]. The routine evaluates an approximation Et of the ML function E such that |E-Et|/(1+|E|) approx 1.0e-15

E = ML(z,alpha) evaluates the ML function with one parameter alpha for the corresponding elements of z; alpha must be a real and positive scalar. The one parameter ML function is defined as
E = sum_{k=0}^{infty} z^k/Gamma(alpha*k+1)
with Gamma the Euler's gamma function.

E = ML(z,alpha,beta) evaluates the ML function with two parameters alpha and beta for the corresponding elements of z; alpha must be a real and positive scalar and beta a real scalar. The two parameters ML function is defined as

E = sum_{k=0}^{infty} z^k/Gamma(alpha*k+beta)

E = ML(z,alpha,beta,gama) evaluates the ML function with three parameters alpha, beta and gama for the corresponding elements of z; alpha must be a real scalar such that 0<alpha<1, beta any real scalar and gama a real and positive scalar; the arguments z must satisfy |Arg(z)| > alpha*pi. The three parameters ML function is defined as

E = sum_{k=0}^{infty} Gamma(gama+k)*z^k/Gamma(gama)/k!/Gamma(alpha*k+beta)

NOTE: This routine implements the optimal parabolic contour (OPC) algorithm described in [1] and based on the inversion of the Laplace transform on a parabolic contour suitably choosen in one of the regions of analyticity of the Laplace transform.

REFERENCES:
[1] R. Garrappa, Numerical evaluation of two and three parameter Mittag-Leffler functions, SIAM Journal of Numerical Analysis, 2015, 53(3), 1350-1369

Please, report any problem or comment to : roberto dot garrappa at uniba dot it

Comments and Ratings (17)

Junsheng Duan

Dear Prof. Roberto Garrappa,

Thank you very much.

Here is the place I put the Fortran module which was translated from your Matlab code:

https://github.com/tranqv/Mittag-Leffler-function-and-its-derivative

This version of code supports both scalar and array (1D, 2D, 3D) input. Therein I have also released 76 test cases for calculation of both the Mittag-Leffler function and it derivative. (Well tested with gfortran 4.9.2 and ifort 18.0.0.)

You know, it take a couple of days to separate this module out of my own library. That is the reason why I reply you quite late. From now on this module is portable and be able to work independently.

Best regards,
Viet.

Dear Tran Quoc Viet, thank you very much for you comments and appreciation. A description of the code is available in the SIAM paper [1]. Since the algorithm is based on the numerical inversion of the Laplace transform, the variable t is the real value of the generalization of the ML function for which the LT is known. Anyway, in order to evaluate the ML function, and not its generalization, the variable t is conventionally put equal to 1 and therefore it could be eliminated from the code. You are very welcome to translate the code in Fortran and share it on public domains. Please, just insert in the code a reference to the paper [1] where the algorithm is described.

[1] R. Garrappa, Numerical evaluation of two and three parameter Mittag-Leffler functions, SIAM Journal of Numerical Analysis, 2015, 53(3), 1350-1369

Dear Prof. Roberto Garrappa,
Your code works excellently when compared with others, e.g. the one from Prof. Igor Podlubny. It runs fast and especially much more accurate than the others. When we increase the value of epilson, e.g. from 1.0e-15 to 1.0e-8. It runs faster than that of Prof. Igor Podlubny with a controllable and acceptable accuracy.

Could I ask you one question? What is the role of the "t" in function E = LTInversion(t,lambda,alpha,beta,gama,log_epsilon) ?

Recently I have translated your Matlab code into Fortran language. You know, performance of the Fortran code runs fantastically, like an intrinsic function. Could I share it on public domain?

Beiping Duan

Great! Much faster and more accurate than mlf.m uploaded by Prof. Igor Podlubny, which can not reach the desired accuracy when alpha>0.6.

Thank you very much!

Hongguang Sun

John Hollkamp

Thanks for the .m file! One question about the order alpha though. The code requires that alpha must be a real and positive scalar. Is it possible to alter the code so that it can handle complex values of alpha and still accurately evaluate the Mittag-Leffler function (output should be complex if alpha is complex)? Thanks!

Dear Sam, this code is not devised for matrix arguments. Anyway, we are working on this subject and we should release a code of this kind in a couple of months.

Sam

Sam (view profile)

Thanks for this .m file. I would like to ask if this can be used for MLF where z is a matrix i.e MLF with matrix argument. If no, is there available source code to compute MLF with matrix argument.

The algorithm implemented by this code is described in the paper:
R. Garrappa, Numerical Evaluation of two and three parameter Mittag-Leffler functions, SIAM Journal of Numerical Analysis, 2015, 53(3), 1350-1369 - doi: http://dx.doi.org/10.1137/140971191

azurekim89

Dear Amr AndelAty, this function works for arguments on the whole complex plane. The paper in the reference is still under review. Thank you for your suggestion.

Amr AbdelAty

Amr AbdelAty

This paper "Evaluation of generalized Mittag–Leffler functions on the real line" says that the argument should be positive. Does this apply to this file?
I couldn't find the paper in the references.
Also I suggest removing the imaginary part of the output if the input is pure real.
Thanks in advance

Updates

1.3.0.0

Description improved

1.3.0.0

References updated

1.2.0.0

References updated

1.2.0.0

Some bugs fixed and accuracy improved in some cases

1.1.0.0

Just the description of the code has been updated

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor