Package: differint
differintThis package is used for numerically calculating fractional derivatives and integrals (differintegrals). Options for varying definitions of the differintegral are available, including the Grunwald-Letnikov (GL), the 'improved' Grunwald-Letnikov (GLI), the Riemann-Liouville (RL), and the Caputo (L1, L2, and L2C). Through the API, you can compute differintegrals at a point or over an array of function values.See below for an example of how to use this package, or check out thewikifor references, signatures, and examples for each function.MotivationThere is little in the way of readily available, easy-to-use code for numerical fractional calculus. What is currently available are functions that are generally either smart parts of a much larger package, or only offer one numerical algorithm. Thedifferintpackage offers a variety of algorithms for computing differintegrals and several auxiliary functions relating to generalized binomial coefficients.InstallationThis project requires Python 3+ and NumPy to run.Installation from the Python Packaging index (https://pypi.python.org/pypi) is simple using pip.pipinstalldifferintIncluded FilesCore FileDescriptiondifferint/differint.pyContains algorithms for fractional differentiation and integration.tests/test.pyTesting suite containing all unit tests.Both of the above files have corresponding__init__.pyfiles.Setup FileDescription.gitignoreList of files to ignore duringgitpush/pull requests.CONTRIBUTING.mdInstructions for potential contributors to thedifferintproject.LICENSEMIT license agreement.MANIFEST.inSelects the README file for uploading to PyPi.README.mdThis README file.README.rstThis README file in ReStructuredText format.init.py__init__file for overall package.changelog.txtList of updates to package.setup.pyScript for downloading package frompip.Example UsageTaking a fractional derivative is easy with thedifferintpackage. Let's take the 1/2 derivative of the square root function on the interval [0,1], using the Riemann-Liouville definition of the fractional derivative.importnumpyasnpimportdifferint.differintasdfdeff(x):returnx**0.5DF=df.RL(0.5,f)print(DF)You can also specify the endpoints of the domain and the number of points used as follows.DF=df.RL(0.5,f,0,1,128)For a description of all functions, their signatures, and more usage examples, see the project'swiki.TestsAll tests can be run with nose from the command line. Setup will automatically install nose if it is not present on your machine.pythonsetup.pytestsAlternatively, you can run the test script directly.cd<file_path>/differint/tests/pythontest.pyAPI ReferenceIn this section we cover the usage of the various functions within thedifferintpackage.Main FunctionUsageGLpointComputes the GL differintegral at a pointGLComputes the GL differintegral over an entire array of function values using the Fast Fourier TransformGLIComputes the improved GL differintegral over an entire array of function valuesCRONECalculates the GL derivative approximation using the CRONE operator.RLpointComputes the RL differintegral at a pointRLComputes the RL differintegral over an entire array of function values using matrix methodsCaputoL1pointComputes the Caputo differintegral at a point using the L1 algorithmCaputoL2pointComputes the Caputo differintegral at a point using the L2 algorithmCaputoL2CpointComputes the Caputo differintegral at a point using the L2C algorithmPCsolverSolves IVPs for fractional ODEs of the form ${}^CD^\alpha[y(x)]=f(x,y(x))$ using the predictor-corrector methodAuxiliary FunctionUsageisIntegerDetermine if a number is an integerisPositiveIntegerDetermine if a number is an integer, and if it is greater than 0checkValuesUsed to check for valid algorithm input typesGLIinterpolatDefine interpolating coefficients for the improved GL algorithmfunctionCheckDetermines if algorithm function input is callable or an array of numberspochComputes the Pochhammer symbolGammaComputes the gamma function, an extension of the factorial to complex numbersBetaComputes the beta function, a function related to the binomial coefficientMittagLefflerComputes the two parameter Mittag-Leffler function, which is important in the solution of fractional ODEsGLcoeffsDetermines the convolution filter composed of generalized binomial coefficients used in the GL algorithmRLcoeffsCalculates the coefficients used in the RLpoint and RL algorithmsRLmatrixDetermines the matrix used in the RL algorithmPCcoeffsDetermines the coefficients used in the PC algorithmContributeTo contribute to this project, see thecontributing guidelines.CreditsBaleanu, D., Diethelm, K., Scalas, E., & Trujillo, J.J. (2012). Fractional Calculus: Models and Numerical Methods. World Scientific.Oldham, K.B. & Spanier, J. (1974). The Fractional Calculus: Theory and Applications of Differentiation and Integration to Arbitrary Order. Academic Press Inc.Karniadakis, G.E.. (2019). Handbook of Fractional Calculus with Applications Volume 3: Numerical Methods. De Gruyter.LicenseMIT ©Matthew Adams