sympy
Use this skill when working with symbolic mathematics in Python. This skill should be used for symbolic computation tasks including solving equations algebraically, performing calculus operations (derivatives, integrals, limits), manipulating algebraic expressions, working with
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Use this skill when working with symbolic mathematics in Python. This skill should be used for symbolic computation tasks including solving equations algebraically, performing calculus operations (derivatives, integrals, limits), manipulating algebraic expressions, working with matrices symbolically, physics calculations, number theory problems, geometry computations, and generating executable code from mathematical expressions. Apply this skill when the user needs exact symbolic results rather than numerical approximations, or when working with mathematical formulas that contain variables and parameters.
How to use
- Zaimportuj niezbędne moduły z biblioteki SymPy – na początek wystarczy
from sympy import symbols, Symboldo definiowania zmiennych symbolicznych oraz funkcje do konkretnych operacji (np.solvedo równań,diffdo pochodnych,integratedo całek). 2. Zdefiniuj symbole reprezentujące zmienne matematyczne, np.x, y, z = symbols('x y z'). Możesz dodać założenia o zmiennych, takie jakx = symbols('x', real=True, positive=True), aby ograniczyć dziedzinę. 3. Utwórz wyrażenia algebraiczne, łącząc symbole za pomocą operatorów Pythona, np.expr = x**2 + 2*x + 1. 4. Zastosuj odpowiednią operację: rozwiąż równanie funkcjąsolve(), oblicz pochodną za pomocądiff(), całkę przezintegrate(), lub uprość wyrażenie funkcjąsimplify(). 5. Jeśli potrzebujesz wyniku w innym formacie, konwertuj go – SymPy potrafi generować kod w Pythonie, C lub Fortranie, a także formatować wyniki w LaTeX. 6. Uruchom kod i otrzymaj dokładny wynik symboliczny zamiast przybliżenia numerycznego.