math-computation

Mathematical computation including symbolic math, numerical methods, linear algebra, calculus, differential equations, optimization, and mathematical modeling. Uses Python with SymPy, NumPy, SciPy. Use when user asks to solve equations, compute integrals/derivatives, do matrix operations, solve ODEs/PDEs, optimize functions, or build mathematical models. Triggers on "solve equation", "integral", "derivative", "matrix", "eigenvalue", "differential equation", "optimization", "linear algebra", "symbolic math", "proof".

564 stars

Best use case

math-computation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Mathematical computation including symbolic math, numerical methods, linear algebra, calculus, differential equations, optimization, and mathematical modeling. Uses Python with SymPy, NumPy, SciPy. Use when user asks to solve equations, compute integrals/derivatives, do matrix operations, solve ODEs/PDEs, optimize functions, or build mathematical models. Triggers on "solve equation", "integral", "derivative", "matrix", "eigenvalue", "differential equation", "optimization", "linear algebra", "symbolic math", "proof".

Teams using math-computation should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/math-computation/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/math-computation/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/math-computation/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How math-computation Compares

Feature / Agentmath-computationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Mathematical computation including symbolic math, numerical methods, linear algebra, calculus, differential equations, optimization, and mathematical modeling. Uses Python with SymPy, NumPy, SciPy. Use when user asks to solve equations, compute integrals/derivatives, do matrix operations, solve ODEs/PDEs, optimize functions, or build mathematical models. Triggers on "solve equation", "integral", "derivative", "matrix", "eigenvalue", "differential equation", "optimization", "linear algebra", "symbolic math", "proof".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Mathematical Computation

Symbolic and numerical mathematics. Venv: `source /Users/zhangmingda/clawd/.venv/bin/activate`

## Symbolic Math (SymPy)

```python
from sympy import *
x, y, z, t = symbols('x y z t')
a, b, c = symbols('a b c', real=True)
n, k = symbols('n k', integer=True, positive=True)

# Solve equations
solve(x**2 - 5*x + 6, x)  # [2, 3]
solve([x + y - 5, x - y - 1], [x, y])  # {x: 3, y: 2}

# Calculus
diff(sin(x)*exp(x), x)           # derivative
integrate(x**2 * exp(-x), (x, 0, oo))  # definite integral
limit(sin(x)/x, x, 0)            # limit
series(exp(x), x, 0, 5)          # Taylor series

# Linear algebra
M = Matrix([[1, 2], [3, 4]])
M.eigenvals()    # eigenvalues
M.eigenvects()   # eigenvectors
M.det()          # determinant
M.inv()          # inverse

# Differential equations
f = Function('f')
dsolve(f(x).diff(x, 2) + f(x), f(x))  # y'' + y = 0

# Simplification
simplify(sin(x)**2 + cos(x)**2)  # 1
trigsimp(expr)
factor(expr)
expand(expr)

# LaTeX output
latex(expr)  # for paper-ready equations
```

## Numerical Methods (SciPy)

```python
from scipy import optimize, integrate, linalg, interpolate
import numpy as np

# Root finding
root = optimize.brentq(lambda x: x**3 - 2*x - 5, 2, 3)

# Optimization
result = optimize.minimize(lambda x: (x[0]-1)**2 + (x[1]-2.5)**2,
                          x0=[0, 0], method='Nelder-Mead')

# Constrained optimization
from scipy.optimize import linprog, minimize
result = minimize(objective, x0, constraints=constraints, bounds=bounds)

# Numerical integration
val, err = integrate.quad(lambda x: np.exp(-x**2), -np.inf, np.inf)  # √π

# ODE solving
from scipy.integrate import solve_ivp
def lorenz(t, state, sigma=10, rho=28, beta=8/3):
    x, y, z = state
    return [sigma*(y-x), x*(rho-z)-y, x*y-beta*z]
sol = solve_ivp(lorenz, [0, 50], [1, 1, 1], dense_output=True, max_step=0.01)

# Interpolation
f_interp = interpolate.interp1d(x_data, y_data, kind='cubic')

# FFT
from scipy.fft import fft, fftfreq
yf = fft(signal)
xf = fftfreq(N, 1/sample_rate)
```

## Linear Algebra

```python
# NumPy
A = np.array([[1, 2], [3, 4]])
np.linalg.eig(A)        # eigendecomposition
np.linalg.svd(A)        # SVD
np.linalg.solve(A, b)   # solve Ax = b
np.linalg.norm(A)       # matrix norm
np.linalg.matrix_rank(A)

# Sparse matrices (SciPy)
from scipy.sparse import csr_matrix, linalg as sparse_linalg
```

## Mathematical Modeling Workflow

1. **Define** the system and variables
2. **Formulate** equations (conservation laws, constitutive relations)
3. **Non-dimensionalize** if appropriate
4. **Solve** analytically (SymPy) or numerically (SciPy)
5. **Validate** against known solutions or data
6. **Sensitivity analysis** on parameters
7. **Visualize** results

## Common Models

- **Population dynamics**: Lotka-Volterra, SIR/SEIR epidemiological
- **Diffusion**: Heat equation, Fick's law
- **Mechanics**: Newton's laws, Lagrangian/Hamiltonian
- **Economics**: Supply-demand, game theory, optimal control
- **Networks**: Graph theory, flow optimization

## Tips
- Use SymPy for exact solutions, SciPy for numerical
- Always verify numerical solutions against analytical when possible
- Check units and dimensional consistency
- Use `latex()` to generate paper-ready equations
- For large systems, consider sparse matrix methods

Related Skills

sympy-math

564
from beita6969/ScienceClaw

Symbolic mathematics via SymPy. Use when: user asks for algebraic manipulation, calculus, equation solving, or mathematical proofs. NOT for: numerical computation (use scipy) or statistical analysis.

computational-pathology-agent

564
from beita6969/ScienceClaw

COPYRIGHT NOTICE

xurl

564
from beita6969/ScienceClaw

A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.

xlsx

564
from beita6969/ScienceClaw

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

writing

564
from beita6969/ScienceClaw

No description provided.

world-bank-data

564
from beita6969/ScienceClaw

World Bank Open Data API for development indicators. Use when: user asks about GDP, population, poverty, health, or education statistics by country. NOT for: real-time financial data or stock prices.

wikipedia-search

564
from beita6969/ScienceClaw

Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information

wikidata-knowledge

564
from beita6969/ScienceClaw

Query Wikidata for structured knowledge using SPARQL and entity search. Use when: (1) finding structured facts about entities (people, places, organizations), (2) querying relationships between entities, (3) cross-referencing external identifiers (Wikipedia, VIAF, GND, ORCID), (4) building knowledge graphs from linked data. NOT for: full-text article content (use Wikipedia API), scientific literature (use semantic-scholar), geospatial data (use OpenStreetMap).

weather

564
from beita6969/ScienceClaw

Get current weather and forecasts via wttr.in or Open-Meteo. Use when: user asks about weather, temperature, or forecasts for any location. NOT for: historical weather data, severe weather alerts, or detailed meteorological analysis. No API key needed.

wacli

564
from beita6969/ScienceClaw

Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).

voice-call

564
from beita6969/ScienceClaw

Start voice calls via the OpenClaw voice-call plugin.

visualization

564
from beita6969/ScienceClaw

Create publication-quality scientific figures and plots using Python (matplotlib, seaborn, plotly). Supports bar charts, scatter plots, heatmaps, box plots, violin plots, survival curves, network graphs, and more. Use when user asks to plot data, create figures, make charts, visualize results, or generate publication-ready graphics. Triggers on "plot", "chart", "figure", "graph", "visualize", "heatmap", "scatter plot", "bar chart", "histogram".