Which programming language or a library can process Infinite Series?

后端 未结 13 1406
情书的邮戳
情书的邮戳 2021-02-03 23:46

Which programming language or a library is able to process infinite series (like geometric or harmonic)? It perhaps must have a database of some well-known series and automatica

相关标签:
13条回答
  • 2021-02-04 00:04

    For Python check out SymPy - clone of Mathematica and Matlab.

    There is also a heavier Python-based math-processing tool called Sage.

    0 讨论(0)
  • 2021-02-04 00:05

    I have worked in couple of Huge Data Series for Research purpose. I used Matlab for that. I didn't know it can/can't process Infinite Series.

    But I think there is a possibility. U can try :)

    0 讨论(0)
  • 2021-02-04 00:07

    Maxima can calculate some infinite sums, but in this particular case it doesn't seem to find the answer :-s

    (%i1) sum((-1)^k/(2*k), k, 1, inf), simpsum;
                                     inf
                                     ====       k
                                     \     (- 1)
                                      >    ------
                                     /       k
                                     ====
                                     k = 1
    (%o1)                            ------------
                                          2
    

    but for example, those work:

    (%i2) sum(1/(k^2), k, 1, inf), simpsum;
                                            2
                                         %pi
    (%o2)                                ----
                                          6
    
    (%i3) sum((1/2^k), k, 1, inf), simpsum;
    (%o3)                                  1
    
    0 讨论(0)
  • 2021-02-04 00:14

    The C++ iRRAM library performs real arithmetic exactly. Among other things it can compute limits exactly using the limit function. The homepage for iRRAM is here. Check out the limit function in the documentation. Note that I'm not talking about arbitrary precision arithmetic. This is exact arithmetic, for a sensible definition of exact. Here's their code to compute e exactly, pulled from the example on their web site:

    //---------------------------------------------------------------------
    // Compute an approximation to e=2.71.. up to an error of 2^p
     REAL e_approx (int p)
    {
      if ( p >= 2 ) return 0;
    
      REAL y=1,z=2;
      int i=2;
      while ( !bound(y,p-1) ) {
        y=y/i;
        z=z+y;
        i+=1;
      }
      return z;
    };
    
    //---------------------------------------------------------------------
    // Compute the exact value of  e=2.71.. 
    REAL e()
    {
      return limit(e_approx);
    };
    
    0 讨论(0)
  • 2021-02-04 00:18

    One place to look might be the Wikipedia category of Computer Algebra Systems.

    0 讨论(0)
  • There is a library called mpmath(python), a module of sympy, which provides the series support for sympy( I believe it also backs sage).
    More specifically, all of the series stuff can be found here: Series documentation

    0 讨论(0)
提交回复
热议问题