[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M736HTRQFBFMBES5G2FBTP5F":3,"skill-same:01M736HTRQFBFMBES5G2FBTP5F":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M736HTRQFBFMBES5G2FBTP5F","analyze-magnetic-field",null,"Calculate and visualize magnetic fields produced by current distributions using the Biot-Savart law, Ampere's law, and magnetic dipole approximations. Use when computing B-fields from arbitrary current geometries, exploiting symmetry with Ampere's law, analyzing superposition of multiple sources, or characterizing magnetic materials through permeability, B-H curves, and hysteresis behavior.","roohe\u002Fagentic-super-skills","roohe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99054084?v=4","01M734WCDFP6RZVT5CNM00QR26","01M734WCE4BD0T4NZS5PCV9V5F",10,"MIT","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fanalyze-magnetic-field\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: analyze-magnetic-field\nlocale: caveman-lite\nsource_locale: en\nsource_commit: 82c77053\ntranslator: \"Julius Brussee homage — caveman\"\ntranslation_date: \"2026-04-19\"\ndescription: >\n  Calculate and visualize magnetic fields produced by current distributions\n  using the Biot-Savart law, Ampere's law, and magnetic dipole approximations.\n  Use when computing B-fields from arbitrary current geometries, exploiting\n  symmetry with Ampere's law, analyzing superposition of multiple sources,\n  or characterizing magnetic materials through permeability, B-H curves,\n  and hysteresis behavior.\nlicense: MIT\nallowed-tools: Read Grep Glob WebFetch WebSearch\nmetadata:\n  author: Philipp Thoss\n  version: \"1.0\"\n  domain: electromagnetism\n  complexity: intermediate\n  language: natural\n  tags: electromagnetism, magnetic-fields, biot-savart, ampere, magnetic-materials\n---\n\n# Analyze Magnetic Field\n\nCalculate the magnetic field produced by a given current distribution by characterizing the source geometry, selecting the appropriate law (Biot-Savart for arbitrary geometries, Ampere's law for high-symmetry configurations), evaluating field integrals, checking limiting cases, incorporating magnetic material effects where relevant, and visualizing the resulting field-line topology.\n\n## When to Use\n\n- Computing the B-field from an arbitrary current-carrying conductor (wire loop, helix, irregular path)\n- Exploiting cylindrical, planar, or toroidal symmetry to apply Ampere's law directly\n- Estimating far-field behavior via the magnetic dipole approximation\n- Superposing fields from multiple current sources\n- Analyzing magnetic materials: linear permeability, B-H curves, hysteresis, saturation\n\n## Inputs\n\n- **Required**: Current distribution specification (geometry, current magnitude and direction)\n- **Required**: Region of interest where the field is needed (observation points or volume)\n- **Optional**: Material properties (relative permeability, B-H curve data, coercivity, remanence)\n- **Optional**: Desired accuracy level (exact integral, multipole expansion order, numerical resolution)\n- **Optional**: Visualization requirements (2D cross-section, 3D field lines, magnitude contour map)\n\n## Procedure\n\n### Step 1: Characterize Current Distribution and Geometry\n\nFully specify the source before selecting a method:\n\n1. **Current path**: Describe the geometry of every current-carrying element. For line currents, specify the path as a parametric curve r'(t). For surface currents, specify the surface current density K (A\u002Fm). For volume currents, specify J (A\u002Fm^2).\n2. **Coordinate system**: Choose coordinates aligned with the dominant symmetry. Cylindrical (rho, phi, z) for wires and solenoids. Spherical (r, theta, phi) for dipoles and loops at large distances. Cartesian for planar sheets.\n3. **Symmetry analysis**: Identify translational, rotational, and reflection symmetries. A symmetry of the source is a symmetry of the field. Document which components of B are nonzero by symmetry and which vanish.\n4. **Current continuity**: Verify that the current distribution satisfies div(J) = 0 (steady state) or div(J) = -d(rho)\u002Fdt (time-varying). Inconsistent current distributions produce unphysical fields.\n\n```markdown\n## Source Characterization\n- **Current type**: [line I \u002F surface K \u002F volume J]\n- **Geometry**: [parametric description]\n- **Coordinate system**: [and justification]\n- **Symmetries**: [translational \u002F rotational \u002F reflection]\n- **Nonzero B-components by symmetry**: [list]\n- **Current continuity**: [verified \u002F issue noted]\n```\n\n**Got:** A complete geometric description of the current distribution with coordinate system chosen, symmetries cataloged, and current continuity verified.\n\n**If fail:** If the geometry is too complex for a closed-form parametric description, discretize into short straight segments (numerical Biot-Savart). If current continuity is violated, add displacement current or return charge accumulation terms before proceeding.\n\n### Step 2: Select Appropriate Law\n\nChoose the method that matches the problem's symmetry and complexity:\n\n1. **Ampere's law** (high symmetry): Use when the current distribution has sufficient symmetry that B can be pulled out of the line integral. Applicable cases:\n   - Infinite straight wire (cylindrical symmetry) -> circular Amperian loop\n   - Infinite solenoid (translational + rotational) -> rectangular Amperian loop\n   - Toroid (rotational about the ring axis) -> circular Amperian loop\n   - Infinite planar current sheet (translational in two directions) -> rectangular loop\n\n2. **Biot-Savart law** (general): Use for arbitrary geometries where Ampere's law cannot simplify:\n   - dB = (mu_0 \u002F 4 pi) * (I dl' x r_hat) \u002F r^2\n   - For volume currents: B(r) = (mu_0 \u002F 4 pi) * integral of (J(r') x r_hat) \u002F r^2 dV'\n\n3. **Magnetic dipole approximation** (far field): Use when the observation point is far from the source (r >> source dimension d):\n   - Compute the magnetic dipole moment: m = I * A * n_hat (for a planar loop of area A)\n   - B_dipole(r) = (mu_0 \u002F 4 pi) * [3(m . r_hat) r_hat - m] \u002F r^3\n   - Valid when r\u002Fd > 5 for ~1% accuracy\n\n4. **Superposition**: For multiple sources, compute B from each independently and sum vectorially. Linearity of Maxwell's equations guarantees this is exact.\n\n```markdown\n## Method Selection\n- **Primary method**: [Ampere \u002F Biot-Savart \u002F dipole]\n- **Justification**: [symmetry argument or distance criterion]\n- **Expected complexity**: [closed-form \u002F single integral \u002F numerical]\n- **Fallback method**: [if primary fails or for cross-validation]\n```\n\n**Got:** A justified choice of method with a clear statement of why the chosen law is appropriate for the problem's symmetry level.\n\n**If fail:** If Ampere's law is chosen but the symmetry is insufficient (B cannot be extracted from the integral), fall back to Biot-Savart. If the source geometry is too complex for analytic Biot-Savart, discretize numerically.\n\n### Step 3: Set Up and Evaluate Field Integrals\n\nExecute the calculation using the method selected in Step 2:\n\n1. **Ampere's law path**: For each Amperian loop:\n   - Parameterize the loop path and compute the line integral of B . dl\n   - Compute the enclosed current I_enc by counting all currents threading the loop\n   - Solve: contour_integral(B . dl) = mu_0 * I_enc\n   - Extract B from the integral using the symmetry established in Step 1\n\n2. **Biot-Savart integration**: For each field point r:\n   - Parameterize the source: dl' = (dr'\u002Fdt) dt or express J(r') over the volume\n   - Compute the displacement vector: r - r' and its magnitude |r - r'|\n   - Evaluate the cross product: dl' x (r - r') or J x (r - r')\n   - Integrate over the source (line, surface, or volume)\n   - For analytic evaluation: exploit symmetry to reduce dimensionality (e.g., on-axis field of a loop involves only one integral)\n   - For numerical evaluation: discretize into N segments, compute the sum, and check convergence by doubling N\n\n3. **Dipole calculation**:\n   - Compute total magnetic moment: m = (1\u002F2) integral of (r' x J) dV' for volume currents, or m = I * A * n_hat for a planar loop\n   - Apply the dipole field formula at each observation point\n   - Estimate the error: the next multipole (quadrupole) correction scales as (d\u002Fr)^4\n\n4. **Superposition assembly**: Sum contributions from all sources at each observation point. Track components separately to preserve cancellation accuracy.\n\n```markdown\n## Field Calculation\n- **Integral setup**: [explicit expression]\n- **Evaluation method**: [analytic \u002F numeric with N segments]\n- **Result**: B(r) = [expression with units]\n- **Convergence check** (if numerical): [N vs. 2N comparison]\n```\n\n**Got:** An explicit expression for B(r) at the observation points, with correct units (Tesla or Gauss) and a convergence check for numerical results.\n\n**If fail:** If the integral diverges, check for a missing regularization (e.g., the field on the wire itself diverges for an infinitely thin wire -- use finite wire radius). If numerical results oscillate with N, the integrand has a near-singularity that requires adaptive quadrature or analytical subtraction of the singular part.\n\n### Step 4: Check Limiting Cases\n\nVerify the result against known physics before trusting it:\n\n1. **Far-field dipole limit**: At large r, any localized current distribution should produce a field that matches the magnetic dipole formula. Compute B from your result in the limit r -> infinity and compare with (mu_0 \u002F 4 pi) * [3(m . r_hat) r_hat - m] \u002F r^3.\n\n2. **Near-field infinite-wire limit**: Close to a long straight segment of the conductor (distance rho \u003C\u003C length L), the field should approach B = mu_0 I \u002F (2 pi rho). Check this for the relevant portion of your geometry.\n\n3. **On-axis special cases**: For loops and solenoids, the on-axis field has simple closed forms:\n   - Single circular loop of radius R at distance z on axis: B_z = mu_0 I R^2 \u002F [2 (R^2 + z^2)^(3\u002F2)]\n   - Solenoid of length L, n turns per length: B_interior = mu_0 n I (for L >> R)\n\n4. **Symmetry consistency**: Verify that components predicted to vanish by symmetry (Step 1) are indeed zero in the computed result. A nonzero forbidden component indicates an error.\n\n5. **Dimensional analysis**: Verify that B has units of Tesla. Every term should carry mu_0 * [current] \u002F [length] or equivalent.\n\n```markdown\n## Limiting Case Verification\n| Case | Condition | Expected | Computed | Match |\n|------|-----------|----------|----------|-------|\n| Far-field dipole | r >> d | mu_0 m \u002F (4 pi r^3) scaling | [result] | [Yes\u002FNo] |\n| Near-field wire | rho \u003C\u003C L | mu_0 I \u002F (2 pi rho) | [result] | [Yes\u002FNo] |\n| On-axis formula | [geometry] | [known result] | [result] | [Yes\u002FNo] |\n| Symmetry zeros | [component] | 0 | [result] | [Yes\u002FNo] |\n| Units | -- | Tesla | [check] | [Yes\u002FNo] |\n```\n\n**Got:** All limiting cases match. The field has the correct units, symmetry, and asymptotic behavior.\n\n**If fail:** A failed limit indicates an error in the integral setup or evaluation. The most common causes are: wrong sign in the cross product, missing factor of 2 or pi, incorrect limits of integration, or a coordinate system mismatch between source and field point parameterizations.\n\n### Step 5: Incorporate Magnetic Materials and Visualize\n\nExtend the analysis to include material effects and produce field visualizations:\n\n1. **Linear magnetic materials**: Replace mu_0 with mu = mu_r * mu_0 inside the material. Apply boundary conditions at material interfaces:\n   - Normal component: B1_n = B2_n (continuous)\n   - Tangential component: H1_t - H2_t = K_free (surface free current)\n   - In the absence of free surface currents: H1_t = H2_t\n\n2. **Nonlinear materials (B-H curves)**: For ferromagnetic cores:\n   - Use the material's B-H curve to relate B and H at each point\n   - For design purposes, approximate with piecewise linear segments: linear region (B = mu H), knee region, and saturation region (B approximately constant)\n   - Account for hysteresis if the operating point cycles: remanent magnetization B_r and coercive field H_c define the loop\n\n3. **Demagnetization effects**: For finite-geometry magnetic materials (e.g., short rods, spheres), the internal field is reduced by the demagnetization factor N_d: H_internal = H_applied - N_d * M.\n\n4. **Field visualization**:\n   - Plot field lines using the stream function or by integrating dB\u002Fds along the field direction\n   - Plot magnitude contours (|B| as a color map)\n   - For 2D cross-sections, indicate the current direction (dots for out-of-page, crosses for into-page)\n   - Verify that field lines form closed loops (div B = 0) -- open field lines indicate a visualization or calculation error\n\n5. **Physical intuition check**: Confirm that the field pattern makes qualitative sense. The field should be strongest near the current source, should circulate around currents (right-hand rule), and should decay with distance.\n\n```markdown\n## Material Effects and Visualization\n- **Material model**: [vacuum \u002F linear mu_r \u002F nonlinear B-H \u002F hysteretic]\n- **Boundary conditions applied**: [list interfaces]\n- **Visualization**: [field lines \u002F magnitude contour \u002F both]\n- **Div B = 0 check**: [field lines close \u002F verified numerically]\n```\n\n**Got:** A complete field solution including material effects where relevant, with a visualization that shows closed field lines consistent with div B = 0 and qualitative behavior matching physical intuition.\n\n**If fail:** If field lines do not close, the calculation has a divergence error -- recheck the integral or numerical method. If the material introduces unexpected field amplification, verify that mu_r is applied only inside the material volume and that boundary conditions are correctly enforced at every interface.\n\n## Validation\n\n- [ ] Current distribution is fully specified with geometry, magnitude, and direction\n- [ ] Current continuity (div J = 0 for steady state) is verified\n- [ ] Coordinate system is aligned with the dominant symmetry\n- [ ] Method selection (Ampere \u002F Biot-Savart \u002F dipole) is justified by symmetry analysis\n- [ ] Field integrals are set up with correct cross products and limits\n- [ ] Numerical results show convergence (N vs. 2N test)\n- [ ] Far-field dipole limit is verified\n- [ ] Near-field and on-axis limits match known formulas\n- [ ] Forbidden symmetry components are zero\n- [ ] Units are Tesla throughout\n- [ ] Material boundary conditions are correctly applied (if applicable)\n- [ ] Field lines form closed loops (div B = 0)\n\n## Pitfalls\n\n- **Wrong cross-product direction**: The Biot-Savart cross product is dl' x r_hat (source to field), not r_hat x dl'. Getting this backward flips the entire field direction. Use the right-hand rule as a quick check.\n- **Confusing B and H**: In vacuum B = mu_0 H, but inside magnetic materials B = mu H. Ampere's law in terms of H uses free current only; in terms of B it includes bound (magnetization) currents. Mixing conventions produces factors-of-mu_r errors.\n- **Applying Ampere's law without sufficient symmetry**: Ampere's law is always true but only useful when symmetry allows B to be extracted from the integral. If B varies along the Amperian loop, the law gives a single scalar equation for a spatially varying function -- underdetermined.\n- **Ignoring the finite length of \"infinite\" wires**: Real solenoids and wires have ends. The infinite-wire or infinite-solenoid formula is valid only far from the ends (distance from end >> radius). Near the ends, use the full Biot-Savart integral or finite-solenoid corrections.\n- **Neglecting demagnetization in finite geometries**: A magnetized sphere or short rod does not have the same internal field as a long rod in the same applied field. The demagnetization factor can reduce the effective internal field by 30-100% depending on the aspect ratio.\n- **Non-physical field lines**: If a visualization shows field lines that begin or end in free space (not on a current source or at infinity), the calculation or plotting algorithm has an error. Magnetic field lines always form closed loops.\n\n## Related Skills\n\n- `solve-electromagnetic-induction` -- use the computed B-field to analyze time-varying flux and induced EMF\n- `formulate-maxwell-equations` -- generalize to the full set of Maxwell's equations including displacement current and wave propagation\n- `design-electromagnetic-device` -- apply magnetic field analysis to the design of electromagnets, motors, and transformers\n- `formulate-quantum-problem` -- quantum treatment of magnetic interactions (Zeeman effect, spin-orbit coupling)\n","# Analyze Magnetic Field\n\nCalculate the magnetic field produced by a given current distribution by characterizing the source geometry, selecting the appropriate law (Biot-Savart for arbitrary geometries, Ampere's law for high-symmetry configurations), evaluating field integrals, checking limiting cases, incorporating magnetic material effects where relevant, and visualizing the resulting field-line topology.\n\n## When to Use\n\n- Computing the B-field from an arbitrary current-carrying conductor (wire loop, helix, irregular path)\n- Exploiting cylindrical, planar, or toroidal symmetry to apply Ampere's law directly\n- Estimating far-field behavior via the magnetic dipole approximation\n- Superposing fields from multiple current sources\n- Analyzing magnetic materials: linear permeability, B-H curves, hysteresis, saturation\n\n## Inputs\n\n- **Required**: Current distribution specification (geometry, current magnitude and direction)\n- **Required**: Region of interest where the field is needed (observation points or volume)\n- **Optional**: Material properties (relative permeability, B-H curve data, coercivity, remanence)\n- **Optional**: Desired accuracy level (exact integral, multipole expansion order, numerical resolution)\n- **Optional**: Visualization requirements (2D cross-section, 3D field lines, magnitude contour map)\n\n## Procedure\n\n### Step 1: Characterize Current Distribution and Geometry\n\nFully specify the source before selecting a method:\n\n1. **Current path**: Describe the geometry of every current-carrying element. For line currents, specify the path as a parametric curve r'(t). For surface currents, specify the surface current density K (A\u002Fm). For volume currents, specify J (A\u002Fm^2).\n2. **Coordinate system**: Choose coordinates aligned with the dominant symmetry. Cylindrical (rho, phi, z) for wires and solenoids. Spherical (r, theta, phi) for dipoles and loops at large distances. Cartesian for planar sheets.\n3. **Symmetry analysis**: Identify translational, rotational, and reflection symmetries. A symmetry of the source is a symmetry of the field. Document which components of B are nonzero by symmetry and which vanish.\n4. **Current continuity**: Verify that the current distribution satisfies div(J) = 0 (steady state) or div(J) = -d(rho)\u002Fdt (time-varying). Inconsistent current distributions produce unphysical fields.\n\n```markdown\n## Source Characterization\n- **Current type**: [line I \u002F surface K \u002F volume J]\n- **Geometry**: [parametric description]\n- **Coordinate system**: [and justification]\n- **Symmetries**: [translational \u002F rotational \u002F reflection]\n- **Nonzero B-components by symmetry**: [list]\n- **Current continuity**: [verified \u002F issue noted]\n```\n\n**Got:** A complete geometric description of the current distribution with coordinate system chosen, symmetries cataloged, and current continuity verified.\n\n**If fail:** If the geometry is too complex for a closed-form parametric description, discretize into short straight segments (numerical Biot-Savart). If current continuity is violated, add displacement current or return charge accumulation terms before proceeding.\n\n### Step 2: Select Appropriate Law\n\nChoose the method that matches the problem's symmetry and complexity:\n\n1. **Ampere's law** (high symmetry): Use when the current distribution has sufficient symmetry that B can be pulled out of the line integral. Applicable cases:\n   - Infinite straight wire (cylindrical symmetry) -> circular Amperian loop\n   - Infinite solenoid (translational + rotational) -> rectangular Amperian loop\n   - Toroid (rotational about the ring axis) -> circular Amperian loop\n   - Infinite planar current sheet (translational in two directions) -> rectangular loop\n\n2. **Biot-Savart law** (general): Use for arbitrary geometries where Ampere's law cannot simplify:\n   - dB = (mu_0 \u002F 4 pi) * (I dl' x r_hat) \u002F r^2\n   - For volume currents: B(r) = (mu_0 \u002F 4 pi) * integral of (J(r') x r_hat) \u002F r^2 dV'\n\n3. **Magnetic dipole approximation** (far field): Use when the observation point is far from the source (r >> source dimension d):\n   - Compute the magnetic dipole moment: m = I * A * n_hat (for a planar loop of area A)\n   - B_dipole(r) = (mu_0 \u002F 4 pi) * [3(m . r_hat) r_hat - m] \u002F r^3\n   - Valid when r\u002Fd > 5 for ~1% accuracy\n\n4. **Superposition**: For multiple sources, compute B from each independently and sum vectorially. Linearity of Maxwell's equations guarantees this is exact.\n\n```markdown\n## Method Selection\n- **Primary method**: [Ampere \u002F Biot-Savart \u002F dipole]\n- **Justification**: [symmetry argument or distance criterion]\n- **Expected complexity**: [closed-form \u002F single integral \u002F numerical]\n- **Fallback method**: [if primary fails or for cross-validation]\n```\n\n**Got:** A justified choice of method with a clear statement of why the chosen law is appropriate for the problem's symmetry level.\n\n**If fail:** If Ampere's law is chosen but the symmetry is insufficient (B cannot be extracted from the integral), fall back to Biot-Savart. If the source geometry is too complex for analytic Biot-Savart, discretize numerically.\n\n### Step 3: Set Up and Evaluate Field Integrals\n\nExecute the calculation using the method selected in Step 2:\n\n1. **Ampere's law path**: For each Amperian loop:\n   - Parameterize the loop path and compute the line integral of B . dl\n   - Compute the enclosed current I_enc by counting all currents threading the loop\n   - Solve: contour_integral(B . dl) = mu_0 * I_enc\n   - Extract B from the integral using the symmetry established in Step 1\n\n2. **Biot-Savart integration**: For each field point r:\n   - Parameterize the source: dl' = (dr'\u002Fdt) dt or express J(r') over the volume\n   - Compute the displacement vector: r - r' and its magnitude |r - r'|\n   - Evaluate the cross product: dl' x (r - r') or J x (r - r')\n   - Integrate over the source (line, surface, or volume)\n   - For analytic evaluation: exploit symmetry to reduce dimensionality (e.g., on-axis field of a loop involves only one integral)\n   - For numerical evaluation: discretize into N segments, compute the sum, and check convergence by doubling N\n\n3. **Dipole calculation**:\n   - Compute total magnetic moment: m = (1\u002F2) integral of (r' x J) dV' for volume currents, or m = I * A * n_hat for a planar loop\n   - Apply the dipole field formula at each observation point\n   - Estimate the error: the next multipole (quadrupole) correction scales as (d\u002Fr)^4\n\n4. **Superposition assembly**: Sum contributions from all sources at each observation point. Track components separately to preserve cancellation accuracy.\n\n```markdown\n## Field Calculation\n- **Integral setup**: [explicit expression]\n- **Evaluation method**: [analytic \u002F numeric with N segments]\n- **Result**: B(r) = [expression with units]\n- **Convergence check** (if numerical): [N vs. 2N comparison]\n```\n\n**Got:** An explicit expression for B(r) at the observation points, with correct units (Tesla or Gauss) and a convergence check for numerical results.\n\n**If fail:** If the integral diverges, check for a missing regularization (e.g., the field on the wire itself diverges for an infinitely thin wire -- use finite wire radius). If numerical results oscillate with N, the integrand has a near-singularity that requires adaptive quadrature or analytical subtraction of the singular part.\n\n### Step 4: Check Limiting Cases\n\nVerify the result against known physics before trusting it:\n\n1. **Far-field dipole limit**: At large r, any localized current distribution should produce a field that matches the magnetic dipole formula. Compute B from your result in the limit r -> infinity and compare with (mu_0 \u002F 4 pi) * [3(m . r_hat) r_hat - m] \u002F r^3.\n\n2. **Near-field infinite-wire limit**: Close to a long straight segment of the conductor (distance rho \u003C\u003C length L), the field should approach B = mu_0 I \u002F (2 pi rho). Check this for the relevant portion of your geometry.\n\n3. **On-axis special cases**: For loops and solenoids, the on-axis field has simple closed forms:\n   - Single circular loop of radius R at distance z on axis: B_z = mu_0 I R^2 \u002F [2 (R^2 + z^2)^(3\u002F2)]\n   - Solenoid of length L, n turns per length: B_interior = mu_0 n I (for L >> R)\n\n4. **Symmetry consistency**: Verify that components predicted to vanish by symmetry (Step 1) are indeed zero in the computed result. A nonzero forbidden component indicates an error.\n\n5. **Dimensional analysis**: Verify that B has units of Tesla. Every term should carry mu_0 * [current] \u002F [length] or equivalent.\n\n```markdown\n## Limiting Case Verification\n| Case | Condition | Expected | Computed | Match |\n|------|-----------|----------|----------|-------|\n| Far-field dipole | r >> d | mu_0 m \u002F (4 pi r^3) scaling | [result] | [Yes\u002FNo] |\n| Near-field wire | rho \u003C\u003C L | mu_0 I \u002F (2 pi rho) | [result] | [Yes\u002FNo] |\n| On-axis formula | [geometry] | [known result] | [result] | [Yes\u002FNo] |\n| Symmetry zeros | [component] | 0 | [result] | [Yes\u002FNo] |\n| Units | -- | Tesla | [check] | [Yes\u002FNo] |\n```\n\n**Got:** All limiting cases match. The field has the correct units, symmetry, and asymptotic behavior.\n\n**If fail:** A failed limit indicates an error in the integral setup or evaluation. The most common causes are: wrong sign in the cross product, missing factor of 2 or pi, incorrect limits of integration, or a coordinate system mismatch between source and field point parameterizations.\n\n### Step 5: Incorporate Magnetic Materials and Visualize\n\nExtend the analysis to include material effects and produce field visualizations:\n\n1. **Linear magnetic materials**: Replace mu_0 with mu = mu_r * mu_0 inside the material. Apply boundary conditions at material interfaces:\n   - Normal component: B1_n = B2_n (continuous)\n   - Tangential component: H1_t - H2_t = K_free (surface free current)\n   - In the absence of free surface currents: H1_t = H2_t\n\n2. **Nonlinear materials (B-H curves)**: For ferromagnetic cores:\n   - Use the material's B-H curve to relate B and H at each point\n   - For design purposes, approximate with piecewise linear segments: linear region (B = mu H), knee region, and saturation region (B approximately constant)\n   - Account for hysteresis if the operating point cycles: remanent magnetization B_r and coercive field H_c define the loop\n\n3. **Demagnetization effects**: For finite-geometry magnetic materials (e.g., short rods, spheres), the internal field is reduced by the demagnetization factor N_d: H_internal = H_applied - N_d * M.\n\n4. **Field visualization**:\n   - Plot field lines using the stream function or by integrating dB\u002Fds along the field direction\n   - Plot magnitude contours (|B| as a color map)\n   - For 2D cross-sections, indicate the current direction (dots for out-of-page, crosses for into-page)\n   - Verify that field lines form closed loops (div B = 0) -- open field lines indicate a visualization or calculation error\n\n5. **Physical intuition check**: Confirm that the field pattern makes qualitative sense. The field should be strongest near the current source, should circulate around currents (right-hand rule), and should decay with distance.\n\n```markdown\n## Material Effects and Visualization\n- **Material model**: [vacuum \u002F linear mu_r \u002F nonlinear B-H \u002F hysteretic]\n- **Boundary conditions applied**: [list interfaces]\n- **Visualization**: [field lines \u002F magnitude contour \u002F both]\n- **Div B = 0 check**: [field lines close \u002F verified numerically]\n```\n\n**Got:** A complete field solution including material effects where relevant, with a visualization that shows closed field lines consistent with div B = 0 and qualitative behavior matching physical intuition.\n\n**If fail:** If field lines do not close, the calculation has a divergence error -- recheck the integral or numerical method. If the material introduces unexpected field amplification, verify that mu_r is applied only inside the material volume and that boundary conditions are correctly enforced at every interface.\n\n## Validation\n\n- [ ] Current distribution is fully specified with geometry, magnitude, and direction\n- [ ] Current continuity (div J = 0 for steady state) is verified\n- [ ] Coordinate system is aligned with the dominant symmetry\n- [ ] Method selection (Ampere \u002F Biot-Savart \u002F dipole) is justified by symmetry analysis\n- [ ] Field integrals are set up with correct cross products and limits\n- [ ] Numerical results show convergence (N vs. 2N test)\n- [ ] Far-field dipole limit is verified\n- [ ] Near-field and on-axis limits match known formulas\n- [ ] Forbidden symmetry components are zero\n- [ ] Units are Tesla throughout\n- [ ] Material boundary conditions are correctly applied (if applicable)\n- [ ] Field lines form closed loops (div B = 0)\n\n## Pitfalls\n\n- **Wrong cross-product direction**: The Biot-Savart cross product is dl' x r_hat (source to field), not r_hat x dl'. Getting this backward flips the entire field direction. Use the right-hand rule as a quick check.\n- **Confusing B and H**: In vacuum B = mu_0 H, but inside magnetic materials B = mu H. Ampere's law in terms of H uses free current only; in terms of B it includes bound (magnetization) currents. Mixing conventions produces factors-of-mu_r errors.\n- **Applying Ampere's law without sufficient symmetry**: Ampere's law is always true but only useful when symmetry allows B to be extracted from the integral. If B varies along the Amperian loop, the law gives a single scalar equation for a spatially varying function -- underdetermined.\n- **Ignoring the finite length of \"infinite\" wires**: Real solenoids and wires have ends. The infinite-wire or infinite-solenoid formula is valid only far from the ends (distance from end >> radius). Near the ends, use the full Biot-Savart integral or finite-solenoid corrections.\n- **Neglecting demagnetization in finite geometries**: A magnetized sphere or short rod does not have the same internal field as a long rod in the same applied field. The demagnetization factor can reduce the effective internal field by 30-100% depending on the aspect ratio.\n- **Non-physical field lines**: If a visualization shows field lines that begin or end in free space (not on a current source or at infinity), the calculation or plotting algorithm has an error. Magnetic field lines always form closed loops.\n\n## Related Skills\n\n- `solve-electromagnetic-induction` -- use the computed B-field to analyze time-varying flux and induced EMF\n- `formulate-maxwell-equations` -- generalize to the full set of Maxwell's equations including displacement current and wave propagation\n- `design-electromagnetic-device` -- apply magnetic field analysis to the design of electromagnets, motors, and transformers\n- `formulate-quantum-problem` -- quantum treatment of magnetic interactions (Zeeman effect, spin-orbit coupling)\n",{"name":5,"locale":23,"license":14,"metadata":24,"translator":31,"description":32,"allowed-tools":33,"source_commit":34,"source_locale":35,"translation_date":36},"caveman-lite",{"tags":25,"author":26,"domain":27,"version":28,"language":29,"complexity":30},"electromagnetism, magnetic-fields, biot-savart, ampere, magnetic-materials","Philipp Thoss","electromagnetism","1.0","natural","intermediate","Julius Brussee homage — caveman","Calculate and visualize magnetic fields produced by current distributions using the Biot-Savart law, Ampere's law, and magnetic dipole approximations. Use when computing B-fields from arbitrary current geometries, exploiting symmetry with Ampere's law, analyzing superposition of multiple sources, or characterizing magnetic materials through permeability, B-H curves, and hysteresis behavior.\n","Read Grep Glob WebFetch WebSearch","82c77053","en","2026-04-19","master","f483e54f3ad5f202a77d45f2e57f8d970b71195f","skills_library\u002Fanalyze-magnetic-field",2,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills","https:\u002F\u002Fgithub.com\u002Froohe","yoou.link","2026-05-19 15:56:07",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add roohe\u002Fagentic-super-skills --skill analyze-magnetic-field",{"tool":51,"command":52},"bunx","bunx skills add roohe\u002Fagentic-super-skills --skill analyze-magnetic-field",{"tool":54,"command":55},"pnpm","pnpm dlx skills add roohe\u002Fagentic-super-skills --skill analyze-magnetic-field","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fanalyze-magnetic-field\u002FSKILL.md",true,[],[60,67,74,81,88,95],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M73D865CZME2FCMKA4PQM348","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M73D7Z64J4ABWZJD7P44XBBF","youtube-downloader","Download and process YouTube content for research. Use when: downloading competitor videos for analysis; extracting audio for podcasts; getting transcripts for content repurposing; archiving webinars; research content curation","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M73D7K8778TGZV3GJFR3703D","yc-pitch-deck","Create a compelling startup pitch deck that follows the structure proven to raise billions from top investors. Master the YC and Sequoia formats that get founders funded. Use when: **Fundraising** to create investor pitch decks; **YC application** to structure your narrative; **Demo Day prep** to craft your 2-minute pitch; **Angel investors** to communicate your opportunity; **Partnership pitches** to structure compelling asks","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyc-pitch-deck\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M73D70KJSE0E8Z28YMNNRT04","x-twitter-scraper","Use when the user needs X (Twitter) data or confirmation-gated X actions through Xquik: tweet search, user lookup, follower extraction, media download, monitoring, webhooks, MCP, SDKs, posting, likes, DMs, and profile updates. Requires a Xquik API key. Never ask for X login material.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fx-twitter-scraper\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M73D6ED01GV077R7K4NZNFZJ","write-vignette","Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-vignette\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M73D69YJR0BK3NFHE0CYG3EF","write-validation-documentation","Write IQ\u002FOQ\u002FPQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-validation-documentation\u002FSKILL.md",[],[]]