version 1.2.0.0 (2.74 KB) by
Igor Podlubny

Calculates the Mittag-Leffler function with desired accuracy.

This is a MATLAB routine for evaluating the Mittag-Leffler function with two parameters (sometimes also called generalized exponential function).

The Mittag-Leffler function with two parameters plays an important role and appears frequently in solutions of fractional differential equations (i.e. differential equations containing fractional derivatives).

USAGE:

MLF(alpha,beta,Z,P) is the Mittag-Leffler function E_{alpha,beta}(Z) evaluated with accuracy 10^(-P) for each element of Z.

Update 2009-03-25:

(1) Now Z can also be a two-dimensional array.

(2) Addressed the issue reported by Li Jackie. It was caused by rounding errors during computations.

Update 2012-09-07:

(1) Addressed the potential issue reported by Brian Bigler.

(2) Code clean up.

Igor Podlubny (2021). Mittag-Leffler function (https://www.mathworks.com/matlabcentral/fileexchange/8738-mittag-leffler-function), MATLAB Central File Exchange. Retrieved .

Created with
R12

Compatible with any release

**Inspired:**
Global Pade Approximation of the Mittag-Leffler function, lrtfm/Mittag-Leffler-Function

Find the treasures in MATLAB Central and discover how the community can help you!

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

Srivatsa VasudevanWhy am I not able to run Mittag Leffler function on the online version? Is there some package I must download

Noemi Zeraick Monteiro@Mubashara Wali Did you tried with beta=1?

Mubashara Waliwhat is the code for Mittag Leffler function with one paameter?

Noemi Zeraick MonteiroThanks so much for this useful code. I am beginner at M-L functions and does not understand the oscilations that I've gotten when I put alf=0.95 and bet=1. https://www.dropbox.com/s/seizn4t4z1dtb9j/Oscilation.PNG?dl=0 .

I'd be very grateful if one could help me. Thank you.

志广 李thank you

Takashi OheHao QiumindraDai Lei楼主thank you

Mikulas Klimkosuresh kumarwhat is the input command

HeroThank you very much!

Fernando S. SilvaWesley CarmoXuhuan WangThank you very much！

Themmman楼主一生平安。

MatthewThanks for contributing this.

I think there is an issue for alpha<1 with beta=1.

I have only tested it for the above cases and for real z, but this code shows the problem:

z = linspace(0,10,100);

plot(z,mlf(0.99,1,-z))

As a previous comment says, this code is based on a paper by Gorenflo et al. Direct evaluation of equation 23 using a numerical integration routine gives the correct results and is reasonably efficient.

ahmed elakhdarThank you for your useful contribution.

Pantelis SopasakisI would like to understand the math behind this implementation? Is there some reference for further information? Thank you in advance.

Pantelis Sopasakiszsczsc48Thank you very much for your useful contribution.

Iphy kelvinI need help urgently.i need the math-lab function name for Mainardi function and as for the Mittag-Leffler function name,when i used it in mathlab 2013.the software said undefined function 'mlf'.

what should i do??

zhujukkrit kluabwangThank you very much for your useful contribution.

Amr AbdelAtyThanks professor igor for this valuable file.

I noticed a little discontinuity near t=12 when executing this code

>> t=0:0.001:50;

>> y=mlf(0.5,0.5,-t,5);

>> plot(t,y)

I will be very thankful for any advice.

kaberPritesh ShahIt is very useful function for implementation of fractional calculus in relativity.

Need small help, E^(3)(0.3,1.9)(-t^0.3).

How do I calculate this function?

qi xianglksdfsklvery good.

Elias WegertPositive: The routine computes the function in regions where the Taylor series fails.

Negative: Computations are relatively slow and not completely reliable, for example, alpha=1/2, beta=1 and z near the imaginary axis (probably directly on the imaginary axis) yield completely wrong results (see the phase portrait at http://www.mathe.tu-freiberg.de/~wegert/MittagLefflerBug/Mittag4.png)

Zhuo LiOndrejI have one more remark. I found this article on internet:

http://www.bo.infn.it/pinazza/Mainardi/presentazioni/Mainardi/fm60_fcaa_gololu_4.pdf

and it seemed to me that your code is based on it. Probably a reference in your code to this paper (or the theory behind your code), can help other people understand your code.

Igor PodlubnyTo Ondrej: http://mathworld.wolfram.com/Mittag-LefflerFunction.html : we assume alpha > 0, beta > 0. Thank you for the comment on the exception.

OndrejI am not sure, but there might be potential bugs in case a=0.

If a=0, code jumps to the end, at tries to evaluate variable "e"..which does not exist.

Also, as far as I know, case a=0, b=1, corresponds to sum of geometric progression (1/(1-z)), therefore a=0, should be allowed in the code.

wang xiaoThank you!

AndreyThank you Igor!

BrianThis function is excellent and exactly what I needed!

One potential bug:

The compound inequality on line 36 (1<=alf<2) always evaluates to true (1<=alf evaluates to a logical 0 or 1, which is always less than 2). I don't think this was the statement's intent.

BrianJinwenRoberto GarrappaIt is a very robust code and is very useful in several applications. An excellent work. It is a reference for practical computation in Fractional Calculus.

udita katugampolaThanks for the contribution to the field of Fractional Calculus.

Maxwelldemon ??The code is very very helpful. Thanks a lot. However, there exists a problem:

When 1<alfa<2, beta>1, the returned value has a jump when the variable z is around -170. When alfa=1.5, I tried beta=1.5, 2.5, 3.5, the jump always happens around -170.

Furthermore, in the code, I can't find computations for the case 1<alfa<2, when z>floor(20/(2.1-alfa)^(5.5-2*alfa)).

I will be very thankful for any advice.

Haitao QiThanks. It's the best.

Ivo PetrasThanks. It works excellent.

tamer nabilLi JackieWhy there exists complex value in the numerical result of the Mittag-Leffler function when the variable (named z) is real?

Recently I used the programe MLF.m to compute the Mittag-Leffler function in Matlab. But I had a problem that there existed complex value in the numerical result of the Mittag-Leffler function. Since the interval of z (variable of function) I setted is a subset of real space, I can't explain why appearence of complex value of Mittag-Leffler function. Could someone give me some advice? Hope it will not delay you too much time. Thanks.

Assabaa Mohamedcan you send me a complete code for simulating the fractional oscillator,I need it urgently to confirm an idea. thanks a lot

Eduardo CuestaThis function has been useful to me and taking an overview to the code, this seems to be vere, very fine.

Congratulations

Vamsi KrishnaThat was very very helpful sir.Please let me know the algorithm you have used or any reference paper which contains the properties you have used.Please let me know if you have written the code for MLF with three parameters.

mervyn yianmay i know do u have a complete code for simulating the fractional oscillator........i need in urgently. thanks a lot

Enrico ScalasIt is a nice and useful algorithm.

saeed alavithank a lot .

Alvaro CarteaIt is great to have someone like Podlubny put the code out. This saves people in the field a great deal of time!!

Wang ShaoweiThank Prof.Igor Podlubny!

Lingzao zengExcellent.Thanks a lot

YangQuan ChenThanks for the contribution.