SymPy

維基百科,自由的百科全書
跳至導覽 跳至搜尋
SymPy
File:Sympy-160px.png
開發者Ondřej Čertík和Aaron Meurer等
首次發布2007年,​19年前​(2007
當前版本1.6.2(2020年8月10日,​5年前​(2020-08-10
源代碼庫
  • {{URL|example.com|可选的显示文本}}
Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
編程語言Python
引擎
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    操作系統跨平台
    類型計算機代數系統
    許可協議修正的BSD許可證[1]
    網站sympy.org

    SymPy是一個符號計算的Python。它的目標是成為一個全功能的計算機代數系統,同時保持代碼簡潔、易於理解和擴展。它完全由Python語言寫成,不依賴於外部庫。[2]

    SymPy支持符號計算、高精度計算模式匹配繪圖解方程微積分組合數學離散數學幾何學概率與統計物理學等方面的功能。[2][3]

    SymPy在新BSD許可證下開源。[1]

    用例[編輯]

    求<math>f(x) = \frac{x^2+2x+1+(3x+1)\sqrt{x+\ln x}}{x\,\sqrt{x+\ln x}(x+\sqrt{x+\ln x})}</math>的積分:

    >>> from sympy import init_printing, integrate, log, sqrt, symbols
    >>> init_printing()
    >>> x = symbols('x')
    >>> g = sqrt(x + log(x))
    >>> f = (x ** 2 + 2 * x + 1 + (3 * x + 1) * g) / (x * g * (x + g))
    >>> f
     2           ____________              
    x  + 2x + ╲╱ x + log(x) (3x + 1) + 1
    ───────────────────────────────────────
             ____________   ____________ 
     x⋅⎝x + ╲╱ x + log(x) ⎠⋅╲╱ x + log(x)  
    >>> integrate(f, x)
        ____________              ____________
    2⋅╲╱ x + log(x)  + 2logx + ╲╱ x + log(x) 
    

    參考資料[編輯]

    1. ^ 1.0 1.1 Support SymPy Development. [2013-11-03]. (原始內容存檔於2013-11-04). 
    2. ^ 2.0 2.1 SymPy官方网站. [2013-11-03]. (原始內容存檔於2019-11-20). 
    3. ^ Python代数计算库 SymPy - 开源中国. [2013-11-03]. (原始內容存檔於2013-11-04). 

    外部連結[編輯]