File:AsymptoticExpansionExample.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 449 × 273 pixels, file size: 68 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Plots of the absolute value of the fractional error in the asymptotic expansion of the Gamma-related function f(x)=exxx2πxΓ(x+1). The horizontal axis is the number of terms in the asymptotic expansion. Blue points are for x=2 and red points are for x=3. It can be seen that the least error is encountered when there are 14 terms for x=2, and 20 terms for x=3, beyond which the error diverges.
    Date
    Source Own work
    Author PAR
    SVG development
    InfoField
     The SVG code is valid.
     This plot was created with Mathematica.
    Source code
    InfoField

    Mathematica code

    f[x_] := Exp[x] Gamma[x + 1]/x^x/Sqrt[2 \[Pi] x]
    ff[n_, x_] := Normal[Series[f[xx], {xx, \[Infinity], n}]] /. xx -> x
    x1 = 2.;
    x2 = 3.;
    n = 40;
    a1 = Table[ff[i, x1], {i, 1, n}];
    a2 = Table[ff[i, x2], {i, 1, n}];
    plot1 = ListLogPlot[Abs[a1/f[x1] - 1], 
       PlotRange -> {{0, n + 1}, {10^(-10), 1}}];
    plot2 = ListLogPlot[Abs[a2/f[x2] - 1], 
       PlotRange -> {{0, n + 1}, {10^(-10), 1}}, PlotStyle -> Red];
    w = Show[plot1, plot2]
    

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
    The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    18 January 2017

    image/svg+xml

    7ea1556570ddd48f689dba0941b42315ec999767

    69,679 byte

    273 pixel

    449 pixel

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current01:00, 19 January 2017Thumbnail for version as of 01:00, 19 January 2017449 × 273 (68 KB)wikimediacommons>PARabsolute value of error rather than error

    There are no pages that use this file.