analyze-magnetic-field
정보
이 스킬은 비오-사바르 법칙, 앙페르 법칙 및 쌍극자 근사를 사용하여 전류 분포로부터 자기장을 계산하고 시각화합니다. 임의의 형상을 처리하며, 대칭성을 활용하고 다중 소스의 중첩을 분석합니다. 또한 투자율, B-H 곡선 및 히스테리시스 거동을 통해 자성 재료를 특성화합니다.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/analyze-magnetic-fieldClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Analyze Magnetic Field
Calc B-field from current distribution: characterize src geometry → select law (Biot-Savart arbitrary, Ampere high-sym) → eval integrals → check limits → incorporate material effects → visualize field-line topology.
Use When
- B-field from arbitrary current conductor (wire loop, helix, irregular)
- Exploit cylindrical/planar/toroidal sym → Ampere direct
- Estimate far-field via dipole approx
- Superpose multiple current srcs
- Analyze materials: linear permeability, B-H curves, hysteresis, saturation
In
- Required: Current distribution spec (geometry, current magnitude + direction)
- Required: Region of interest (obs pts or vol)
- Optional: Material props (mu_r, B-H curve data, coercivity, remanence)
- Optional: Accuracy (exact integral, multipole order, numerical res)
- Optional: Viz reqs (2D cross-section, 3D field lines, magnitude contour)
Do
Step 1: Characterize Current + Geometry
Fully spec src pre-method:
- Current path: Geometry each current element. Line currents → parametric curve r'(t). Surface currents → K (A/m). Volume currents → J (A/m^2).
- Coord system: Align w/ dominant sym. Cylindrical (rho, phi, z) wires/solenoids. Spherical (r, theta, phi) dipoles/loops far dist. Cartesian planar sheets.
- Sym analysis: ID translational, rotational, reflection. Src sym = field sym. Doc nonzero B-components + vanish.
- Current continuity: Verify div(J) = 0 (steady) or div(J) = -d(rho)/dt (time-varying). Inconsistent → unphysical fields.
## Source Characterization
- **Current type**: [line I / surface K / volume J]
- **Geometry**: [parametric description]
- **Coordinate system**: [and justification]
- **Symmetries**: [translational / rotational / reflection]
- **Nonzero B-components by symmetry**: [list]
- **Current continuity**: [verified / issue noted]
→ Complete geometric desc, coord system chosen, sym cataloged, continuity verified.
If err: Too complex for closed-form → discretize short straight segments (numerical Biot-Savart). Continuity violated → add displacement current or return charge accumulation before proceeding.
Step 2: Select Law
Match method to sym + complexity:
-
Ampere (high sym): Use when B extractable from line integral. Applicable:
- Infinite straight wire (cylindrical) → circular Amperian loop
- Infinite solenoid (translational + rotational) → rectangular loop
- Toroid (rotational about ring axis) → circular loop
- Infinite planar current sheet (translational in 2 dirs) → rectangular loop
-
Biot-Savart (general): Arbitrary geometries Ampere can't simplify:
- dB = (mu_0 / 4 pi) * (I dl' x r_hat) / r^2
- Vol currents: B(r) = (mu_0 / 4 pi) * integral of (J(r') x r_hat) / r^2 dV'
-
Dipole approx (far field): Obs far from src (r >> src dim d):
- Dipole moment: m = I * A * n_hat (planar loop area A)
- B_dipole(r) = (mu_0 / 4 pi) * [3(m . r_hat) r_hat - m] / r^3
- Valid r/d > 5 for ~1% accuracy
-
Superposition: Multi-src → B each independent + sum vectorially. Maxwell linearity → exact.
## Method Selection
- **Primary method**: [Ampere / Biot-Savart / dipole]
- **Justification**: [symmetry argument or distance criterion]
- **Expected complexity**: [closed-form / single integral / numerical]
- **Fallback method**: [if primary fails or for cross-validation]
→ Justified method choice, clear why law appropriate for sym level.
If err: Ampere chosen but insufficient sym (B not extractable) → fallback Biot-Savart. Src geometry too complex analytic Biot-Savart → discretize numerically.
Step 3: Set Up + Eval Field Integrals
Execute calc via Step 2 method:
-
Ampere path: Per Amperian loop:
- Parameterize path + compute line integral B . dl
- Compute enclosed I_enc counting currents threading loop
- Solve: contour_integral(B . dl) = mu_0 * I_enc
- Extract B via sym (Step 1)
-
Biot-Savart integration: Per field pt r:
- Parameterize src: dl' = (dr'/dt) dt or express J(r') over vol
- Compute displacement: r - r' + magnitude |r - r'|
- Eval cross product: dl' x (r - r') or J x (r - r')
- Integrate over src (line, surface, vol)
- Analytic eval: exploit sym reduce dim (on-axis field of loop → 1 integral)
- Numerical: discretize N segments, sum, check convergence doubling N
-
Dipole calc:
- Total magnetic moment: m = (1/2) integral (r' x J) dV' vol currents, or m = I * A * n_hat planar loop
- Apply dipole field formula at each obs pt
- Err estimate: next multipole (quadrupole) correction (d/r)^4
-
Superposition assembly: Sum all srcs per obs pt. Track components separately → preserve cancellation accuracy.
## Field Calculation
- **Integral setup**: [explicit expression]
- **Evaluation method**: [analytic / numeric with N segments]
- **Result**: B(r) = [expression with units]
- **Convergence check** (if numerical): [N vs. 2N comparison]
→ Explicit B(r) expr at obs pts, correct units (Tesla/Gauss), convergence check numerical.
If err: Integral diverges → missing regularization (field on thin wire diverges → use finite wire radius). Numerical oscillates w/ N → near-singularity → adaptive quadrature or analytical subtraction.
Step 4: Check Limits
Verify vs known physics pre-trust:
-
Far-field dipole limit: Large r, localized src → dipole formula. Compute B → r → infinity, compare (mu_0 / 4 pi) * [3(m . r_hat) r_hat - m] / r^3.
-
Near-field infinite-wire limit: Close to long straight segment (rho << length L) → B = mu_0 I / (2 pi rho). Check for relevant geometry portion.
-
On-axis special cases: Loops + solenoids have simple closed forms:
- Single circular loop radius R at dist z on axis: B_z = mu_0 I R^2 / [2 (R^2 + z^2)^(3/2)]
- Solenoid length L, n turns/length: B_interior = mu_0 n I (L >> R)
-
Sym consistency: Verify components predicted vanish (Step 1) are 0. Nonzero forbidden → err.
-
Dim analysis: Verify B = Tesla. Every term mu_0 * [current] / [length].
## Limiting Case Verification
| Case | Condition | Expected | Computed | Match |
|------|-----------|----------|----------|-------|
| Far-field dipole | r >> d | mu_0 m / (4 pi r^3) scaling | [result] | [Yes/No] |
| Near-field wire | rho << L | mu_0 I / (2 pi rho) | [result] | [Yes/No] |
| On-axis formula | [geometry] | [known result] | [result] | [Yes/No] |
| Symmetry zeros | [component] | 0 | [result] | [Yes/No] |
| Units | -- | Tesla | [check] | [Yes/No] |
→ All limits match. Field: correct units, sym, asymptotic behavior.
If err: Failed limit → err in integral setup/eval. Common: wrong sign cross product, missing factor 2/pi, wrong integration limits, coord mismatch src vs field.
Step 5: Materials + Visualize
Extend to material effects + produce viz:
-
Linear materials: Replace mu_0 w/ mu = mu_r * mu_0 inside. Boundary conds at interfaces:
- Normal: B1_n = B2_n (continuous)
- Tangential: H1_t - H2_t = K_free (surface free current)
- No free surface currents: H1_t = H2_t
-
Nonlinear (B-H curves): Ferromagnetic cores:
- B-H curve relates B + H at each pt
- Design: piecewise linear segments — linear (B = mu H), knee, saturation (B ~ constant)
- Hysteresis if op pt cycles: remanent B_r + coercive H_c define loop
-
Demagnetization: Finite-geometry magnetic materials (short rods, spheres) → internal field reduced by N_d: H_internal = H_applied - N_d * M.
-
Viz:
- Field lines via stream fn or integrating dB/ds along field direction
- Magnitude contours (|B| color map)
- 2D cross-sections → current direction (dots out, crosses in)
- Verify field lines closed loops (div B = 0) — open → viz/calc err
-
Intuition check: Field pattern makes sense qualitatively. Strongest near src, circulates around currents (right-hand rule), decays w/ dist.
## Material Effects and Visualization
- **Material model**: [vacuum / linear mu_r / nonlinear B-H / hysteretic]
- **Boundary conditions applied**: [list interfaces]
- **Visualization**: [field lines / magnitude contour / both]
- **Div B = 0 check**: [field lines close / verified numerically]
→ Complete field solution + material effects, viz closed field lines consistent div B = 0, qualitative intuition match.
If err: Field lines don't close → divergence err in calc → recheck integral/numerical. Material → unexpected amplification → verify mu_r only inside material vol + boundary conds enforced each interface.
Check
- Current distribution fully specified: geometry, magnitude, direction
- Current continuity (div J = 0 steady) verified
- Coord system aligned w/ dominant sym
- Method selection (Ampere / Biot-Savart / dipole) justified by sym
- Field integrals setup correct cross products + limits
- Numerical shows convergence (N vs 2N)
- Far-field dipole limit verified
- Near-field + on-axis match known formulas
- Forbidden sym components zero
- Units Tesla throughout
- Material boundary conds correct (if applicable)
- Field lines closed (div B = 0)
Traps
- Wrong cross-product direction: Biot-Savart = dl' x r_hat (src to field), not r_hat x dl'. Backward → flips entire field direction. Right-hand rule quick check.
- Confuse B + H: Vacuum B = mu_0 H, inside material B = mu H. Ampere via H uses free current only; via B includes bound (magnetization). Mix conventions → mu_r errors.
- Ampere no sufficient sym: Always true but only useful when sym extracts B. B varies along loop → single scalar eq for spatially varying fn → underdetermined.
- Ignore finite length of "infinite" wires: Real solenoids + wires have ends. Infinite formula valid only far from ends (dist from end >> radius). Near ends → full Biot-Savart or finite-solenoid corrections.
- Neglect demagnetization in finite: Magnetized sphere/short rod ≠ long rod in same applied field. Demag factor reduces internal field 30-100% depending aspect ratio.
- Non-physical field lines: Begin/end free space (not src or infinity) → calc/plot err. Field lines always closed loops.
→
solve-electromagnetic-induction— use computed B → analyze time-varying flux + induced EMFformulate-maxwell-equations— generalize → full Maxwell + displacement current + wave propagationdesign-electromagnetic-device— apply to electromagnets, motors, transformersformulate-quantum-problem— quantum magnetic interactions (Zeeman, spin-orbit)
GitHub 저장소
연관 스킬
executing-plans
디자인executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.
requesting-code-review
디자인이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.
connect-mcp-server
디자인이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.
web-cli-teleport
디자인이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.
