Princeton Fusion Systems MATLAB Toolboxes
MATLAB toolboxes for fusion energy analysis
Coil Functions

Coils module functions. View the published Coils Demos. More...

Directories

directory Forces
 Self and between-coil forces.
 
directory Inductances
 Conservation of flux between coaxial coils.
 
directory Magnetic
 Additional magnet functins.
 
directory Mass
 Coil mass estimates.
 
directory Pancake
 Pancake-wound magnet models.
 
directory SingleLoop
 Single loop current models.
 
directory Solenoid
 Discrete solenoid model.
 
directory Wire
 HTS and LTS wire models.
 

Functions

function CoilSelfForce (in radius, in i, in n)
 Calculate the self force for a circular coil with a given current. More...
 
function CoilStresses (in a, in b, in bA, in bB, in j, in nu, in r)
 Stresses in a finite thickness coil, circumferential and radial. More...
 
function CoilStressFiniteSolenoid (in a, in b, in Ba, in Bb, in J, in doPlot)
 Stresses in an finite solenoid from current density. More...
 
function CoilStressSolenoid (in a, in b, in doPlot)
 Stresses in an infinite solenoid. More...
 
function SolenoidForces (in a, in h, in i, in n)
 Total force between coaxial current loops. More...
 
function CoAxBField (in rS, in zS, in rC, in zC, in IC, in dr, in dz)
 Calculate the magnetic field of concentric, axially-aligned coils. More...
 
function CoAxConserveFluxes (in CoilsRegular, in CoilsConserving)
 Determine currents in conserving coils necessary to conserve flux. More...
 
function CoAxEllipseRR (in rEllipse, in elongation, in ITot, in dr, in dz)
 Filaments of a coil composed of elliptical Rigid-Rotor current profile. More...
 
function CoAxFluxField (in rS, in zS, in rC, in zC, in IC, in boolSum, in selfSenseOffset, in boolSameDomain)
 Calculate the magnetic flux of concentric, axially-aligned coils. More...
 
function CoAxFluxRadius (in z, in phi, in rC, in zC, in IC, in rGuess)
 Calculate the radius of a flux surface at position z. More...
 
function CoAxMutualInductance (in rC1, in zC1, in rC2, in zC2, in rFilament1)
 Determine the mutual inductance of coil 2 on coil 1. More...
 
function CoAxPlotBZ (in rG, in zG, in rC, in zC, in IC, in Bmax, in doBR)
 Plot magnitude of Bz (|Bz|) or Br contours. More...
 
function CoAxPlotFlux (in rS, in zS, in rC, in zC, in IC, in boolCoils, in hAx)
 Plot flux contours at sense points given coil positions and currents. More...
 
function CoAxRectangle (in rTurns, in zTurns, in rInner, in zCenter, in rPacking)
 Produce filament parameters of a coil with a rectangular cross section. More...
 
function CoAxSelfInductance (in rC, in zC, in rFilament)
 Determine the self inductance of a coil. More...
 
function CoAxStruct ()
 Coil data structure. More...
 
function CoAxTestParticle (in r0, in z0, in E0, in m, in Z, in pitch0, in gyro0, in tDur, in rC, in zC, in IC)
 Calculate trajectory of a test particle in a magnetic field. More...
 
function CoAxFluxInChunks (in rS, in zS, in rC, in zC, in IC, in selfSenseOffset, in N)
 Calculate the flux in chunks of size N. More...
 
function CoAxL2 (in zCenter)
 Produce filament parameters of a single L-2 coil. More...
 
function CoAxL2Pack (in zCenter, in N)
 Produce filament parameters of an L-2 coil pack. More...
 
function ConstBFlux (in r, in B)
 Enclosed flux assuming constant B. More...
 
function CoilTurns (in Ri, in I0, in Iwire, in diameter, in density)
 Determine the number of turns and mass for a coil of round wire. More...
 
function MagnetArrayMass (in a0, in I0, in Iop, in N0, in d)
 Calculate the size and mass of pancake magnets from radius and current. More...
 
function MagnetDataStructure ()
 Magnet data structure for current and mass model. More...
 
function SolenoidStructuralMass (in a, in b, in w, in z, in bA, in bB, in j, in nu, in sigma, in rho)
 Structural mass for a discrete solenoid. More...
 
function Bpancake (in Iop, in Ri, in Ro, in N, in H, in invert)
 Magnetic field of a pancake coil. More...
 
function PancakeMagnetMass (in B0, in Ri, in N, in Iop, in d)
 Size a pancake magnet to produce a desired B given the wire properties. More...
 
function PancakeMagnetTurns (in I0, in Ri, in N, in Iop, in d)
 Compute the turns for a pancake magnet given the total current. More...
 
function REffPancake (in Ri, in Ro)
 Effective radius of a thin pancake coil. More...
 
function ConcentricCoils (in d, in bAve, in a, in pTitle)
 Field for coaxial coils (poorly named) More...
 
function ConcentricCoilsFiniteWidth (in d, in bAve, in a, in w, in pTitle)
 Field for concentric coils with a finite width. More...
 
function CurrentForField (in a, in B)
 Current to produce a desired field at the center of a wire loop. More...
 
function FieldCurrentLoop (in a, in i, in z)
 Field along the central axis of a single current loop. More...
 
function ForceBetweenCurrentLoops (in a, in h, in i, in n)
 Total force between concentric current loops. More...
 
function EllipsoidalSolenoid (in rMin, in rMax, in z)
 Calculate the radii for an ellipsoidal solenoid. More...
 
function FLinearCurrent (in z0, in Imin)
 Linear current shape for PFRC magnets. More...
 
function FSteppedCurrent (in z0, in Iend)
 Stepped current shape for PFRC magnets. More...
 
function ScanMagnetArray (in a0, in I0, in z0, in doPlot)
 Compute axial field scan of a symmetric magnet array. More...
 
function SolveSolenoid (in a0, in z0, in B0, in fScale)
 Solve for the maximum current that produces the target peak field. More...
 
function NbTiHysteresis (in BDot, in Jc, in d, in Jt)
 Determine the heating due to hysteresis in an AC NbTi coil. More...
 
function NbTiModel (in T, in B, in Jop)
 Compute the critical current and temperature for NbTi wire. More...
 
function NbTiPenetrationField (in Jc, in d)
 Determine the penetration field of an AC NbTi coil. More...
 
function SuperconductorDataStructure (in type)
 Superconducting wire data structure, HTS or LTS. More...
 
function SuperPowerHTS (in B, in T)
 Properties of SuperPower HTS 12 mm tape. More...
 

Detailed Description

Coils module functions. View the published Coils Demos.

Function Documentation

◆ Bpancake()

function Bpancake ( in  Iop,
in  Ri,
in  Ro,
in  N,
in  H,
in  invert 
)

Magnetic field of a pancake coil.

Magnets coils can be parameterized by the inner radius, outer radius, and thickness. This is expressed by alpha, the ratio of the outer to inner radii; and beta, the ratio of the thickness to the inner diameter.

alpha = Ro/Ri
beta  = H/(2*Ri)

In the limit of an infinitely thin coil, the model reduces to

Reff = Ri*(alpha-1)/log(alpha)

This function can also do the inverse calculation, and return a current for a desired field B.


Form

B = Bpancake(Iop,Ri,Ro,N,H)
I = Bpancake(B,Ri,Ro,N,H,invert=true)


Inputs

Iop    (1,1)   Operating current (A)
Ri     (1,1)   Inner radius (m)
Ro     (1,1)   Outer radius (m)
N      (1,1)   Number of turns
H      (1,1)   Coil height (m)
invert  (1)    Boolean

Outputs

B      (1,1)   Central field
alpha  (1,1)
beta   (1,1)

See also REffPancake


References and().

◆ CoAxBField()

function CoAxBField ( in  rS,
in  zS,
in  rC,
in  zC,
in  IC,
in  dr,
in  dz 
)

Calculate the magnetic field of concentric, axially-aligned coils.

Computes the magnetic flux enclosed on two sides of each sense point and divides by the differential length to compute field strength.

Type CoAxBField for a demo.


Form

[Br, Bz, Btot] = CoAxBField(rS,zS,rC,zC,IC,dr,dz)


Inputs

rS                    List of r-value sense points in meters (m)
zS                    List of z-value sense points in meters (m)
rC                    List of r-values of coils in meters (m)
zC                    List of z-values of coils in meters (m)
IC                    List of currents of coils in Amperes (A)
dr                    (Optional) Differential length in r direction.
Default: 1mm
dz                    (Optional) Differential length in z direction.
Default: 1mm

Outputs

Br                    Magnetic field values in the r-direction array
Bz                    Magnetic field values in the z-direction array
Btot                  (Optional) Magnetic field amplitudes array

See also: CoAxFluxField


References and(), isempty(), and List().

◆ CoAxConserveFluxes()

function CoAxConserveFluxes ( in  CoilsRegular,
in  CoilsConserving 
)

Determine currents in conserving coils necessary to conserve flux.

It is assumed that CoilsConserving reach a steady state, then CoilsRegular are energized. They drive image currents in CoilsConserving in such a way as to conserve the flux enclosed by CoilsConserving.

Type CoAxConserveFluxes for a demo.


Form

ISC = CoAxConserveFluxes(CoilsRegular,CoilsConserving)


Inputs

CoilsRegular     [:,4] Array of regular (non-flux-conserving)
failments. These coils drive flux in the
conserving coils, to which they react. Format of
each cell row is [r,z,w,I] where r is the
filament radius, z the filament axial postion, w
is the filament conductor radius, and I is the
filament current. Units are meters and Amperes.
CoilsConserving  {:,1} Cell array of cell arrays of flux conserving
coils. These coils have image currents induced
in them until the flux enclosed is at its
initial value. Format of each cell is {1x4
cell}, containing a row of cells. The format for
this row is {r,z,w,I} where r is a number array
of radii, z is a number array of axial postions,
w is one scalar conductor radius, and I is one
scalar current, the initial current through the
conserving loop before CoilsRegular are
energized. Units are meters and Amperes.

Outputs

ISC              (:,1) Currents in amperes necessary for the coils
specified in CoilsConserving to maintain their
initial level of flux given the magnetic fields
induced by CoilsRegular

References and().

◆ CoAxEllipseRR()

function CoAxEllipseRR ( in  rEllipse,
in  elongation,
in  ITot,
in  dr,
in  dz 
)

Filaments of a coil composed of elliptical Rigid-Rotor current profile.

Dimensions in meters, currents in Amperes

Type CoAxEllipseRR for a demo.


Form

[rC,zC,IC,d] = CoAxEllipseRR( rEllipse, elongation, ITot, dr, dz)


Inputs

rEllipse       (1,1) Maximum radius of the ellipse in meters
elongation     (1,1) Ratio of axial half-length to radius
ITot           (1,1) Total current in Amperes
dr             (1,1) Discretization increment radially (m)
dz             (1,1) Discretization increment axially (m)

Outputs

rC             (:,1) List of the r-values of each filament of the coil.
zC             (:,1) List of the z-values of each filament of the coil.
IC             (:,1) List of the current values of each filament of the
coil. Proportional to r, as in a rigid rotor.
d              (.)   Coil data structure

◆ CoAxFluxField()

function CoAxFluxField ( in  rS,
in  zS,
in  rC,
in  zC,
in  IC,
in  boolSum,
in  selfSenseOffset,
in  boolSameDomain 
)

Calculate the magnetic flux of concentric, axially-aligned coils.

A coil is a list of filaments with r-positions, z-positions, radii, and currents.

Type CoAxFluxField for a demo.


Form

phi = CoAxFluxField(rS,zS,rC,zC,IC,boolSum,selfSenseOffset,boolSameDomain)


Inputs

rS      (:,:) Vector or array of r-value sense points in meters (m)
zS      (:,:) Vector or array of z-value sense points in meters (m)
rC      (:,:) Vector or array of r-values of coils in meters (m)
zC      (:,:) Vector or array of z-values of coils in meters (m)
IC      (:,:) Vector or array of of currents of coils in Amperes (A)
boolSum (1,1) Logical. If true, returned flux is the total summed flux.
If false, the returned flux stays coil-wise and has a
different dimensionality.
selfSenseOffset
(1,1) If the sense point is the same as a filament point, flux
of infinity results. If this is nonzero, at sense points
that lie on top of a filament, instead the sense point is
moved radially inwards by this amount (m)
boolSameDomain
(1,1) Logical. If true, the sense and coil positions aren't
unpacked into orthogonal domains. Default: false

Outputs

phi     (:,:) Vector or array of magnetic fluxes enclosed by the vector
or array of loops of radius rS, axial position zS. Units
of Tesla-m^2. If boolSum is true, the dimensions of phi
are the same as the dimensions of the sense points. If
false, phi is a 2D array where size in dimension 1 is the
number of elements in the sense point array and size in
dimension 2 is the number of elements in the coil array.

References: http://www.kurtnalty.com/A_to_B.pdf


References and().

◆ CoAxFluxInChunks()

function CoAxFluxInChunks ( in  rS,
in  zS,
in  rC,
in  zC,
in  IC,
in  selfSenseOffset,
in  N 
)

Calculate the flux in chunks of size N.

In case there are many coils over which to integrate, this function computes the flux only in calculations of size N, where a calculation is the flux from one point on another.

This function is necessary because if CoAxFluxField is run with 1 billion calculations, the computer will crash. However if CoAxFluxInChunks is run in chunks of 30,000, 1 billion flux calculations takes 80 seconds.


Form

CoAxFluxInChunks   % demo
phi = CoAxFluxInChunks(rS,zS,rC,zC,IC)


Inputs

rS      (:,:) Vector or array of r-value sense points in meters (m)
zS      (:,:) Vector or array of z-value sense points in meters (m)
rC      (:,:) Vector or array of r-values of coils in meters (m)
zC      (:,:) Vector or array of z-values of coils in meters (m)
IC      (:,:) Vector or array of of currents of coils in Amperes (A)
selfSenseOffset
(1,1) If the sense point is the same as a filament point, flux
of infinity results. If this is nonzero, at sense points
that lie on top of a filament, instead the sense point is
moved radially inwards by this amount (m)
N       (1,1) Size of calculation chunks

Outputs

phi     (:,:) Vector or array of magnetic fluxes enclosed by the vector
or array of loops of radius rC, axial position zC. Units
of Tesla-m^2. 

◆ CoAxFluxRadius()

function CoAxFluxRadius ( in  z,
in  phi,
in  rC,
in  zC,
in  IC,
in  rGuess 
)

Calculate the radius of a flux surface at position z.

Together, r and z generate a flux surface.

Type CoAxFluxRadius for a demo.


Form

r = CoAxFluxRadius(z,phi,rC,zC,IC,rGuess)


Inputs

z       (1,:) Vector of z points in meters (m)
phi     (1,1) Magnetic flux of the surface in question (T-m^2)
rC      (:,:) Vector or array of r-values of coils in meters (m)
zC      (:,:) Vector or array of z-values of coils in meters (m)
IC      (:,:) Vector or array of of currents of coils in Amperes (A)
rGuess  (1,1) Initial radius guess (m)

Outputs

r       (1,:) Vector of radii, corresponding to the radius at the
given z-value of the flux surface of flux phi

References and().

◆ CoAxL2()

function CoAxL2 ( in  zCenter)

Produce filament parameters of a single L-2 coil.

Dimensions in meters. Parameters from P. Bonanos AEC Tech Memo 207. The single winding at the bottom is not a bug, but a feature of the real magnet. Type CoAxL2 for a demo.


Form

CoAxL2;   % demo
[rC,zC,d] = CoAxL2( zCenter )


Inputs

zCenter        (1,1) Central z-value of the coil in meters

Outputs

rC             (:,:) r-values of each filament of the coil. Increases
in dimension 1.
zC             (:,:) z-values of each filament of the coil. Increases
in dimension 2.
d              (.)   Coil data structure

◆ CoAxL2Pack()

function CoAxL2Pack ( in  zCenter,
in  N 
)

Produce filament parameters of an L-2 coil pack.

Dimensions in meters. Parameters from P. Bonanos AEC Tech Memo 207


Form

[rC,zC,d] = CoAxL2Pack( zCenter , N , boolTape)


Inputs

zCenter        (1,1) Central z-value of the pack in meters
N              (1,1) Number of L2 coils in the pack

Outputs

rC             (:,:) r-values of each filament of the coil. 
zC             (:,:) z-values of each filament of the coil. 
d              (.)   Coil data structure

◆ CoAxMutualInductance()

function CoAxMutualInductance ( in  rC1,
in  zC1,
in  rC2,
in  zC2,
in  rFilament1 
)

Determine the mutual inductance of coil 2 on coil 1.

Dimensions in meters, Henries

Type CoAxMutualInductance for a demo.


Form

M = CoAxMutualInductance( rC1,zC1,rC2,zC2,rFilament1 )


Inputs

rC1            (:,:) Vector or array of coil 1 filament radii (m)
zC1            (:,:) Vector or array of coil 1 filament z-positions (m)
rC2            (:,:) Vector or array of coil 2 filament radii (m)
zC2            (:,:) Vector or array of coil 2 filament z-positions (m)
rFilament1     (1,1) Radius of coil 1 filament conductor (m)

Outputs

M              (1,1) Mutual inductance of coil 2 on coil 1 (H)

Copyright (c) 2020 Princeton Satellite Systems, Inc. All rights reserved.


Since version 2020.1


◆ CoAxPlotBZ()

function CoAxPlotBZ ( in  rG,
in  zG,
in  rC,
in  zC,
in  IC,
in  Bmax,
in  doBR 
)

Plot magnitude of Bz (|Bz|) or Br contours.

Computes the magnetic flux enclosed on two sides of each sense point and divides by the delta area to compute field strength. If desired, enter a maximum B for drawing the contours.

Type CoAxPlotBZ for a demo.


Form

figHandle = CoAxPlotBZ(rG,zG,aC,zC,IC,Bmax,doBR)


Inputs

rG                    List of r-value grid points in meters (m)
zG                    List of z-value grid points in meters (m)
rC                    List of r-values of coils in meters (m)
zC                    List of z-values of coils in meters (m)
IC                    List of currents of coils in Amperes (A)
Bmax       (1,1)      Optional, max B contour

Outputs

figHandle             Handle of the figure so produced
Bz                    Magnetic field values in the z-direction array
-- or --
Br                    Magnetic field values in the r-direction array

See also: CoAxBField


References Plot().

◆ CoAxPlotFlux()

function CoAxPlotFlux ( in  rS,
in  zS,
in  rC,
in  zC,
in  IC,
in  boolCoils,
in  hAx 
)

Plot flux contours at sense points given coil positions and currents.

The sense points are the points at which the flux is computed, which should be a grid using repmat or meshgrid for computing good contours. If empty, a grid will be computed. The contours are spaced using the square root of the flux.

Type CoAxPlotFlux for a demo.


Form

figHandle = CoAxPlotFlux(rS,zS,aC,zC,IC,boolCoils,hAx)


Inputs

rS                    List of r-value sense points in meters (m)
zS                    List of z-value sense points in meters (m)
rC                    List of r-values of coils in meters (m)
zC                    List of z-values of coils in meters (m)
IC                    List of currents of coils in Amperes (A)
boolCoils             Logical: Plot the positions of the coils or not.
hAx                   Axis handle to plot into, optional

Outputs

figHandle             Handle of the figure

References and(), isempty(), List(), and Plot().

◆ CoAxRectangle()

function CoAxRectangle ( in  rTurns,
in  zTurns,
in  rInner,
in  zCenter,
in  rPacking 
)

Produce filament parameters of a coil with a rectangular cross section.

Dimensions in meters

Type CoAxRectangle for a demo.


Form

[rC,zC,d] = CoAxRectangle( rTurns, zTurns, rInner, zCenter, rPacking)


Inputs

rTurns         (1,1) Number of turns in the r direction of the coil
zTurns         (1,1) Number of turns in the z direction of the coil.
The total number of turns in coil 1 is rTurns x
zTurns.
rInner         (1,1) Inner radius of the coil in meters
zCenter        (1,1) Central z-value of the coil in meters
rPacking       (1,1) Minimum packing radius (center spacing / 2) of
different windings

Outputs

rC             (:,:) r-values of each filament of the coil. Increases
in dimension 1.
zC             (:,:) z-values of each filament of the coil. Increases
in dimension 2.
d              (.)   Coil data structure

Copyright (c) 2020 Princeton Satellite Systems, Inc. All rights reserved.


Since version 2020.1


◆ CoAxSelfInductance()

function CoAxSelfInductance ( in  rC,
in  zC,
in  rFilament 
)

Determine the self inductance of a coil.

Dimensions in meters, Henries

Type CoAxSelfInductance for a demo.


Form

L = CoAxSelfInductance( rC,zC,rFilament )


Inputs

rC             (:,:) Vector or array of filament radii (m)
zC             (:,:) Vector or array of filament z-positions (m)
rFilament      (1,1) Radius of the filament conductor (m)

Outputs

L              (1,1) Self-inductance of this coil (H)

◆ CoAxStruct()

function CoAxStruct ( )

Coil data structure.

Each filament is a loop assumed to be centered on the z axis.


Form

d = CoAxStruct


Outputs

d
.r    (:,:)          Filament radii
.z    (:,:)          Filament axial positions
.w    (1,1)          Filament (wire) radius
.I    (1,1) or (:,:) Scalar or array of currents
.name ''

◆ CoAxTestParticle()

function CoAxTestParticle ( in  r0,
in  z0,
in  E0,
in  m,
in  Z,
in  pitch0,
in  gyro0,
in  tDur,
in  rC,
in  zC,
in  IC 
)

Calculate trajectory of a test particle in a magnetic field.

The magnetic field must be created by concentric, axially-aligned coils. This function may take a while to run if you simulate many gyroperiods of time. Start with 10 gyroperiods and see how long that lasts.

Type CoAxTestParticle for a demo.


Form

[r,z,vr,vPhi,vz,t] = CoAxTestParticle(r0,z0,E0,m,Z,pitch0,gyro0,tDur,rC,zC,IC)


Inputs

r0                    Initial r value in meters (m)
z0                    Initial z value in meters (m)
E0                    Initial particle energy in eV
m                     Particle rest mass in AMU
Z                     Particle charge state. -1 for electrons
pitch0                Pitch angle in radians. 0 is field-parallel, pi/2
is field-perpendicular.
gyro0                 Gyro angle in radians. 0 is radially inward
point, or equivalently velocity in positive
azimuthal direction 
tDur                  Duration of simulation in seconds
rC                    List of r-values of coils in meters (m)
zC                    List of z-values of coils in meters (m)
IC                    List of currents of coils in Amperes (A)

Outputs

r                     Time history vector of radial positions in m
z                     Time history vector of axial positions in m
vr                    Time history vector of radial velocity, m/s
vPhi                  Time history vector of azimuthal velocity, m/s
vz                    Time history vector of axial velocity, m/s
t                     Time values for each history vector element in s

See also: CoAxFluxField


References and(), List(), Set(), and vector().

◆ CoilSelfForce()

function CoilSelfForce ( in  radius,
in  i,
in  n 
)

Calculate the self force for a circular coil with a given current.

The integral is discretized into the given number of increments. This demonstrates that the force is constant around the circumference of the coil.


Form

[fR,f] = CoilSelfForce( radius, i, n )


Inputs

radius  (1,1)  Radius (m)
i       (1,1)  Current (A)
n       (1,1)  Increments  (default: 100)

Outputs

fR      (1,:) Radial force (N)
f       (2,:) Force in x,y

◆ CoilStresses()

function CoilStresses ( in  a,
in  b,
in  bA,
in  bB,
in  j,
in  nu,
in  r 
)

Stresses in a finite thickness coil, circumferential and radial.

Computes radial and circumferential stresses in a finite thickness coil carrying a current. It computes circumferential, radial and circumferential stresses for an infinite solenoid in which bB = 0. This function assumes that the radial stresses on the boundaries are zero.

Type CoilStresses for a demo. p in the plots is the magnetic pressure.


Form

[sigmaTheta, sigmaR, sigmaThetaP] = CoilStresses( a, b, bA, bB, j, nu, r )


Input

a           (1,1) Inner radius (m)
b           (1,1) Outer radius (m)
bA          (1,1) Inner field (T)
bB          (1,1) Outer field (T)
j           (1,1) Current density (A/m^2)
nu          (1,1) Poisson's ratio for the material
r           (1,:) Radii between a and b (m)

Output

sigmaTheta  (1,:) Circumferential stress (N/m^2)
sigmaR      (1,:) Radial stress (N/m^2)
sigmaThetaP (1,:) Circumferential stress infinite solenoid (N/m^2)

Reference: Wilson, M. N., "Superconducting Magnets", Oxford Science Publications, 1983, pp. 41-45


References and().

◆ CoilStressFiniteSolenoid()

function CoilStressFiniteSolenoid ( in  a,
in  b,
in  Ba,
in  Bb,
in  J,
in  doPlot 
)

Stresses in an finite solenoid from current density.

Calculates the hoop and radial stresses assuming a poisson ratio of 1/3. In the demo, the simple independent turn calculation of hoop stress for an infinite solenoid is also shown. Since in reality the turns actually press on each other, the radial stress shown develops and the hoop stress is modified.

This calculation assumes the radial boundaries of the coil are free, that is, sigmaR=0 at a and b.


Form

sigma = CoilStressFiniteSolenoid( a, b, Ba, Bb, J, doPlot )


Inputs

a     (1,1)    Inner radius
b     (1,1)    Outer radius, b>a
Ba    (1,1)    Field at inner wall
Bb    (1,1)    Field at outer wall
J     (1,1)    Current density (A/m2)
doPlot (1)     Boolean, create plot

Outputs

sigma [2,:]    [hoop;radial] stress

Reference: Superconducting Magnets, Martin Wilson, Clarendon Press, 2001


References and().

◆ CoilStressSolenoid()

function CoilStressSolenoid ( in  a,
in  b,
in  doPlot 
)

Stresses in an infinite solenoid.

Calculates the hoop and radial stresses assuming a poisson ratio of 1/3. In the demo, the simple independent turn calculation of hoop stress is also shown. Since in reality the turns actually press on each other, the radial stress shown develops and the hoop stress is modified.

In order to calculate total stress, multiply by the magnetic pressure,

P = B^2/(2*mu0)

For a demo type CoilStressSolenoid.


Form

sigma = CoilStressSolenoid( a, b, doPlot )



Inputs :

a     (1,1)    Inner radius
b     (1,1)    Outer radius, b>a
doPlot (1)     Boolean, create plot

Outputs :

sigma (2,1)    Normalized stress, [theta;r]

Reference: Martin Wilson, Superconducting Magnets, Clarendon Press, 2001


References and().

◆ CoilTurns()

function CoilTurns ( in  Ri,
in  I0,
in  Iwire,
in  diameter,
in  density 
)

Determine the number of turns and mass for a coil of round wire.

Assume the coil is packed into a square cross-section. A packing factor of 0.9069 is used for round wire. A pancake model is used to estimate the magnetic field using the effective radius of the coil.


Form

[mass,turns,width,height,B] = CoilTurns( Ri, I0, d )
[mass,turns,width,height,B] = CoilTurns( Ri, I0, Iwire, diameter, density )


Inputs

Ri       (1,1)   Coil inner radius (m)
I0       (1,1)   Total current (A)
Iwire    (1,1)   Wire operating current (A)
diameter (1,1)   Wire diameter (mm)
density  (1,1)   Density of wire material (kg/m3)

Outputs

mass     (1,1)   Coil mass
turns    (1,1)   Turns of wire
width    (1,1)   Width of coil (m)
height   (1,1)   Width of coil (m)
B        (1,1)   Approximate field (T)

See also PancakeMagnetTurns, Bpancake, SuperconductorDataStructure


References and().

◆ ConcentricCoils()

function ConcentricCoils ( in  d,
in  bAve,
in  a,
in  pTitle 
)

Field for coaxial coils (poorly named)

Field in the center of a set of concentric coils. Uses fminsearch to select the currents to minimize the deviations of the central field from the desired average field.


Form

[b, i, z] = CoaxialCoils( d, bAve, a )


Inputs

d     (1,p)  distances between the coils
bAve  (1,1)  Target magnetic field
a     (1,p)  Radii of coils
pTitle (1,:) Optional plot title

Outputs

b     (1,:)  Field at each output distance z
i     (1,p)  Current in each coils
z     (1,:)  Array from d(1) to d(end)

References set().

◆ ConcentricCoilsFiniteWidth()

function ConcentricCoilsFiniteWidth ( in  d,
in  bAve,
in  a,
in  w,
in  pTitle 
)

Field for concentric coils with a finite width.

Field in the center of a set of concentric coils. Uses fminsearch to select the currents to minimize the deviations of the central field from the desired average field.


Form

[b, i, z] = ConcentricCoils( d, bAve, a, w )


Inputs

d     (1,p)  distances between the coils
bAve  (1,1)  Target magnetic field
a     (1,p)  Radii of coils
w     (1,:)  z location of current element
pTitle (1,:) Optional plot title

Outputs

b     (1,:)  Field at each output distance z
i     (1,p)  Current in each coils
z     (1,:)  Array from d(1) to d(end)

References set().

◆ ConstBFlux()

function ConstBFlux ( in  r,
in  B 
)

Enclosed flux assuming constant B.

Dimensions in meters. B in tesla. Phi in V*s or equivalently T*m^2


Form

phi = ConstBFlux( r,B )


Inputs

r              (:,:) Radius at which to compute B
B              (1,1) Strength of the axial B field

Outputs

phi            (:,:) Inclosed flux at that radius, assuming uniform
axial B

◆ CurrentForField()

function CurrentForField ( in  a,
in  B 
)

Current to produce a desired field at the center of a wire loop.


Form

I = CurrentForField(a, B)


Inputs

a   (1,1)   Radius (m)
B   (1,1)   Field  (T)

Outputs

I   (1,1)   Current (A)

◆ EllipsoidalSolenoid()

function EllipsoidalSolenoid ( in  rMin,
in  rMax,
in  z 
)

Calculate the radii for an ellipsoidal solenoid.

The coils will be at the specified Z locations. Z may be all positive, for half of the system, or include both the negative and positive locations.

Has a built-in demo for a 4 m system.


Form

[r, a, b] = EllipsoidalSolenoid( rMin, rMax, z )


Inputs

rMin    (1,1)
rMax    (1,1)
z       (1,n)

Outputs

r   (1,n)     Radii of each coil
a   (1,1)     Radial axis of ellipsoid
b   (1,1)     Z-axis of ellipsoid

References and().

◆ FieldCurrentLoop()

function FieldCurrentLoop ( in  a,
in  i,
in  z 
)

Field along the central axis of a single current loop.


Reference: http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/curloo.html


Form

b = FieldCurrentLoop( a, i, z )


Inputs

a    (1,1)  Radius (m)
i    (1,1)  Current (A)
z    (1,1)  Distance from center of loop, along loop axis (m)

Outputs

b    (1,1)  Field (T)

◆ FLinearCurrent()

function FLinearCurrent ( in  z0,
in  Imin 
)

Linear current shape for PFRC magnets.


Form

Is = FLinearCurrent( zs )


Inputs

z0      (1,n)    Magnet locations along z axis (scaled to 1)
Imin    (1,n)    Fraction, end current/peak current

Outputs

Is      (1,n)    Magnet currents (scaled to 1)

See also: Solv0eSolenoid


◆ ForceBetweenCurrentLoops()

function ForceBetweenCurrentLoops ( in  a,
in  h,
in  i,
in  n 
)

Total force between concentric current loops.

The force between infinite wires is an approximation.

Type ForceBetweenCurrentLoops for a demo for an 8 T coils


Form

[f, fIL] = ForceBetweenCurrentLoops( a, h, i, n )


Inputs

a   (1,1) Radius (m)
h   (1,1) Z distance (m)
i   (1,1) Current (A)
n   (1,1) Number of points

Outputs

f   (3,1) Force vector (N)
fIL (1,1) Force between infinite wires (N)

◆ FSteppedCurrent()

function FSteppedCurrent ( in  z0,
in  Iend 
)

Stepped current shape for PFRC magnets.

Only the last magnet has a smaller current


Form

Is = FSteppedCurrent( z0, Iend )


Inputs

z0      (1,n)    Magnet locations along z axis (scaled to 1)
Iend    (1,1)    Fraction, end current/peak current

Outputs

Is      (1,n)    Magnet currents (scaled to 1)

See also: Solv0eSolenoid


◆ MagnetArrayMass()

function MagnetArrayMass ( in  a0,
in  I0,
in  Iop,
in  N0,
in  d 
)

Calculate the size and mass of pancake magnets from radius and current.

Assume the radii and currents are for one-half of the machine. Calculates the number of turns needed for each magnet from the specified operating current. The width is adjusted until the magnet is wider than it is tall, which produces the minimum pancake mass.


Form

[mass,mass_k] = MagnetArrayMass( a0, I0, Iop, N, d )

Inputs:

a0 (1,n) Magnet inner radius I0 (1,n) Magnet currents, A-T Iop (1,1) HTS operating current (A) N0 (1,1) (unused) d (.) Struct with HTS properties

Outputs:

mass (1,1) Mass of the array mass_k (1,n) Mass of the magnets dw (1,n) Width of magnet (pancakes) dh (1,n) Height of magnet (turns) N (1,n) Number of double-pancakes


See also: PancakeMagnetTurns, PancakeMagnetMass


References and().

◆ MagnetDataStructure()

function MagnetDataStructure ( )

Magnet data structure for current and mass model.

Work in progress.


Form

d = MagnetDataStructure



Outputs


d (.) Data structure output .r (1,:) Coil radii (m) .z (1,:) Coil axial positions (m) .w (1,1) Filament (wire) radius or width (m) .I (1,:) Total current (A-turns) .b (1,1) Central field (T) .Iop (1,1) Operating current (A) .temp (1,1) Operating temperature (K) .mass (1,1) Windings mass (kg) .dims (1,2) Dimensions of windings, [h w] (m) .turns (1,1) Turns at Iop


See also CoAxStruct


References and().

◆ NbTiHysteresis()

function NbTiHysteresis ( in  BDot,
in  Jc,
in  d,
in  Jt 
)

Determine the heating due to hysteresis in an AC NbTi coil.

Uses the model of Wilson to determine the volumetric heating in an NbTi coil. Valid only when the applied B is larger than the penetration field.


Form

Qdot = NbTiHysteresis(Bdot,Jc,d,Jt)


Inputs

BDot  (:,:)     Magnetic field change, Tesla per second (T/s)
Jc    (:,:)     Critical current density of coil (A/m^2) 
d     (:,:)     Diameter of NbTi filament, meters (m)
Jt    (:,:)     Transport current density (A/m^2)

Outputs

QDot  (:,:)     Volumetric heating power density, W/m^3

See also DesignMotor.m, NbTiPenetrationField.m


Reference: Wilson, Martin N. "NbTi Superconductors with Low Ac Loss: A Review." Cryogenics, Special Issue: Low-Tc Superconducting Materials, 48, no. 7 (July 1, 2008): 381-95. https://doi.org/10.1016/j.cryogenics.2008.04.008.


◆ NbTiModel()

function NbTiModel ( in  T,
in  B,
in  Jop 
)

Compute the critical current and temperature for NbTi wire.

All current densities J are relative to the critical value at 5 T, 4.2K.

Data set from Taylor [11], Nb-44Ti alloy


Form

[Jc,Tc,Tsh] = NbTiModel( T, B, Jop )


Inputs

T       (:)     Operating temperature (K)
B       (:)     Magnetic field (T)
Jop     (1)     Operating current, fraction of Jc (4.2K, 5 T)

Outputs

Jc      (:,:)    Critical current density at (T,B)
Tc      (:)      Critical temperture at B
Tsh     (:)      Sharing temperature at Jop and B

References: L. Bottura, "A PRACTICAL FIT FOR THE CRITICAL SURFACE OF NBTI,"

LHC Project Report 358, 1 December 1999. M.A. Green, "Calculating the Jc, B, T surface for niobium titanium using a reduced-state model," IEEE Trans. Mag., vol. 25 (2), p. 2119, 1989.


References and(), and set().

◆ NbTiPenetrationField()

function NbTiPenetrationField ( in  Jc,
in  d 
)

Determine the penetration field of an AC NbTi coil.

Uses the model of Wilson to determine the field above which the NbTi is fully penetrated


Form

Bp = NbTiPenetrationField(Jc,d)


Inputs

Jc    (:,:)     Critical current density of coil (A/m^2) 
d     (:,:)     Diameter of NbTi filament, meters (m)

Outputs

Bp    (:,:)     Penetration field, Tesla (T)

See also NbTiHystereses.m


Reference: Wilson, Martin N. "NbTi Superconductors with Low Ac Loss: A Review." Cryogenics, Special Issue: Low-Tc Superconducting Materials, 48, no. 7 (July 1, 2008): 381-95. https://doi.org/10.1016/j.cryogenics.2008.04.008.


◆ PancakeMagnetMass()

function PancakeMagnetMass ( in  B0,
in  Ri,
in  N,
in  Iop,
in  d 
)

Size a pancake magnet to produce a desired B given the wire properties.

Assumes a pancake model with number of double pancakes N. This is just the mass of the conductor, additional structural mass is not included.

If d.thick is zero, assumes circular wire instead of flat tape.


Form

[mass,turns,h,w,N,I] = PancakeMagnetMass( B0, Ri, N, Iop, d )


Inputs

B0   (1,1)  Target field (T)
Ri   (1,1)  Inner radius (m)
N    (1,1)  Number of double-pancakes, [] to calculate
Iop  (1,1)  Operating curremt (A)
d     (.)   Wire data structure
.width     (mm)
.thick     (mm)
.rho       (kg/m3)

Outputs :

mass    (1,1)   Mass of the conductor (kg)
turns   (1,1)   Turns, total (all pancakes)
height  (1,1)   Height of windings (m)
width   (1,1)   Width of widings (m)
N       (1,1)   Number of double-pancakes
I       (1,1)   Total current in windings, A-T

See also: SuperconductorDataStructure


◆ PancakeMagnetTurns()

function PancakeMagnetTurns ( in  I0,
in  Ri,
in  N,
in  Iop,
in  d 
)

Compute the turns for a pancake magnet given the total current.

This is a double-pancake model, N is the number of double-pancakes.


Form

[mass,turns,w,h,B] = PancakeMagnetTurns( I0, Ri, N, Iop, d )


Inputs

I0   (1,1) total current (A)
Ri   (1,1) inner radius (m)
N    (1,1) number of double-pancakes
Iop  (1,1) wire operating current
d    (.)   Wire data structure

Outputs

mass     (1,1)   Coil mass
turns    (1,1)   Turns of wire (per pancake)
width    (1,1)   Width of coil (m)
height   (1,1)   Height of coil (m)
B        (1,1)   Pancake field (T)

See also PancakeMagnetMass


◆ REffPancake()

function REffPancake ( in  Ri,
in  Ro 
)

Effective radius of a thin pancake coil.

Excludes the effect of the width of the coil. Either input may be a vector.

Reff = REffPancake( Ri, Ro )


Form

Reff = REffPancake( Ri, Ro )


Inputs

Ri    (1,1)    Inner radius
Ro    (1,1)    Outer radius

Outputs

Reff  (1,1)    Effective radius

References vector().

◆ ScanMagnetArray()

function ScanMagnetArray ( in  a0,
in  I0,
in  z0,
in  doPlot 
)

Compute axial field scan of a symmetric magnet array.

This uses a single loop current model. If z0 are all positive it will automatically add the other half of the array.


Form

[B,xs,b0] = ScanMagnetArray(a0,I0,z)


Inputs

a0      (1,n)    Magnet radii
I0      (1,n)    Magnet currents
z0      (1,n)    Magnet locations along z axis
doPlot   (1)     Boolean, make plot

Outputs

B       (1,:)    Magnetic field scan
xs      (1,:) 
B0      (1,n)

See also FieldCurrentLoop, MagneticFieldCurrentLoop


◆ SolenoidForces()

function SolenoidForces ( in  a,
in  h,
in  i,
in  n 
)

Total force between coaxial current loops.

The force between infinite wires is an approximation.

Type SolenoidForces for a demo for eight 5T coils.


Form

[f, fR, fM] = SolenoidForces( a, h, i, n )


Inputs

a   (1,:) Radius (m)
h   (1,:) Z distance (m)
i   (1,1) Current (A)
n   (1,1) Number of points

Outputs

f   (3,:) Force vector (N)
fR  (1,:) Radial self force (N)


See also: CoilSelfForce

◆ SolenoidStructuralMass()

function SolenoidStructuralMass ( in  a,
in  b,
in  w,
in  z,
in  bA,
in  bB,
in  j,
in  nu,
in  sigma,
in  rho 
)

Structural mass for a discrete solenoid.

Computes the total structural mass of a solenoid. Inputs are for each coil. The axial masses are between the coils. The circumferential are for each coil. The stress limit should include safety factors.

Type SolenoidStructuralMass for a demo. Uses Titanium.


Form

[massA, massC, massT] = SolenoidStructuralMass( a, b, w, z, bA, bB,
j, nu, sigma, rho )


Input

a     (1,:) Inner radius (m)
b     (1,:) Outer radius (m)
w       (1,:) Axial width of coil (m)
z       (1,:) Axial position (m)
bA      (1,:) Inner field (T)
bB      (1,:) Outer field (T)
j     (1,:) Total current (A)
nu      (1,1) Poisson's ratio for the structural material
sigma   (1,1) Stress limit for the structural material (N/m^2)
rho   (1,1) Density of structural material (kg/m^3)

Output

massA   (1,:) Structural mass for axial stress (kg)
massC   (1,:) Structural mass for circumferential stress (kg)
massT (1,1) Total mass (kg)

See also: SolenoidForces, CoilStresses


Reference: Wilson, M. N., "Superconducting Magnets", Oxford Science Publications, 1983, pp. 41-45


◆ SolveSolenoid()

function SolveSolenoid ( in  a0,
in  z0,
in  B0,
in  fScale 
)

Solve for the maximum current that produces the target peak field.

Applies a single-loop model to coils at the given locations and radii. The currents are scaled using the given function. The default is uniform currents. Tze current function should be of the form:

Is = FScale( zs )

where the zs and Is are both scaled to maximum values of 1. If z0 are all positive it will automatically add the other half of the array.


Form

[iC,iCs] = SolveSolenoid( a0, z0, B0, fScale )


Inputs

a0      (1,n)    Magnet radii (m)
z0      (1,n)    Magnet locations along z axis (m)
B0      (1,1)    Target peak magnetic field (T)
fScale   (@)     Function handle for current shape

Outputs

I0      (1,n)    Magnet currents (A)

See also: CurrentForField, MagneticFieldCurrentLoop


References and().

◆ SuperconductorDataStructure()

function SuperconductorDataStructure ( in  type)

Superconducting wire data structure, HTS or LTS.

The default is for HTS superconducting tape. For LTS wire, set "thick" to zero. The operating current is a function of applied field and operating temperature.


Form

d = SuperconductorDataStructure( type )


Input:

type   ''    String, 'HTS' is the default, or else 'LTS'

Output:

d    (.)    Data structure
.width     [mm]
.thick     [mm]
.rho       [kg/m3]
.linearRho [g/cm]
.Iop       [A]

References and(), and set().

◆ SuperPowerHTS()

function SuperPowerHTS ( in  B,
in  T 
)

Properties of SuperPower HTS 12 mm tape.

Properties of HTS tape as measured by SSI in the lab circa 2017. Interpolates the entered field and temperature and provides warnings if the data is out of range.


Form

SuperPowerHTS             % demo
I = SuperPowerHTS( B, T )     % function
SuperPowerHTS( print )    % print model properties


Input:

B     Field (T)
T     Temperature (K)

Output:

I     Current (A)

References and(), and isempty().