{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "VectorPlot.ipynb", "provenance": [], "collapsed_sections": [] }, "language_info": { "name": "python" }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "source": [ "#Making Vector Field Plots with Python" ], "metadata": { "id": "q43p7oDmcomA" } }, { "cell_type": "markdown", "source": [ "Making a 2-D vector field (or “quiver”) plot is somewhat similar to making a contour plot because the vectors must be calculated on a grid. This type of plot is most useful when the vectors do not have a third component. \n", "The first step is to find the Cartesian components of the field to be plotted. The example program will plot the magnetic field of a long wire along z axis carrying a current of I = 50 A in the +z direction. In cylindrical coordinates, the magnetic field is \n", "\n", "$$ \\vec{B} = \\frac{\\mu_0 I}{2\\pi s}\\hat{\\theta}, $$ \n", "where s is the distance from the wire and $\\mu_0 I/2\\pi = 1 \\rm{\\ mT\\cdot cm}$. If distances are in centimeters, the magnetic field is in mT." ], "metadata": { "id": "WHVsOQ8ucomB" } }, { "cell_type": "markdown", "source": [ "