# Numerical modeling of induced voltage

I have an arbitrary magnetic field that varies with time, and I’m trying to numerically model the induced current in a resistive loop over time. Details below.

I’m building an electromagnetic accelerator for fun & learning: it’s a coil that I’ll fire high current through, to induce an eddy current on a projectile. It’s basically a 500:1 transformer, except I’m not sure how strong the coupling is.

I’m numerically modeling it in Python before I build it. I’m trying to minimize chalkboard-style assumptions; e.g. I’m using the Biot-Savart law to integrate the magnetic field from each differential element of the coil.

My problem is: I’m not sure how to figure out eddy current in the projectile at a given timestep. I can get the induced voltage given a change in magnetic flux, but I’m not quite sure how to handle the feedback effect from the induced eddy current. I.e. how do I handle the fact that the rising eddy current reduces the rate of rise of magnetic flux that produced the eddy current? It feels like I need to solve an equation at each timestep to get the "equilibrium" eddy current, but it’s been a while since my EE classes.

And again, I’m not looking to model it with simple equations for transformers; I actually want to further break down the projectile into "finite element" loops and find the induced current in each. (Because it looks like distribution of eddy current in the projectile will be important, as will its resistivity.)

Physics Asked by Luke on December 31, 2020

OK, I figured it out: Apply Faraday's induced voltage law on each of the 2 coils, using the magnetic flux due to each of the 2 coils, yielding 2*2=4 total contributions. And then solve the system of equations so the currents are consistent with the induced voltages.

I used my favorite optimizer/constraint solver, cvxpy to do it. Here's the Python code:

def solveForCurrents(i1_init, i2_init,  flux1dueto1, flux2dueto1, flux2dueto2, flux1dueto2, r1,r2,external_emf_1,external_emf_2, dt):
""" Convention:
flux2dueto1 is (coil2 number of turns) * (the surface integral of magnetic flux through coil 2, per amp through coil 1).
external_emf_1 is a voltage in series with coil 1, e.g. the instantaneous voltage on a capacitor.
r1 is the total resistance of coil 1, including equivalent series resistance (ESR) of capacitors etc.
"""
import cvxpy
flux1_init = flux1dueto1*i1_init + flux1dueto2*i2_init
flux2_init = flux2dueto1 * i1_init + flux2dueto2 * i2_init
i1 = cvxpy.Variable(1) #variables to be solved for in the system of equations
i2 = cvxpy.Variable(1)
flux1 = flux1dueto1 * i1 + flux1dueto2 * i2 #total flux through a coil is the sum of all sources. (The flux1dueto1 captures the effect of self-inductance)
flux2 = flux2dueto1 * i1 + flux2dueto2 * i2
induced_emf1 = -1 * (flux1 - flux1_init) / dt #Faraday's law: induced voltage = -1 * change in flux per time.
induced_emf2 = -1 * (flux2 - flux2_init) / dt
constraints = [(induced_emf1 + external_emf_1) == i1 * r1, #Ohm's law: V=IR
(induced_emf2 + external_emf_2) == i2 * r2]
prob = cvxpy.Problem(cvxpy.Minimize(1), constraints=constraints) #nothing to minimize; just solving for the constraints
prob.solve()
return i1.value[0], i2.value[0]

#example usage. Would run this in a loop supplying i1 and i2 as the next timestep's i1_init and i2_init
i1, i2 = solveForCurrents(i1_init=0, i2_init=0,  flux1dueto1=0.1, flux2dueto1=0.01, flux2dueto2=0.01, flux1dueto2=0.001, r1=1,r2=10,external_emf_1=1000,external_emf_2=0, dt=0.001)


In my case, to get the flux2dueto1 for a given coil geometry, I used the Biot-Savart law with a 1 amp current through coil 1, to find the magnetic field at a point on the face of coil 2. I repeated for a 20x20 grid across the face of coil 2, numerically integrating the results to get the integral of flux through the coil. (That surface-integral code isn't shown above; my implementation was pretty specific to my geometry.)

I can cache and reuse that same value of "flux per amp" to get the flux due to any value of current (as long as the geometry stays the same. If geometry changes then flux2dueto1 needs to be recalculated).

Answered by Luke on December 31, 2020

## Related Questions

### How to calculate the brightness of an object in space dependent on its distance from earth?

2  Asked on July 13, 2021 by user784696

### Lagrangian density for a complex scalar field

0  Asked on July 13, 2021

### Why is a symmetric traceless tensor zero when averaged over all directions?

4  Asked on July 13, 2021 by kvantekaffe

### Why can it be important to engineer band alignments/offsets (e.g. CdS buffer layer in CIGS)?

1  Asked on July 13, 2021

### Equation of motion – choosing directions for the coordinate axis

3  Asked on July 13, 2021 by jyotishraj-thoudam

### Why for the closed string we need to take both left and right moving modes into account when deriving the mass?

1  Asked on July 13, 2021

### Force caused by pressure

1  Asked on July 13, 2021

### Questions on parity transformation

1  Asked on July 13, 2021 by user279310

### In quantum field theory with a mass gap, why do states in the asymptotic future/past turn out to have a Fock space structure?

1  Asked on July 13, 2021 by lawrence-christos

### Noether’s theorems and General covariance

1  Asked on July 13, 2021

### Photon description of quantum-optical interference experiments

6  Asked on July 13, 2021

### I need a kilogram of neutrinos. What are the challenges?

2  Asked on July 13, 2021

### What do we observe with gravity in a superposition?

1  Asked on July 13, 2021

### Time Dilation as an explaination for the expansion of the univers acceleration

0  Asked on July 13, 2021 by agone07

### Constant term in action term in general relativity?

1  Asked on July 13, 2021

### Is the world $C^infty$?

5  Asked on July 13, 2021 by tobias-kienzler

### Does the SUVAT equations of motion (Kinematics) come from some differential equation?

2  Asked on July 13, 2021

### Entropy in a system constitute by an atom and a photon

0  Asked on July 13, 2021

### R-symmetry constants in $mathcal{N}=4$ SYM in Yukawa terms

1  Asked on July 13, 2021