From agent-almanac
Solves electromagnetic induction problems using Faraday's law, Lenz's law, motional EMF, mutual/self-inductance, and RL circuit transients. Use for induced EMF, current direction, energy storage.
npx claudepluginhub pjt222/agent-almanacThis skill uses the workspace's default tool permissions.
---
Calculates and visualizes magnetic fields from current distributions using Biot-Savart law, Ampere's law, and dipole approximations. For arbitrary geometries, symmetry cases, superpositions, and magnetic materials.
Provides patterns for electric motor control including FOC, stepper motor control, encoder interfaces, current sensing, and power electronics for BLDC, PMSM, DC brushed, stepper applications.
Performs symbolic math in Python using SymPy: solves equations algebraically, computes derivatives/integrals/limits, simplifies expressions, handles matrices, physics, and generates code.
Share bugs, ideas, or general feedback.
Analyze electromagnetic induction phenomena by identifying the source of changing magnetic flux, computing the flux through the relevant surface, applying Faraday's law to obtain the induced EMF, determining the induced current direction via Lenz's law, and solving the resulting circuit equations including RL transients and energy stored in the magnetic field.
Classify the physical mechanism that produces a time-varying magnetic flux:
For each mechanism, identify the relevant surface S bounded by the circuit loop C:
## Flux Change Classification
- **Mechanism**: [changing B / changing area / motional / combined]
- **Surface S**: [description of the surface bounded by the loop]
- **Time dependence**: [which quantities vary: B(t), A(t), v(t), theta(t)]
- **Relevant parameters**: [B magnitude, loop dimensions, velocity, angular frequency]
Expected: A clear identification of why the flux changes, what surface to integrate over, and which physical quantities carry the time dependence.
On failure: If the source of changing flux is ambiguous (e.g., a deforming loop in a non-uniform field), decompose the problem into a sum of contributions: one from the field change at fixed geometry, and one from the geometry change in the instantaneous field. This decomposition is always valid.
Compute the magnetic flux Phi_B = integral of B . dA over the surface S:
Uniform field, flat loop: Phi_B = B * A * cos(theta), where theta is the angle between B and the area normal vector n_hat. This is the most common textbook case.
Non-uniform field: Parameterize the surface S and evaluate the integral:
Coupled coils (mutual inductance): For coil 2 linked to coil 1:
Self-inductance: For a single coil carrying current I:
Time dependence: Express Phi_B(t) explicitly by substituting the time-varying quantities identified in Step 1.
## Flux Calculation
- **Flux expression**: Phi_B(t) = [formula]
- **Evaluation**: [analytic / numeric]
- **Flux linkage** (if multi-turn): Lambda = N * Phi_B = [formula]
- **Inductance** (if applicable): L = [value with units] or M = [value with units]
Expected: An explicit expression for Phi_B(t) with correct units (Weber = T . m^2) and, if applicable, inductance values with units of Henry.
On failure: If the flux integral cannot be evaluated analytically (e.g., non-uniform field over a non-trivial surface), use numerical quadrature. For mutual inductance of complex geometries, consider the Neumann formula: M = (mu_0 / 4 pi) * double_contour_integral of (dl_1 . dl_2) / |r_1 - r_2|.
Compute the induced EMF from the time derivative of the flux:
Faraday's law: EMF = -d(Lambda)/dt = -N * d(Phi_B)/dt. The negative sign encodes Lenz's law (opposition to the change).
Differentiation: Take the total time derivative of Phi_B(t):
Motional EMF (alternative derivation): For a conductor of length l moving with velocity v in field B:
Sign and magnitude check: The magnitude of EMF should be physically reasonable. For typical laboratory setups: mV to V range. For power generation: V to kV range.
## Induced EMF
- **EMF expression**: EMF(t) = [formula]
- **Peak EMF** (if AC): EMF_0 = [value with units]
- **RMS EMF** (if AC): EMF_rms = EMF_0 / sqrt(2) = [value]
- **Derivation method**: [Faraday's law / motional EMF / Leibniz rule]
Expected: An explicit expression for EMF(t) with correct units (Volts) and physically reasonable magnitude.
On failure: If the EMF has wrong units, trace back to the flux calculation -- a missing factor of area or an inconsistent unit system (e.g., mixing CGS and SI) is the most likely cause. If the EMF sign seems wrong, re-examine the surface normal orientation relative to the circuit loop direction (right-hand rule).
Establish the direction of the induced current and its physical consequences:
Lenz's law statement: The induced current flows in the direction that opposes the change in magnetic flux that produced it. This is a consequence of energy conservation.
Application procedure:
Force consequences: The induced current in the presence of the external B-field experiences a force:
Qualitative verification: The induced effects should always resist the change. A falling magnet through a conducting tube falls slower than in free fall. A generator requires mechanical work input to produce electrical energy.
## Current Direction
- **Flux change**: [increasing / decreasing]
- **Induced B direction**: [opposing increase / supporting decrease]
- **Current direction**: [CW / CCW as viewed from specified direction]
- **Mechanical consequence**: [braking force / levitation / energy transfer]
Expected: A clearly stated current direction that is consistent with Lenz's law, with the physical consequence (force, braking, energy transfer) identified.
On failure: If the current direction seems to amplify the flux change rather than oppose it, the surface normal orientation or the right-hand rule application is reversed. Re-examine the loop orientation convention. A current that reinforces the flux change would violate energy conservation.
Formulate and solve the circuit equation including the inductance:
RL circuit formation: When the induced EMF drives current through a circuit with resistance R and inductance L, Kirchhoff's voltage law gives:
Solution of the first-order ODE:
Energy analysis:
Mutual inductance coupling: For two coupled coils with mutual inductance M:
Steady-state and transient separation: For AC-driven circuits, decompose the solution into a transient (decaying exponential) and steady-state (sinusoidal at the drive frequency). Report impedance Z_L = j omega L and phase angle.
## Circuit Solution
- **Circuit type**: [RL energizing / de-energizing / AC driven / coupled coils]
- **Time constant**: tau = L/R = [value with units]
- **Current solution**: I(t) = [expression]
- **Energy stored**: U_L = [value at specified time]
- **Energy dissipated**: [total or rate]
- **Steady-state impedance** (if AC): Z_L = [value]
Expected: A complete time-domain solution for the current with correct exponential time constants, energy balance verified, and physically reasonable magnitudes.
On failure: If the current grows without bound, a sign error in the ODE setup is likely (the inductance term should oppose changes in current). If the time constant is unreasonably large or small, double-check the inductance calculation from Step 2 and the resistance value. Time constants for typical laboratory RL circuits range from microseconds to seconds.
analyze-magnetic-field -- compute the B-field from current distributions that serve as the flux sourceformulate-maxwell-equations -- generalize induction to the full Maxwell framework including displacement currentdesign-electromagnetic-device -- apply induction principles to motors, generators, and transformersderive-theoretical-result -- derive analytic results for inductance, EMF, or transient solutions from first principles