Inductance¶
Mutual inductance¶
cfsem.flux_circular_filament ¶
flux_circular_filament(
ifil: NDArray[float64],
rfil: NDArray[float64],
zfil: NDArray[float64],
rprime: NDArray[float64],
zprime: NDArray[float64],
par: bool = True,
) -> NDArray[float64]
Flux contributions from some circular filaments to some observation points, which happens to be the Green's function for the Grad-Shafranov solve.
This represents the integral of \(\vec{B} \cdot \hat{n} \, dA\) from the z-axis to each
(rprime, zprime) observation location with \(\hat{n}\) oriented parallel to the z-axis.
A convenient interpretation of the flux is as the mutual inductance
between a circular filament at (rfil, zfil) and a second circular
filament at (rprime, zprime); this can be used to get the mutual inductance
between two filamentized coils as the sum of flux contributions between each coil's filaments.
Because mutual inductance is reflexive, the order of the coils can be reversed and
the same result is obtained.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ifil
|
NDArray[float64]
|
[A] filament current |
required |
rfil
|
NDArray[float64]
|
[m] filament R-coord |
required |
zfil
|
NDArray[float64]
|
[m] filament Z-coord |
required |
rprime
|
NDArray[float64]
|
[m] Observation point R-coord |
required |
zprime
|
NDArray[float64]
|
[m] Observation point Z-coord |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[Wb] or [T-m^2] or [V-s] psi, poloidal flux at each observation point |
Source code in cfsem/bindings.py
cfsem.mutual_inductance_of_circular_filaments ¶
Analytic mutual inductance between a pair of ideal cylindrically-symmetric coaxial filaments.
This is equivalent to taking the flux produced by each circular filament from either collection of filaments to the other. Mutual inductance is reflexive, so the order of the inputs is not important.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rzn1
|
array
|
3x1 array (r [m], z [m], n []) coordinates and number of turns |
required |
rzn2
|
array
|
3x1 array (r [m], z [m], n []) coordinates and number of turns |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
[H] mutual inductance |
Source code in cfsem/__init__.py
cfsem.mutual_inductance_of_cylindrical_coils ¶
Analytical mutual inductance between two coaxial collections of ideal filaments.
Each collection typically represents a discretized "real" cylindrically-symmetric coil of rectangular cross-section, but could have any cross-section as long as it maintains cylindrical symmetry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f1
|
NDArray
|
3 x N array of filament definitions like (r [m], z [m], n []) |
required |
f2
|
NDArray
|
3 x N array of filament definitions like (r [m], z [m], n []) |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
Returns:
| Type | Description |
|---|---|
float
|
[H] mutual inductance of the two discretized coils |
Source code in cfsem/__init__.py
cfsem.mutual_inductance_piecewise_linear_filaments ¶
mutual_inductance_piecewise_linear_filaments(
xyz0: Array3xN,
xyz1: Array3xN,
wire_radius: float | NDArray = 0.0,
) -> float
Estimate the mutual inductance between two piecewise-linear current filaments.
Uses the vector-potential line-integral form \(M = \oint \vec{A}_{source} \cdot d\vec{l}_{target}\) with the finite-radius linear-filament vector-potential kernel.
Assumes:
- Thin, well-behaved filaments
- Vacuum permeability everywhere
- Each filament has a constant current in all segments (otherwise we need an interaction matrix)
- All segments between the two filaments are distinct; no identical pairs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyz0
|
Array3xN
|
[m] 3xN point series describing the first filament |
required |
xyz1
|
Array3xN
|
[m] 3xM point series describing the second filament |
required |
wire_radius
|
float | NDArray
|
[m] source filament radius for |
0.0
|
Returns:
| Type | Description |
|---|---|
float
|
[H] Scalar mutual inductance between the two filaments |
Source code in cfsem/__init__.py
cfsem.mutual_inductance_circular_to_linear ¶
mutual_inductance_circular_to_linear(
rfil: NDArray[float64],
zfil: NDArray[float64],
nfil: NDArray[float64],
xyzfil: Array3xN,
dlxyzfil: Array3xN,
par: bool = True,
) -> NDArray[float64]
Mutual inductance between a collection of circular filaments and a piecewise-linear filament. This method is much faster (~100x typically) than discretizing the circular loop into linear segments and using Neumann's formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rfil
|
NDArray[float64]
|
[m] filament R-coord |
required |
zfil
|
NDArray[float64]
|
[m] filament Z-coord |
required |
nfil
|
NDArray[float64]
|
[dimensionless] filament number of turns |
required |
xyzfil
|
Array3xN
|
[m] x,y,z coords of current filament origins (start of segment) |
required |
dlxyzfil
|
Array3xN
|
[m] x,y,z length delta of current filaments |
required |
par
|
bool
|
Whether to use CPU parallelism |
True
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[H] mutual inductance |
Source code in cfsem/bindings.py
Self inductance¶
cfsem.self_inductance_annular_ring ¶
Low-frequency self-inductance of a thick-walled tube bent in a circle.
Uses Wien's method, per the 1912 NIST handbook [1], Eqn. 64 on pg. 112, with a correction to a misprint in term 5 and a unit conversion factor in the final expression.
This is an approximation that drops terms of order higher than (a/r)^2
and (b/r)^2.
References
[1] E. B. Rosa and F. W. Grover, “Formulas and tables for the calculation of mutual and self-inductance (Revised),” BULL. NATL. BUR. STAND., vol. 8, no. 1, p. 1, Jan. 1912, doi: 10.6028/bulletin.185
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
[m] major radius of loop |
required |
a
|
float
|
[m] inner minor radius (tube inside radius) |
required |
b
|
float
|
[m] outer minor radius (tube outside radius) |
required |
Returns:
| Type | Description |
|---|---|
float
|
[H] self-inductance [H] |
Source code in cfsem/__init__.py
cfsem.self_inductance_circular_ring_wien ¶
Wien's formula for the self-inductance of a circular ring with thin circular cross section.
Uses equation 7 from reference [1].
References
[1] E Rosa and L Cohen, "On the Self-Inductance of Circles," Bulletin of the Bureau of Standards, 1908. [Online]. Available: https://nvlpubs.nist.gov/nistpubs/bulletin/04/nbsbulletinv4n1p149_A2b.pdf
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
major_radius
|
NDArray
|
[m] Major radius of the ring. |
required |
minor_radius
|
NDArray
|
[m] Radius of the ring's cross section. |
required |
Returns:
| Type | Description |
|---|---|
NDArray
|
[H] self-inductance |
Source code in cfsem/__init__.py
cfsem.self_inductance_distributed_axisymmetric_conductor ¶
self_inductance_distributed_axisymmetric_conductor(
current: float,
grid: tuple[NDArray, NDArray],
mesh: tuple[NDArray, NDArray],
b_part: tuple[NDArray, NDArray],
psi_part: NDArray,
mask: NDArray,
edge_path: tuple[NDArray, NDArray],
) -> tuple[float, float, float]
Calculation of a distributed conductor's self-inductance from two components:
- External inductance: the portion related to the poloidal flux exactly at the conductor edge
- Internal inductance: the portion related to the poloidal magnetic field inside the conductor, where the filamentized method used for coils does not apply due to the parallel arrangement and variable current density.
Note: the B-field and flux inputs are not the total from all sources - they are only the contribution from the distributed conductor under examination.
This calculation was developed for use with tokamak plasmas, but applies similarly to other kinds of distributed axisymmetric conductor.
Assumptions:
- Cylindrically-symmetric, distributed, single-winding, contiguous conductor
- No high-magnetic-permeability materials in the vicinity
- Isopotential on the edge contour
- This is slightly less restrictive than isopotential on the section, but notably does not allow the calc to be used with, for example, large, shell conductors where different regions are meaningfully independent of each other.
- Conductor interior does not touch the edge of the computational domain
- At least one grid cell of padding is needed to support finite differences
References
[1] S. Ejima, R. W. Callis, J. L. Luxon, R. D. Stambaugh, T. S. Taylor, and J. C. Wesley, “Volt-second analysis and consumption in Doublet III plasmas,” Nucl. Fusion, vol. 22, no. 10, pp. 1313-1319, Oct. 1982, doi: 10.1088/0029-5515/22/10/006
[2] J. A. Romero and J.-E. Contributors, “Plasma internal inductance dynamics in a tokamak,” arXiv.org. Accessed: Dec. 21, 2023. [Online]. Available: https://arxiv.org/abs/1009.1984v1 doi: 10.1088/0029-5515/50/11/115002
[3] J. T. Wai and E. Kolemen, “GSPD: An algorithm for time-dependent tokamak equilibria design.” arXiv, Jun. 22, 2023. Accessed: Sep. 15, 2023. [Online]. Available: https://arxiv.org/abs/2306.13163 doi: 10.48550/arXiv.2306.13163
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
float
|
[A] total toroidal current in this conductor |
required |
grid
|
tuple[NDArray, NDArray]
|
[m] (1 X nr) grids of (R coords, Z coords) |
required |
mesh
|
tuple[NDArray, NDArray]
|
[m] (nr X nz) meshgrids of (R coords, Z coords) |
required |
b_part
|
tuple[NDArray, NDArray]
|
[T] (nr X nz) Flux density (R-component, Z-component) due to this conductor |
required |
psi_part
|
NDArray
|
[V-s] or [T-m^2] (nr X nz) this conductor's poloidal flux field |
required |
mask
|
NDArray
|
(nr X nz) positive mask of the conductor's interior region |
required |
edge_path
|
tuple[NDArray, NDArray]
|
[m] (2 x N) closed (r, z) path along conductor edge |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float, float]
|
(Lt, Li, Le) Total, internal, and external self-inductance components |
Source code in cfsem/__init__.py
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 | |
cfsem.self_inductance_lyle6 ¶
Self-inductance of a cylindrically-symmetric coil of rectangular cross-section, estimated to 6th order.
This estimate is viable up to an L/D of about 1.5, above which it rapidly accumulates error and eventually produces negative values.
References
[1] T. R. Lyle, “IX. On the self-inductance of circular coils of rectangular section,” Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, vol. 213, no. 497-508, pp. 421-435, Jan. 1914, doi: 10.1098/rsta.1914.0009
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
float
|
[m] radius, coil center |
required |
dr
|
float
|
[m] radial width of coil |
required |
dz
|
float
|
[m] cylindrical height of coil |
required |
n
|
float
|
number of turns |
required |
Returns:
| Type | Description |
|---|---|
float
|
[H] self-inductance |
Source code in cfsem/__init__.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
cfsem.self_inductance_piecewise_linear_filaments ¶
self_inductance_piecewise_linear_filaments(
xyzp: Array3xN, wire_radius: float | NDArray = 0.0
) -> float
Estimate the self-inductance of one piecewise-linear current filament.
Uses the vector-potential line-integral form \(L = \oint \vec{A} \cdot d\vec{l}\) with the existing finite-radius linear-filament vector-potential kernel.
Assumes:
- Thin, well-behaved filaments
- Uniform current distribution within segments
- Low frequency operation; no skin effect
- Vacuum permeability everywhere
- Each filament has a constant current in all segments (otherwise we need an interaction matrix)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzp
|
Array3xN
|
[m] 3xN point series describing the filament |
required |
wire_radius
|
float | NDArray
|
[m] filament radius, scalar or array of length |
0.0
|
Returns:
| Type | Description |
|---|---|
float
|
[H] Scalar self-inductance |
Source code in cfsem/__init__.py
General¶
cfsem.inductance_piecewise_linear_filaments ¶
inductance_piecewise_linear_filaments(
xyzfil0: Array3xN,
dlxyzfil0: Array3xN,
xyzfil1: Array3xN,
dlxyzfil1: Array3xN,
wire_radius: float | NDArray[float64] = 0.0,
) -> float
Estimate the inductive coupling between two piecewise-linear current filaments.
Uses the line-integral form M = ∮ A_source · dl_target, evaluated at the
target segment midpoints with the finite-radius
vector_potential_linear_filament kernel.
Assumes:
- Thin, well-behaved filaments
- Uniform current distribution within segments
- Low frequency operation; no skin effect
- Vacuum permeability everywhere
- Each filament has a constant current in all segments (otherwise we need an interaction matrix)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzfil0
|
Array3xN
|
[m] Nx3 point series describing the filament origins |
required |
dlxyzfil0
|
Array3xN
|
[m] Nx3 length vector of each filament |
required |
xyzfil1
|
Array3xN
|
[m] Nx3 point series describing the filament origins |
required |
dlxyzfil1
|
Array3xN
|
[m] Nx3 length vector of each filament |
required |
wire_radius
|
float | NDArray[float64]
|
[m] source filament radius, scalar or array of length |
0.0
|
Returns: [H] Scalar inductance
Source code in cfsem/bindings.py
cfsem.inductance_linear_filaments ¶
inductance_linear_filaments(
xyzfil_tgt: Array3xN,
dlxyzfil_tgt: Array3xN,
xyzfil_src: Array3xN,
dlxyzfil_src: Array3xN,
wire_radius_src: float | NDArray[float64] = 0.0,
par: bool = True,
output: Literal["vector", "matrix"] = "vector",
) -> NDArray[float64]
Estimate inductive coupling from source filament segments to target filament segments.
Uses the same finite-radius A·dl kernel as
inductance_piecewise_linear_filaments,
but with a disjoint source/target segment API. The vector result is one inductive
coupling value per target segment. The matrix result is row-major (nsrc, ntgt).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyzfil_tgt
|
Array3xN
|
[m] target filament segment start points |
required |
dlxyzfil_tgt
|
Array3xN
|
[m] target filament segment deltas |
required |
xyzfil_src
|
Array3xN
|
[m] source filament segment start points |
required |
dlxyzfil_src
|
Array3xN
|
[m] source filament segment deltas |
required |
wire_radius_src
|
float | NDArray[float64]
|
[m] source filament radius, scalar or array of length |
0.0
|
par
|
bool
|
Whether to use CPU parallelism for |
True
|
output
|
Literal['vector', 'matrix']
|
|
'vector'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
[H] Target coupling vector of length |
NDArray[float64]
|
or explicit |