Naqeeb Rehman

Naqeeb Rehman

Magnetic Field Simulator

October 2020

Android app for simulating the magnetic field generated around a current carrying wire

Magnetic Field Simulator

Development

The app was created in the Unity Engine in C# over the course of a month.

How it works

The Biot-Savart law is used to calculate the magnetic field around a wire of arbitrary shape.


B(r)=μ04πCIdl×rr3\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi} \int_C{\frac{I\,\mathbf{dl} \times \mathbf{r}′}{|\mathbf{r}′|^3}}

However, rather than solving for the exact solution to the integral, we can get an approximate solution by calculating numerically. The app does this by breaking up the wire into very small pieces and calculating their contribution to the magnetic field at some point.

Future Plans

After over 2 years of learning, I finally understand the propagation of electromagnetic waves and am able to simulate their generation around a wire. So, I am planning on creating a desktop version that will simulate both the electric and magnetic fields around a time varying current. Work is already started using the Unity Engine, and I plan on using compute shaders to greatly increase calculation speed by using the GPU.