Magnetic field representation in Octave

1 reply · 3K views · last reply
Miss_Fire
Messages
4
Reaction score
0

Homework Statement


I need to represent in Octave (using the quiver function) the magnetic field lines around a long wire which carries an electric current around the wire. The magnetic field of an infinitely long straight wire can be obtained by applying Ampere's law.

Homework Equations


The expression for the magnetic field is:
Equation B = μ₀I / (2πr), giving the magnetic field magnitude of a long straight current-carrying wire at distance r.


The Attempt at a Solution


I wrote a program in Octave and I obtained the folowing figure using the formula:
Quiver plot of a vector field on a grid: arrows point left in the central columns and right beside them, with short arrows of varying direction at the outer edges.


I'm almost sure that these couldn't be magnetic field lines, because I read somewhere that they must be circular. Any help would be much appreciated[/B]