Solution (source code)

= Solution

An <electrical transformer> transfers alternating electrical <power> between windings through a shared changing <magnetic flux>. A core with large <magnetic permeability> confines most of the flux, so both windings link approximately the same flux $\Phi(t)$. <Faraday's law> gives induced electromotive <forces>
$$
\mathcal E_p=-N_p\frac{d\Phi}{dt},\qquad
\mathcal E_s=-N_s\frac{d\Phi}{dt}.
$$
For an ideal <electrical transformer>, negligible winding resistance and leakage flux imply the terminal-voltage magnitude ratio
$$
\boxed{\frac{V_s}{V_p}=\frac{N_s}{N_p}.}
$$
The relative phase depends on the winding sense and terminal convention. At a loaded secondary, Lenz's law makes the secondary current oppose the flux change. The primary draws an additional current which approximately cancels the secondary magnetomotive <force>: $N_pI_p\simeq N_sI_s$ in magnitude when the magnetizing current is negligible. Consequently
$$
\boxed{V_pI_p=V_sI_s,\qquad \frac{I_s}{I_p}=\frac{N_p}{N_s}}
$$
for a resistive load, using <root mean square> values. More generally the ideal device conserves instantaneous <power>, with the appropriate current signs. A load impedance $Z_L$ appears at the primary as $Z_{\rm in}=(N_p/N_s)^2Z_L$, enabling <impedance matching> and electrical isolation.

For sinusoidal flux, $\Phi=\Phi_{\max}\sin\omega t$ gives $V_{\rm rms}=\omega N\Phi_{\max}/\sqrt2$. At a given supply voltage, reducing <frequency> increases the required peak flux and can drive the core into <magnetic saturation>. Real losses include winding <Joule heating>, magnetic <hysteresis>, <eddy currents> and leakage flux; a laminated core suppresses eddy-current loops. A steady <direct current> produces no continuing secondary electromotive <force>, while its small winding resistance can allow a damaging primary current after switching transients.