본문으로 건너뛰기
Skillpedia
머신러닝51k · #3579

sympy

하는 일

이 도구는 근삿값 대신 기호를 사용해 정확한 수학 계산을 하게 해 줍니다. 대수, 미적분, 방정식 풀이, 그리고 물리학의 일부 계산에도 쓸 수 있습니다.

사용하는 경우

  • ✓'x + 5 = 10'처럼 방정식을 정확하게 풀 때.
  • ✓수학 함수의 미분이나 적분을 계산할 때.
  • ✓복잡한 수학 식을 간단하게 정리하는 경우.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/sympy/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/sympy/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“방정식 x^2 - 4 = 0을 x에 대해 풀어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

기호가 무엇을 뜻하는지(예: 'x'나 'y') 알려 주고 수학 식이나 방정식을 적으면, AI가 SymPy 도구를 사용해 정확한 결과를 계산합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

SymPy - Symbolic Mathematics in Python

Overview

SymPy is a Python library for symbolic mathematics that enables exact computation using mathematical symbols rather than numerical approximations. This skill provides comprehensive guidance for performing symbolic algebra, calculus, linear algebra, equation solving, physics calculations, and code generation using SymPy.

Installation

Reviewed against current official documentation and executed with SymPy 1.14.0 on Python 3.13.3 (2026-10-01). Core SymPy requires Python 3.9+; the tested NumPy 2.5.3 / SciPy 1.18.1 stack needs Python 3.12+. SymPy 1.14.0 requires mpmath>=1.1,<1.4; use the compatible 1.3.0, not the newer 1.4.x release. See verification and official sources for coverage.

# Install SymPy using uv
uv pip install "sympy==1.14.0"

# Optional: for lambdify and plotting examples
uv pip install numpy scipy matplotlib

Check your version:

import sympy
print(sympy.__version__)

When to Use This Skill

Use this skill when:

  • Solving equations symbolically (algebraic, differential, systems of equations)
  • Performing calculus operations (derivatives, integrals, limits, series)
  • Manipulating and simplifying algebraic expressions
  • Working with matrices and linear algebra symbolically
  • Doing physics calculations (mechanics, quantum mechanics, vector analysis)
  • Number theory computations (primes, factorization, modular arithmetic)
  • Geometric calculations (2D/3D geometry, analytic geometry)
  • Converting mathematical expressions to executable code (Python, C, Fortran)
  • Generating LaTeX or other formatted mathematical output
  • Needing exact mathematical results (e.g., sqrt(2) not 1.414...)

Core Capabilities

Seven capability areas are documented in references/core_capabilities.md:

  1. Symbolic computation basics — symbols, expressions, simplification, substitution.
  2. Calculus — differentiation, integration, limits, series.
  3. Equation solving — solve, solveset, linear and nonlinear systems, ODEs.
  4. Matrices and linear algebra — see references/matrices-linear-algebra.md.
  5. Physics and mechanics — see references/physics-mechanics.md.
  6. Advanced mathematics — see references/advanced-topics.md.
  7. Code generation and output — see references/code-generation-printing.md.

Deeper treatment of the first three is in references/core-capabilities.md.

Working with SymPy: Best Practices

1. Always Define Symbols First

from sympy import symbols
x, y, z = symbols('x y z')
# Now x, y, z can be used in expressions

2. Use Assumptions for Better Simplification

from sympy import symbols, sqrt
x = symbols('x', positive=True, real=True)
sqrt(x**2)  # Returns x (not Abs(x)) due to positive assumption

Common assumptions: real, positive, negative, integer, rational, complex, even, odd

3. Use Exact Arithmetic

from sympy import Rational, S
# Correct (exact):
expr = Rational(1, 2) * x
expr = S(1)/2 * x

# Approximate (appropriate for measured/numerical inputs):
expr = 0.5 * x  # Creates approximate value

4. Numerical Evaluation When Needed

from sympy import pi, sqrt
result = sqrt(8) + pi
result.evalf()    # 5.96371554103586
result.evalf(50)  # Request 50 decimal digits; cannot recover precision lost in inputs

5. Convert to NumPy for Performance

from sympy import symbols, lambdify
import numpy as np
x = symbols("x")
expr = x**2 + 1
# Slow for many evaluations:
for x_val in range(1000):
    result = expr.subs(x, x_val).evalf()

# Fast:
f = lambdify(x, expr, 'numpy')
results = f(np.arange(1000))

6. Use Appropriate Solvers

  • solveset: Algebraic equations (primary)
  • linsolve: Linear systems
  • nonlinsolve: Nonlinear systems
  • dsolve: Differential equations
  • solve: General purpose; supports some problems solveset does not

…

자주 묻는 질문

이 도구와 일반 계산기는 어떻게 다른가요?

일반 계산기는 3.14159처럼 근사한 숫자를 사용합니다. 이 도구는 π나 2의 제곱근처럼 기호를 그대로 사용해 정확한 답을 냅니다.

숫자와 기호를 함께 쓸 수 있나요?

네, 숫자와 기호를 섞어 쓸 수 있습니다. 예를 들어 '2*x + 3*x'를 간단히 해 달라고 요청할 수 있습니다.

모든 종류의 수학 문제를 풀 수 있나요?

대수, 미적분, 일부 물리학 분야에서 아주 강력하지만, 매우 복잡하거나 특수한 수학 문제는 풀지 못할 수도 있습니다.

상세 정보

작성자의 원본 설명

Performs exact symbolic mathematics with SymPy for algebra, calculus, equation solving, symbolic linear algebra, physics, and lambdify or LaTeX code generation. Use when a task needs symbolic results, explicit assumptions, or exact arithmetic; use NumPy or SciPy for purely numerical workloads.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3579
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬