This calculator simulates the magnetic force on a straight current-carrying wire placed in a uniform magnetic field. It uses the standard textbook relation
F = I · L · B · sin(θ)
and embeds that force in a simple mass–spring–damper model so you can visualize how the wire would move, how its energy changes, and how different parameters affect the motion.
Use the form above to set the current, wire length, magnetic field, angle, and mechanical parameters. The simulation panel then shows the wire deflection, while the energy bars and text summary describe what is happening over time.
All inputs are interpreted in SI units. If you are working with other unit systems, convert them to SI before entering values.
For a straight conductor of length L, carrying current I in a uniform magnetic field of magnitude B, the magnitude of the magnetic force is
where θ is the angle between the current direction and the magnetic field. The direction of the force is perpendicular to both the current and the field and can be found using the right-hand rule.
Special cases:
The calculator treats the wire as a rigid bar attached to a linear spring and damper, constrained to move in one vertical direction. The magnetic force acts as a constant driving force. The vertical displacement of the wire is denoted by y(t). The equation of motion is
Rearranging into the standard damped harmonic oscillator form gives
The right-hand side is a constant drive term, because the magnetic force does not depend on y in this simplified model.
The simulation also tracks mechanical energy components:
Energy bars and numerical labels help you see how energy is exchanged between kinetic and potential forms and dissipated by damping.
After you enter inputs and start the simulation, the output area typically shows:
If your inputs are inconsistent (for example, missing values, negative mass, or non-numeric entries), the summary will indicate that the inputs are invalid and the simulation will not run. Adjust the form values and try again.
Consider a wire with the following parameters:
First compute the magnetic force:
sin(90°) = 1, so
F = I · L · B · sin(θ) = 10 × 0.20 × 0.50 × 1 = 1.0 N
This 1.0 N upward force acts against the spring and damping. Initially, if the wire starts from rest at y = 0, the acceleration at t = 0 is
a(0) = F / m = 1.0 / 0.050 = 20 m/s²
As the wire moves upward, the spring force k y grows and the motion slows, overshoots, and oscillates until the forces balance at a static deflection where
k yeq ≈ F, so yeq ≈ F / k = 1.0 / 5.0 = 0.20 m
Damping causes these oscillations to decay so the wire settles near the equilibrium displacement.
| Parameter change | Effect on magnetic force F | Effect on motion |
|---|---|---|
| θ = 0° (field parallel to current) | F = 0 | No magnetic-driven motion; spring and damping only affect initial conditions. |
| θ = 90° (field perpendicular to current) | F = I · L · B (maximum) | Largest deflection and strongest oscillations for given I, L, B. |
| Increase I, L, or B | F increases in direct proportion | Larger driving force, greater equilibrium displacement and higher energies. |
| Increase k (stiffer spring) | No change to F itself | Smaller equilibrium deflection and higher natural frequency. |
| Increase c (more damping) | No change to F itself | Oscillations die out more quickly; motion may become overdamped. |
Because of these simplifications, the tool is best understood as an educational visualization of F = I · L · B · sin(θ) and basic oscillations, not as a detailed design tool for precision electromagnetic machinery.
To explore the behavior of the system:
This approach helps you build intuition about magnetic forces on conductors and the dynamics of simple mechanical systems.
Wire deflection under magnetic force; kinetic energy red, spring energy blue.
Simulation not started.