SymPy

SymPy
Description de l'image Sympy logo.svg.
Crédit image:
Alexey U. Gudchenko
licence BSD 🛈

Informations
Développé par Ondřej Čertík et Aaron Meurer
Première version
Dernière version 1.13.3 ()
Dépôt github.com/sympy/sympy
Assurance qualité Intégration continue
État du projet Actif
Écrit en Python
Système d'exploitation Type Unix
Type Système de calcul formel
Licence licence BSD
Site web sympy.org

SymPy est une bibliothèque en Python spécialisée dans le calcul formel qui ne dépend d'aucune bibliothèque supplémentaire. Elle est à la fois disponible en tant qu'application de bureau et d'application sur Internet avec Sympy Live. Elle permet de faire du calcul arithmétique formel basique, de l'algèbre, des mathématiques différentielles, de la physique, de la mécanique classique ou quantique. C'est un logiciel libre.

Exemples

Développement

L'exemple qui suit développe l'expression mathématique définie dans la variable e tout en détaillant le processus :

>>> from sympy import init_printing, Symbol, expand
>>> init_printing()
>>>
>>> a = Symbol('a')
>>> b = Symbol('b')
>>> e = (a + b)**5
>>> e
       5
(a + b) 
>>> e.expand()
 5      4        3  2       2  3       4    5
a  + 5a b + 10a b  + 10a b  + 5ab  + b

Dérivée

L'exemple qui suit, cette-fois, calcule la dérivée différencielle, puis la dérivée partielle de la fonction f définie dans la variable f :

>>> from sympy import init_printing, symbols, ln, diff
>>> init_printing()
>>> x,y = symbols('x y')
>>> f = x**2 / y + 2 * x - ln(y)
>>> diff(f,x)
 2x    
 ─── + 2
  y 
>>> diff(f,y)
    2    
   x    1
 - ── - 
    2   y
   y
>>> diff(diff(f,x),y)
 -2x
 ────
   2 
  y

Voir aussi

Références

Liens externes