A changing magnetic flux through a loop produces an electromotive force, or emf. The word “force” is historical: emf is measured in volts and represents energy transferred per unit charge around a circuit. The change can come from a changing magnetic field, a changing loop area, a rotating loop, or motion of a conductor through a field.
Induction is directional. A loop must have an oriented surface normal and a compatible positive traversal direction. Reversing both conventions changes the signs used in the calculation but not the physical prediction.
Magnetic flux through an oriented surface \(S\) is
\[\Phi_B=\int_S\mathbf B\cdot d\mathbf A\]The area vector points along the chosen normal. Only the magnetic-field component normal to the surface contributes. For a uniform field across a flat loop,
\[\Phi_B=BA\cos\theta\]The angle \(\theta\) is between the magnetic field and the surface normal, not between the field and the plane. Flux is greatest in magnitude when the field is perpendicular to the plane and zero when the field lies in the plane.
The SI unit of magnetic flux is the weber:
\[1\ \mathrm{Wb}=1\ \mathrm{T\,m^2}=1\ \mathrm{V\,s}\]Reversing the normal reverses signed flux. It does not reverse the magnetic field or change the amount of physical field passing through the surface.
For one conducting loop, Faraday's law is
\[\mathcal E=-\frac{d\Phi_B}{dt}\]For a tightly wound coil of \(N\) identical turns linking the same flux,
\[\mathcal E=-N\frac{d\Phi_B}{dt}\]More generally, use the derivative of total flux linkage rather than multiplying by \(N\) when different turns link different amounts of flux.
The negative sign is Lenz's law. The induced response has the direction that opposes the change in magnetic flux. It opposes the change, not necessarily the original field. If positive flux is increasing, the induced field points in the negative-normal direction. If positive flux is decreasing, the induced field points in the positive-normal direction in an attempt to sustain it.
Choose a surface normal. Use the right-hand rule to define positive traversal: curled fingers follow the loop when the thumb follows the normal. Compute signed flux with that normal, differentiate it, and apply the negative sign. A positive emf then points along the chosen traversal; a negative result points opposite it.
import sympy as sp
t = sp.Symbol("t", real=True)
turns, area = 100, sp.Rational(1, 100)
field = sp.Rational(1, 10) * sp.cos(2 * t)
flux = area * field
emf = -turns * sp.diff(flux, t)
print("Induced emf with positive loop normal along B:", emf)
This procedure works for either direction of field change. It avoids adding a second informal sign reversal after “using Lenz's law.”
Suppose a single flat loop of area
\(0.020\ \mathrm{m^2}\)has its normal aligned with a uniform magnetic field. If the field increases from \(0.10\ \mathrm T\) to \(0.50\ \mathrm T\) in \(0.20\ \mathrm s\), the average emf is
\[\mathcal E_{\mathrm{avg}} =-\frac{A\Delta B}{\Delta t} =-\frac{(0.020\ \mathrm{m^2})(0.40\ \mathrm T)} {0.20\ \mathrm s} =-0.040\ \mathrm V\]The magnitude is forty millivolts. The negative sign means the emf points opposite the chosen positive traversal. A ten-turn coil with identical linkage would produce ten times the emf magnitude.
A loop of area \(A\) rotating at constant angular speed \(\omega\) in a uniform field can have
\[\Phi_B(t)=BA\cos(\omega t)\]Faraday's law gives
\[\mathcal E(t)=NBA\omega\sin(\omega t)\]The emf is zero when flux is momentarily at a maximum or minimum because its rate of change is zero. The emf magnitude is greatest when flux passes through zero most rapidly. Mechanical work maintains the rotation against electromagnetic torque when power is delivered to a load; energy is converted rather than created.
Charges in a conductor moving through a magnetic field experience magnetic force. For a conductor moving with local velocity \(\mathbf u\), the motional contribution around a circuit is
\[\mathcal E =\oint\left(\mathbf u\times\mathbf B\right) \cdot d\boldsymbol\ell\]For a straight rod of length \(\ell\) moving perpendicular to both its length and a uniform magnetic field,
\[|\mathcal E|=B\ell u\]The sign follows from the direction of
\(\mathbf u\times\mathbf B\)and the chosen path orientation. Charges separate until the electric force balances the magnetic deflection in an open rod. If the rod completes a conducting circuit, a current can flow and magnetic forces oppose the externally driven motion.
For a circuit that may move or deform, the compact flux rule remains
\[\mathcal E=-\frac{d}{dt} \int_{S(t)}\mathbf B\cdot d\mathbf A\]The total derivative includes changes in the field and changes in the surface. Care is needed because a time-varying magnetic field creates a circulating electric field, while motion through a magnetic field produces magnetic force on charges in the conductor. Both can contribute to the measured emf.
A changing magnetic field produces an electric field even where there is no wire. Maxwell–Faraday's equation in integral form is
\[\oint_C\mathbf E\cdot d\boldsymbol\ell =-\frac{d}{dt}\int_S\mathbf B\cdot d\mathbf A\]Unlike an electrostatic field, this induced electric field can have a nonzero closed-loop integral. A single-valued electrostatic potential cannot describe the entire circulating field. The wire is a probe and current path; it is not what creates the induced electric field when the magnetic field itself changes.
The differential form is
\[\boldsymbol\nabla\times\mathbf E =-\frac{\partial\mathbf B}{\partial t}\]An induced emf is not automatically an induced current. Current depends on the complete circuit. For a loop with resistance and negligible self-inductance,
\[I=\frac{\mathcal E}{R}\]If self-inductance matters, the current obeys a differential equation and cannot change instantaneously. Capacitance, load behavior, source impedance, and switching also affect the response. A zero-resistance loop cannot be handled by dividing the emf by zero; it requires its inductance and material physics.
Changing flux in a bulk conductor can drive circulating eddy currents. Their magnetic effects oppose the flux change, and electrical resistance converts energy into heat. Eddy currents enable induction heating and magnetic braking but can be unwanted in transformer cores. Laminating a conductive core interrupts large current loops and reduces loss.
The opposition described by Lenz's law follows energy conservation. If induced current reinforced the change that created it without an external energy input, the field and current could grow on their own. In generators, mechanical work supplies electrical energy. In magnetic braking, mechanical kinetic energy becomes internal energy.
For sampled data, an interval-average emf can be estimated as
\[\mathcal E_{n-1/2} \approx-N\frac{\Phi_{B,n}-\Phi_{B,n-1}} {t_n-t_{n-1}}\]The estimate belongs to the interval between the samples, not automatically to either endpoint. A centered difference estimates the derivative at a different time. Record the timestamp convention before comparing results.
import numpy as np
times = np.linspace(0, 2, 201)
flux = 0.01 * 0.1 * np.cos(2 * times)
interval_emf = -100 * np.diff(flux) / np.diff(times)
interval_midpoints = (times[:-1] + times[1:]) / 2
print("First interval emf (V):", interval_emf[0])
print(
"Maximum midpoint error:",
np.max(abs(interval_emf - 0.2 * np.sin(2 * interval_midpoints))),
)
Differentiation amplifies measurement noise. Filtering can reduce noise but also changes amplitude and phase, so the filter must be documented. For a smooth prescribed flux, reduce the time step and compare with the analytic derivative at matching times.
A constant flux must give zero induced emf even if that flux is large. Reversing the loop normal and traversal together changes the sign representation consistently. Reversing the rate of flux change reverses the emf. Multiplying the number of identical linked turns multiplies the emf. Check that webers per second reduce to volts.
The ideal flux model can omit nonuniform-field integration error, finite wire thickness, self-inductance, capacitance, magnetic material hysteresis, eddy currents, skin effect, radiation, and propagation delay. Rapid or spatially large systems require a distributed electromagnetic model. Numerical differentiation adds timing, noise, and resolution errors that must be separated from physical-model error.
A 100-turn loop of area 0.01 square metres sees a uniform field of 0.1 cosine of twice time tesla. The question for this calculation is precise: how does induced emf change when we change time, while keeping the other choices fixed? The earlier sections explain the physical relationship. Here we turn one part of that relationship into a calculation that you can run, inspect, and change in Google Colab.
The loop normal and positive circulation are related by the right-hand rule. Keep that sentence beside the results. A formula can return a number outside its useful range, and a plotting library will usually draw that number without asking whether the physical assumptions still hold. The selected interval is from 0 to 3.14159 s. It gives us a specific domain to discuss instead of leaving the graph's range to a software default.
Use the notebook link above the lesson, run the setup cell, and then run the cells in order. The code below is also included there. NumPy handles the arrays of numerical values, SymPy keeps the equation symbolic, and Matplotlib draws the results. If these libraries or notebook cells are unfamiliar, start with Your first physics notebook.
In this small example, q stands for time, expressed in s. The output is
induced emf, expressed in V. The equation below uses the numerical values in those
units. Any fixed coefficients therefore carry the units needed to make the relation
consistent. A value supplied in another unit must be converted before it enters this
expression.
This is a function of one changing input. It is not a statement that the physical system has only one variable. We deliberately hold the other inputs fixed so that one cause of variation is visible. Changing several inputs at once would make it harder to tell which change produced the output difference. Write down the held-fixed choices before trying a different experiment.
At 0.785398 s, the expression gives 0.2 V. This is our reference calculation. It is a prediction of the stated example, not a new measurement. Its displayed digits help us compare implementations. They should not be read as a claim that physical inputs are known to six significant figures.
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
q = sp.Symbol("q", real=True)
expression = sp.sympify("0.2*sin(2*q)", locals={"q": q})
reference_input = 0.7853981633974483
reference_output = float(expression.subs(q, reference_input))
print("Input:", reference_input, "s")
print("Predicted induced emf:", reference_output, "V")
sp.Symbol declares a mathematical symbol. It does not assign a numerical measurement
to that symbol. subs then replaces the symbol with our chosen input, and float
converts the resulting symbolic number into a standard Python numerical value.
Keeping these steps separate lets us inspect the equation before numerical substitution.
It also prevents a later plot from becoming the only surviving record of the model.
Before drawing hundreds of points, calculate three. The lower endpoint gives 0 V. The midpoint, at 1.5708 s, gives 2.44929e-17 V. The upper endpoint gives -4.89859e-17 V. Read these together with the assumptions: they describe different choices of time within the same example, with the other inputs held fixed.
These three values are a useful first check, but they do not establish the shape between them. Two endpoints can be equal even when the curve bends or oscillates in between. Likewise, a large change between endpoints does not tell us whether the relationship is linear. We need the equation and intermediate samples to answer those questions.
evaluate = sp.lambdify(q, expression, modules="numpy")
inputs = np.array([0.0, 1.5707963267948966, 3.141592653589793])
outputs = np.asarray(evaluate(inputs), dtype=float)
outputs = np.broadcast_to(outputs, inputs.shape)
for input_value, output_value in zip(inputs, outputs):
print(f"{input_value:.6g} s -> {output_value:.6g} V")
assert np.all(np.isfinite(outputs))
lambdify turns the symbolic expression into a numerical function. We explicitly select
NumPy as its numerical backend so it can accept an array. The same expression now has
two useful forms: one for algebra and one for calculating many cases. The assertion
checks that the chosen inputs produce finite outputs. It would catch an infinity or an
undefined numerical result, but a finite value can still be physically inappropriate.
The horizontal axis shows time; the vertical axis shows induced emf. Every plotted point is a prediction of the same expression. We mark the reference case separately so that a reader can connect the earlier printed value to its place on the curve. The axis labels include units because a shape without a scale cannot tell us the size of a physical effect.
input_grid = np.linspace(0.0, 3.141592653589793, 301)
output_grid = np.asarray(evaluate(input_grid), dtype=float)
output_grid = np.broadcast_to(output_grid, input_grid.shape)
fig, ax = plt.subplots(figsize=(7, 4))
ax.plot(input_grid, output_grid, label="Stated model")
ax.scatter([reference_input], [reference_output], label="Reference case", zorder=3)
ax.set_xlabel("Time (s)")
ax.set_ylabel("Induced emf (V)")
ax.legend()
ax.grid(alpha=0.25)
fig.tight_layout()
plt.show()
Look for a sign change, a turning point, or a region where the curve becomes steep. Connect each feature to the expression rather than to the colour of the line. If the curve has a minimum or maximum, changing the input in opposite directions may have similar effects on the output near that point. If it is nearly straight over a short interval, a local linear approximation may be useful even when the complete expression is nonlinear.
Increasing the number of samples makes the line smoother and may reveal features that a coarse grid missed. It does not improve the physical inputs or enlarge the model's validity range. For quantities that can take only discrete values, use the line as a guide to the relationship and interpret only the allowed input values. A plotting function does not enforce such restrictions for you.
A derivative asks a more specific question than the whole graph: how quickly does induced emf change near the reference input? Its units are the output unit divided by the input unit. For this calculation, the derivative at 0.785398 s is 2.44929e-17 in those ratio units. Locally, the output increases as the input increases. This statement is local; the sign or size of the slope can be different elsewhere on the curve.
\[f'(q) = 0.4 \cos{\left(2 q \right)}\]For a small input change, multiply the derivative by that change to estimate the output change. Then compare that estimate with a fresh evaluation of the full expression. The distinction between these two calculations matters: the derivative gives a tangent approximation, while substitution evaluates the chosen expression at the new point.
slope_expression = sp.diff(expression, q)
slope_at_reference = float(slope_expression.subs(q, reference_input))
changed_input = 0.8011061266653973
linear_prediction = reference_output + slope_at_reference * (
changed_input - reference_input
)
full_prediction = float(evaluate(changed_input))
print("Symbolic derivative:", slope_expression)
print("Tangent prediction:", linear_prediction, "V")
print("Full expression:", full_prediction, "V")
print("Approximation difference:", full_prediction - linear_prediction, "V")
Here the changed input is 0.801106 s. The tangent estimate is 0.2 V, while the full expression gives 0.199901 V. If the two values are close, it means the chosen input change is small enough for this local approximation at this point. It does not mean the entire model is linear. If the slope is zero, a quadratic or higher-order term may supply the leading change instead.
This is also the beginning of uncertainty propagation. If the input has a small stated standard uncertainty, the magnitude of the slope times that uncertainty estimates one contribution to output uncertainty. Do not automatically use the same rule for a wide interval, a discontinuity, a turning point with zero first derivative, or several correlated uncertain inputs. Those situations need more of the model than one slope.
We can estimate the same slope from values on either side of the reference point. Subtract the lower output from the upper output and divide by twice the input step. Parentheses are essential: the entire output difference must be divided by the entire input interval. Without them, Python can execute a different mathematical expression while still producing a plausible number.
The calculation below uses three decreasing step sizes. Each estimate is compared with the symbolic derivative, so the reference is independent of the numerical difference formula. Near an endpoint, it is acceptable here to evaluate a small extension only because the displayed mathematical expression is smooth there; such a check does not assert that extrapolated values describe additional physical cases.
input_span = 3.141592653589793
for fraction in [1e-2, 1e-3, 1e-4]:
step = input_span * fraction
upper = float(evaluate(reference_input + step))
lower = float(evaluate(reference_input - step))
numerical_slope = (upper - lower) / (2 * step)
difference = numerical_slope - slope_at_reference
print(f"step={step:.6g}: slope={numerical_slope:.6g}, difference={difference:.6g}")
For a smooth function, reducing the step often reduces the approximation error at first. Very small steps can eventually make subtraction of nearly equal floating-point values less reliable. Therefore “smaller” is not an unlimited guarantee of “better.” Compare the observed behaviour over a useful range of steps instead of choosing the smallest number the computer can represent.
An absolute slope difference is useful when the expected slope is near zero. A relative difference would divide by a very small reference and could look enormous even when the absolute discrepancy is tiny. Away from zero, a relative difference can help compare quantities with very different scales. The tolerance should reflect the question and the numerical method, rather than a universal decimal threshold copied into every test.
Make one copy of the reference calculation before editing it. Choose a second value of time inside the stated interval, predict whether induced emf will rise or fall, and then evaluate the expression. Place the prediction and the result in a text cell. If they disagree, identify whether the mistake was in the sign, the unit conversion, the algebra, or the assumption about how the curve behaves.
Next choose a shorter plotting interval around the reference point. Compare the local curve with its tangent approximation. Then widen the interval again. The difference shows why a useful local estimate need not describe the whole range. Keep the axis labels and numerical scale visible when comparing the plots; automatic axis limits can make two different effects appear equally large.
Finally, return to the physical limit stated at the start: The loop normal and positive circulation are related by the right-hand rule. Describe one change to the setup that would violate that limit. State what new input, equation, or observation would be needed before trusting an answer in the changed situation. This last step connects the Python experiment to the physics instead of treating successful execution as the only criterion for a useful result.
Before saving, restart the runtime and run all cells in order. A result that depends on an earlier, now-deleted input cell is not reproducible from the saved notebook. Keep unrounded values for later calculations, round only the reported output, and label any new data as measured, assumed, or generated. The graph and printed values should remain traceable to the same expression and the same choices of inputs.
There is another way to check that the expression and its derivative describe the same relationship. Add up the small output changes predicted by the slope across the chosen input interval. In the continuous limit, this integral equals the output at the upper endpoint minus the output at the lower endpoint. The result has units of V: the input unit in the integration cancels the input unit in the denominator of the slope.
This statement is about the mathematics of this particular relationship. It does not assign a new physical meaning to an arbitrary area under a graph. For example, an area under force versus distance represents work, while an area under a different pair of quantities may represent something else or have no standard name. Always carry the axis units through the calculation before naming an integral.
slope_function = sp.lambdify(q, slope_expression, modules="numpy")
endpoint_change = float(evaluate(3.141592653589793) - evaluate(0.0))
for points in [101, 201, 401]:
grid = np.linspace(0.0, 3.141592653589793, points)
slopes = np.asarray(slope_function(grid), dtype=float)
slopes = np.broadcast_to(slopes, grid.shape)
integrated_change = np.trapezoid(slopes, grid)
print(
points,
"integrated change:",
integrated_change,
"endpoint change:",
endpoint_change,
)
The trapezoidal rule joins neighbouring slope samples with straight segments and adds their signed areas. A negative contribution remains negative; replacing every slope by its magnitude would calculate a different quantity. Increasing the sample count provides a practical refinement check. If the values do not settle toward the endpoint difference, first inspect the interval, singularities, and array ordering.
Do not conclude that two agreeing calculations prove the model is physically complete. Both use the same selected relationship, so an omitted effect would be omitted from both. Their agreement is evidence that the numerical tools implement that relationship consistently. Comparing with an independent experiment or a more appropriate physical model is a separate test.
Keep this comparison in the notebook when you change the expression. It is particularly useful after adding a coefficient, changing a sign convention, or converting an input unit. A code cell that produces a smooth graph can conceal these mistakes; a second calculation of the same output change gives you another place to notice them.