File Exchange

image thumbnail

Mittag-Leffler function

version 1.2 (2.74 KB) by

Calculates the Mittag-Leffler function with desired accuracy.

4.70588
35 Ratings

43 Downloads

Updated

View License

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.

Comments and Ratings (42)

Xuhuan Wang

Thank you very much!

Themmman

楼主一生平安。

Matthew

Thanks 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.

Thank you for your useful contribution.

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

zsczsc48

Thank you very much for your useful contribution.

Iphy kelvin

I 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??

zhu

zhu (view profile)

Thank you very much for your useful contribution.

Amr AbdelAty

Thanks 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.

kaber

kaber (view profile)

It 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 xiang

lksdfskl

very good.

Elias Wegert

Positive: 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 Li

Zhuo Li (view profile)

Ondrej

Ondrej (view profile)

I 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 Podlubny

Igor Podlubny (view profile)

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

Ondrej

Ondrej (view profile)

I 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 xiao

Thank you!

Andrey

Andrey (view profile)

Thank you Igor!

Brian

Brian (view profile)

This 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.

Brian

Brian (view profile)

Jinwen

Jinwen (view profile)

It 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.

Thanks for the contribution to the field of Fractional Calculus.

    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 Qi

Thanks. It's the best.

Ivo Petras

Ivo Petras (view profile)

Thanks. It works excellent.

tamer nabil

Li Jackie

Why 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 Mohamed

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

Eduardo Cuesta

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

Vamsi Krishna

That 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 yian

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

Enrico Scalas

It is a nice and useful algorithm.

saeed alavi

thank a lot .

Alvaro Cartea

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

Wang Shaowei

Thank Prof.Igor Podlubny!

Lingzao zeng

Excellent.Thanks a lot

YangQuan Chen

Thanks for the contribution.

Updates

1.2

Addressed the potential issue reported by Brian Bigler. Code clean up.

1.1

(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.

Keywords were truncated by the system during file submission. One can enter many characters in the 'Keywords' field of the file submission form, but it appears that the FileExchange system accepts only first 70 characters in the "Keywords" field.

MATLAB Release
MATLAB 6.0 (R12)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video