.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/electrical_engineering/ac_circuits/plot_01_stanley_transformer.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_electrical_engineering_ac_circuits_plot_01_stanley_transformer.py: Stanley's transformer (1886) ============================ In March 1886 William Stanley, working for George Westinghouse, lit the shops of Great Barrington, Massachusetts, from a 500 V alternator through transformers that stepped the voltage down to 100 V at each building. His design, refined from the Gaulard-Gibbs secondary generator and the Hungarian ZBD transformer of 1885, had a closed iron core and windings in parallel across the line. An ideal transformer scales voltage by the turns ratio, :math:`V_2 = V_1 N_2/N_1` (:func:`~engineeringkit.electrical_engineering.transformer_secondary`), current by its inverse and impedance by its square. This example shows why that made AC distribution win: stepping up the voltage cuts line losses by the square of the ratio. .. GENERATED FROM PYTHON SOURCE LINES 19-24 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.electrical_engineering import transformer_secondary .. GENERATED FROM PYTHON SOURCE LINES 25-27 Voltage, current and impedance ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 27-38 .. code-block:: Python N1, N2 = 500, 100 V1 = 500.0 V2 = transformer_secondary(V1, N1, N2) R_load = 10.0 I2 = V2 / R_load I1 = I2 * N2 / N1 print(f"V2 = {V2:.0f} V, I2 = {I2:.1f} A, I1 = {I1:.1f} A") assert np.isclose(V1 * I1, V2 * I2) # an ideal transformer is lossless assert np.isclose(V1 / I1, R_load * (N1 / N2) ** 2) # load reflected by the turns ratio squared .. rst-class:: sphx-glr-script-out .. code-block:: none V2 = 100 V, I2 = 10.0 A, I1 = 2.0 A .. GENERATED FROM PYTHON SOURCE LINES 39-44 Why step up? ------------ Deliver 100 kW over a line of 2 ohm total resistance, stepping a 1 kV generator up to different voltages. .. GENERATED FROM PYTHON SOURCE LINES 44-58 .. code-block:: Python P, R_line, V_gen = 100e3, 2.0, 1e3 ratios = np.array([1, 2, 5, 10, 20, 50]) V_line = transformer_secondary(V_gen, 1, ratios) loss = (P / V_line) ** 2 * R_line for r, vl, lo in zip(ratios, V_line, loss): print(f"1:{r:<3d} {vl / 1e3:5.0f} kV line, loss {lo / P:7.3%} of the power") assert np.allclose(loss[0] / loss, ratios**2) fig, ax = plt.subplots() ax.loglog(V_line / 1e3, loss / P * 100, "o-") ax.set(xlabel="transmission voltage [kV]", ylabel="line loss [% of delivered power]", title="Loss falls as 1/V²") plt.show() .. image-sg:: /api/gallery/electrical_engineering/ac_circuits/images/sphx_glr_plot_01_stanley_transformer_001.png :alt: Loss falls as 1/V² :srcset: /api/gallery/electrical_engineering/ac_circuits/images/sphx_glr_plot_01_stanley_transformer_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 1:1 1 kV line, loss 20.000% of the power 1:2 2 kV line, loss 5.000% of the power 1:5 5 kV line, loss 0.800% of the power 1:10 10 kV line, loss 0.200% of the power 1:20 20 kV line, loss 0.050% of the power 1:50 50 kV line, loss 0.008% of the power .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.034 seconds) .. _sphx_glr_download_api_gallery_electrical_engineering_ac_circuits_plot_01_stanley_transformer.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../../lite/lab/index.html?path=api/gallery/electrical_engineering/ac_circuits/plot_01_stanley_transformer.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_stanley_transformer.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_stanley_transformer.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_stanley_transformer.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_