physics-solver

Physics problem solving including classical mechanics, electromagnetism, thermodynamics, quantum mechanics, optics, and computational physics. Use when user asks to solve physics problems, simulate physical systems, derive equations, or do unit conversions. Triggers on "physics problem", "Newton's law", "electromagnetic", "quantum", "thermodynamics", "optics", "wave equation", "Schrödinger", "relativity", "unit conversion", "circuit analysis".

564 stars

Best use case

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

Physics problem solving including classical mechanics, electromagnetism, thermodynamics, quantum mechanics, optics, and computational physics. Use when user asks to solve physics problems, simulate physical systems, derive equations, or do unit conversions. Triggers on "physics problem", "Newton's law", "electromagnetic", "quantum", "thermodynamics", "optics", "wave equation", "Schrödinger", "relativity", "unit conversion", "circuit analysis".

Teams using physics-solver 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/physics-solver/SKILL.md --create-dirs "https://raw.githubusercontent.com/beita6969/ScienceClaw/main/skills/physics-solver/SKILL.md"

Manual Installation

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

How physics-solver Compares

Feature / Agentphysics-solverStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Physics problem solving including classical mechanics, electromagnetism, thermodynamics, quantum mechanics, optics, and computational physics. Use when user asks to solve physics problems, simulate physical systems, derive equations, or do unit conversions. Triggers on "physics problem", "Newton's law", "electromagnetic", "quantum", "thermodynamics", "optics", "wave equation", "Schrödinger", "relativity", "unit conversion", "circuit analysis".

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

# Physics Solver

Physics computation and problem solving. Venv: `source /Users/zhangmingda/clawd/.venv/bin/activate`

## Physical Constants

```python
from scipy import constants as const
import numpy as np

# Key constants
c = const.c           # speed of light (m/s)
h = const.h           # Planck's constant (J·s)
hbar = const.hbar     # reduced Planck's constant
k_B = const.k         # Boltzmann constant (J/K)
e = const.e           # elementary charge (C)
m_e = const.m_e       # electron mass (kg)
m_p = const.m_p       # proton mass (kg)
G = const.G           # gravitational constant
N_A = const.N_A       # Avogadro's number
epsilon_0 = const.epsilon_0  # vacuum permittivity
mu_0 = const.mu_0     # vacuum permeability
sigma = const.sigma   # Stefan-Boltzmann constant
```

## Classical Mechanics

```python
from sympy import *

t = symbols('t')
m, g, k, L = symbols('m g k L', positive=True)

# Lagrangian mechanics
# Example: Simple pendulum
theta = Function('theta')(t)
T = Rational(1,2) * m * (L * diff(theta, t))**2  # kinetic energy
V = -m * g * L * cos(theta)                        # potential energy
Lag = T - V

# Euler-Lagrange equation
EL = diff(diff(Lag, diff(theta, t)), t) - diff(Lag, theta)
eq = simplify(EL)
print(f"Equation of motion: {eq} = 0")

# Numerical simulation (projectile, pendulum, etc.)
from scipy.integrate import solve_ivp

def pendulum(t, state, g=9.81, L=1.0):
    theta, omega = state
    return [omega, -g/L * np.sin(theta)]

sol = solve_ivp(pendulum, [0, 10], [np.pi/4, 0], max_step=0.01)
```

## Electromagnetism

```python
# Coulomb's law
def coulomb_force(q1, q2, r):
    """Force between two charges (N)"""
    return const.k * q1 * q2 / r**2  # k = 1/(4πε₀)

# Capacitor energy
def capacitor_energy(C, V):
    return 0.5 * C * V**2

# RC circuit
def rc_discharge(V0, R, C, t):
    tau = R * C
    return V0 * np.exp(-t / tau)

# Electromagnetic wave
def em_wavelength(frequency):
    return const.c / frequency

def photon_energy(wavelength):
    return const.h * const.c / wavelength
```

## Quantum Mechanics

```python
# Particle in a box energy levels
def particle_in_box(n, L, m=const.m_e):
    """Energy of nth level, box length L"""
    return (n**2 * const.h**2) / (8 * m * L**2)

# Hydrogen atom energy levels
def hydrogen_energy(n):
    """Energy in eV"""
    return -13.6 / n**2

# de Broglie wavelength
def de_broglie(p):
    return const.h / p

# Heisenberg uncertainty
# Δx · Δp ≥ ℏ/2
```

## Thermodynamics & Statistical Mechanics

```python
# Ideal gas
def ideal_gas_pressure(n, T, V):
    return n * const.R * T / V

# Carnot efficiency
def carnot_efficiency(T_hot, T_cold):
    return 1 - T_cold / T_hot

# Blackbody radiation (Planck's law)
def planck_spectral_radiance(wavelength, T):
    """W/(m²·sr·m)"""
    return (2 * const.h * const.c**2 / wavelength**5) / \
           (np.exp(const.h * const.c / (wavelength * const.k * T)) - 1)

# Maxwell-Boltzmann speed distribution
def mb_speed_dist(v, T, m):
    return 4 * np.pi * (m / (2 * np.pi * const.k * T))**1.5 * \
           v**2 * np.exp(-m * v**2 / (2 * const.k * T))
```

## Unit Conversion

```python
# scipy.constants has conversion factors
from scipy.constants import eV, atm, calorie, mile, inch

# Common conversions
def eV_to_J(energy_eV): return energy_eV * eV
def J_to_eV(energy_J): return energy_J / eV
def celsius_to_kelvin(T_C): return T_C + 273.15
def atm_to_Pa(P_atm): return P_atm * atm
```

## Problem-Solving Framework

1. **Identify** the physical system and relevant principles
2. **Draw** a diagram (describe it textually)
3. **List** knowns and unknowns
4. **Choose** appropriate equations/laws
5. **Solve** symbolically first (SymPy), then substitute numbers
6. **Check** units, limiting cases, and order of magnitude
7. **Interpret** the result physically

## Tips
- Always carry units through calculations
- Check dimensional consistency
- Verify with limiting cases (e.g., v << c for classical limit)
- Use SymPy for symbolic derivations, SciPy for numerical
- For complex simulations, consider specialized tools (COMSOL, OpenFOAM)

Related Skills

nonlinear-solvers

564
from beita6969/ScienceClaw

Select and configure nonlinear solvers for f(x)=0 or min F(x). Use for Newton methods, quasi-Newton (BFGS, L-BFGS), Broyden, Anderson acceleration, diagnosing convergence issues, choosing line search vs trust region, and analyzing Jacobian quality.

linear-solvers

564
from beita6969/ScienceClaw

Select and configure linear solvers for systems Ax=b in dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, selecting preconditioners, or debugging stagnation in GMRES/CG/BiCGSTAB.

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".