Magnetic Field Of A Cylindrical Current Sheet
Calculates and displays the exact magnetic field of an ideal cylindrical current sheet making use of MATLAB
elliptic integral functions.
Author: D. Carlsmith
Table of Contents
Introduction...............................................................................................................................................................1
Set physical parameter values..................................................................................................................................1
Try this: Change the length and radius to observe the effect of aspect ratio........................................................1
Calculate ideal field of an infinitely long cylinder as a reference field strength.........................................................2
Create symbolic expressions for the radial and axial field components................................................................... 2
Substitute values for parameters and convert these formulae to MATLAB functions of coordinates. ..................... 2
Calculate magnetic field components over a grid in r and z .................................................................................... 2
Try this: Change the number of radial and axial grid points................................................................................. 3
Plot the radial and azimuth field components along a central radial line and along a line almost on the symmetry
axis........................................................................................................................................................................... 3
Try this: To profile the field along a different radial line, change the value of zline.............................................. 3
Try this: To profile the field along a line parallel to the axis at a different radius, pick a different target radial
value..................................................................................................................................................................... 4
Compare the axial line field to the exact axial field of an ideal coil...........................................................................5
Visualize magnetic field lines. ..................................................................................................................................6
Try this: Change the density of field lines ............................................................................................................ 6
References............................................................................................................................................................... 7
Introduction
The magnetic field of a cylindrical sheet of current provides a representation of the external field of a cylinder
uniformly magnetized along its symmetry axis and an approximation to a helically wound solenoid and is
expressible in terms of elliptical integral functions.[1] This script calculates and displays this magnetic field.
clear all, close all;
set(groot,'defaultLineLineWidth',1)
set(groot,'defaultAxesLineWidth',1)
set(groot,'defaultAxesFontWeight','bold')
syms mu0 I L R M z rho
Set physical parameter values
totalevaluationtime=tic;
mu0val=4*pi*1e-7; % permeability of the vacuum set to unity
Ival=1; % total current in the cymindrical sheet
Try this: Change the length and radius to observe the effect of aspect ratio.
Lval=5; % total length of the cylinder
Rval=1; % radius of the cylinder
M=Ival/Lval; % equivalent magnetization
1