In [1]:
using PyPlot

using Coils
using Coils.CoilsPlot

Introduction

The coil design method works on a predefined grid. The grid is defined by a set of points in space (vertices) and a directed graph g defining which are connected with one another. A connection between two vertices means, that a wire of a coil can be laid in a straight line between them.

It is absolutely possible to supply vertices (an array of arrays of x, y, z coordinates) and the graph manually. There is also fuction cuboid_system that defines a cuboid system, given it size (x, y and z) and the number of tiles along x, y and z directions.


In [2]:
g, vertex_positions = cuboid_system([1, 1, 1], [3, 3, 3])


Out[2]:
({56, 108} directed simple Int64 graph, Any[[-0.5, -0.5, -0.5], [-0.166667, -0.5, -0.5], [0.166667, -0.5, -0.5], [0.5, -0.5, -0.5], [-0.5, -0.166667, -0.5], [-0.166667, -0.166667, -0.5], [0.166667, -0.166667, -0.5], [0.5, -0.166667, -0.5], [-0.5, 0.166667, -0.5], [-0.166667, 0.166667, -0.5]  …  [0.166667, -0.166667, 0.5], [0.5, -0.166667, 0.5], [-0.5, 0.166667, 0.5], [-0.166667, 0.166667, 0.5], [0.166667, 0.166667, 0.5], [0.5, 0.166667, 0.5], [-0.5, 0.5, 0.5], [-0.166667, 0.5, 0.5], [0.166667, 0.5, 0.5], [0.5, 0.5, 0.5]])

In CoilsPlot there is a number of functions for plotting the objects.


In [3]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions)
plot_edges(g, vertex_positions, standalone = false)


The method optimizes the field in a finite set of Points Of Interest (poi). They can be supplied manually or a helper function cuboid_poi may be used. It has to be given the size, the position of the centre, the number of points (along each direction). The points may be created either in the whole volume (filled = true) or just on the surface.


In [4]:
poi = cuboid_poi([0.75, 0.75, 0.75], [0.0, 0.0, 0.0], [10, 10, 10], filled = false)


Out[4]:
488-element Array{Array{Float64,1},1}:
 [-0.375, -0.375, -0.375]      
 [-0.291667, -0.375, -0.375]   
 [-0.208333, -0.375, -0.375]   
 [-0.125, -0.375, -0.375]      
 [-0.0416667, -0.375, -0.375]  
 [0.0416667, -0.375, -0.375]   
 [0.125, -0.375, -0.375]       
 [0.208333, -0.375, -0.375]    
 [0.291667, -0.375, -0.375]    
 [0.375, -0.375, -0.375]       
 [-0.375, -0.291667, -0.375]   
 [-0.291667, -0.291667, -0.375]
 [-0.208333, -0.291667, -0.375]
 ⋮                             
 [0.291667, 0.291667, 0.375]   
 [0.375, 0.291667, 0.375]      
 [-0.375, 0.375, 0.375]        
 [-0.291667, 0.375, 0.375]     
 [-0.208333, 0.375, 0.375]     
 [-0.125, 0.375, 0.375]        
 [-0.0416667, 0.375, 0.375]    
 [0.0416667, 0.375, 0.375]     
 [0.125, 0.375, 0.375]         
 [0.208333, 0.375, 0.375]      
 [0.291667, 0.375, 0.375]      
 [0.375, 0.375, 0.375]         

In [5]:
figure(figsize = (6, 6))
plot_system(g, vertex_positions, poi)


Out[5]:
(-0.55, 0.55)

The goal field is defined as a function of space x (an array of size 3 - x, y and z), returning an array of size 3 - the x, y and z components of the field.


In [6]:
Bgoal(x) = [0, 100e-6, 0]


Out[6]:
Bgoal (generic function with 1 method)

Next, the graph is analysed to find cells (or tiles) - smallest loops to be found in the graph. Each will be treated as a tile coil.


In [7]:
cells = find_cells(g)


Out[7]:
54-element Array{Any,1}:
 [1, 2, 6, 5, 1]     
 [1, 2, 18, 17, 1]   
 [1, 5, 21, 17, 1]   
 [2, 3, 7, 6, 2]     
 [2, 3, 19, 18, 2]   
 [3, 4, 8, 7, 3]     
 [3, 4, 20, 19, 3]   
 [4, 8, 22, 20, 4]   
 [5, 6, 10, 9, 5]    
 [5, 9, 23, 21, 5]   
 [6, 7, 11, 10, 6]   
 [7, 8, 12, 11, 7]   
 [8, 12, 24, 22, 8]  
 ⋮                   
 [37, 38, 54, 53, 37]
 [38, 39, 55, 54, 38]
 [39, 40, 56, 55, 39]
 [41, 42, 46, 45, 41]
 [42, 43, 47, 46, 42]
 [43, 44, 48, 47, 43]
 [45, 46, 50, 49, 45]
 [46, 47, 51, 50, 46]
 [47, 48, 52, 51, 47]
 [49, 50, 54, 53, 49]
 [50, 51, 55, 54, 50]
 [51, 52, 56, 55, 51]

In [8]:
figure(figsize = (8, 8))
plot_vertices(vertex_positions, labels = false)
plot_cells(cells, vertex_positions)


Now the matrix of the system is calculated. It is a matrix of proportionality constants between the current in each cell (columns) and the magnetic field in each of the points of interest, in each direction (rows). It is calculated using the Biot-Savart law.


In [9]:
M = system_matrix(poi, vertex_positions, cells)


Out[9]:
1464×54 Array{Float64,2}:
 -3.01209e-7   3.01209e-7   1.8543e-6    …   4.58295e-9    4.95946e-9
 -3.01209e-7  -1.8543e-6   -3.01209e-7       8.66244e-9    4.95946e-9
  1.8543e-6    3.01209e-7  -3.01209e-7       4.38976e-9    1.53765e-9
  3.01209e-7  -3.01209e-7   9.34057e-7       3.92817e-9    5.1309e-9 
 -3.01209e-7  -1.8543e-6   -1.58914e-7       9.54808e-9    5.81575e-9
  1.8543e-6    3.01209e-7  -1.58914e-7   …   5.12795e-9    2.15478e-9
  9.90422e-7  -9.90422e-7   4.97031e-7       3.02508e-9    5.15446e-9
 -2.35337e-7  -1.39783e-6  -7.62862e-8       1.02959e-8    6.74236e-9
  1.39783e-6   2.35337e-7  -7.62862e-8       5.76366e-9    2.85513e-9
  1.04263e-6  -1.04263e-6   2.85092e-7       1.91067e-9    4.98457e-9
 -1.28118e-7  -3.22844e-7  -3.82384e-8   …   1.08398e-8    7.70703e-9
  3.22844e-7   1.28118e-7  -3.82384e-8       6.2324e-9     3.61371e-9
  4.99601e-7  -4.99601e-7   1.75136e-7       6.53692e-10   4.58295e-9
  ⋮                                      ⋱                           
  4.98457e-9  -4.98457e-9  -8.87769e-10     -9.90422e-7    1.04263e-6
  7.70703e-9  -3.61371e-9   6.54245e-9      -2.35337e-7   -1.28118e-7
  3.61371e-9  -7.70703e-9   6.54245e-9       1.39783e-6    3.22844e-7
  5.15446e-9  -5.15446e-9   1.79044e-10  …  -1.04263e-6    9.90422e-7
  6.74236e-9  -2.85513e-9   6.07745e-9      -1.28118e-7   -2.35337e-7
  2.85513e-9  -6.74236e-9   6.07745e-9       3.22844e-7    1.39783e-6
  5.1309e-9   -5.1309e-9    9.75162e-10     -4.99601e-7    3.01209e-7
  5.81575e-9  -2.15478e-9   5.53125e-9      -5.20416e-8   -3.01209e-7
  2.15478e-9  -5.81575e-9   5.53125e-9   …  -1.10073e-7    1.8543e-6 
  4.95946e-9  -4.95946e-9   1.53765e-9      -2.1166e-7    -3.01209e-7
  4.95946e-9  -1.53765e-9   4.95946e-9      -1.9893e-8    -3.01209e-7
  1.53765e-9  -4.95946e-9   4.95946e-9      -1.23699e-7    1.8543e-6 

We evaluate the goal magnetic field in each of the points of interest and concatenate the values into one big vector.


In [10]:
Bpoi = vcat(Bgoal.(poi)...)


Out[10]:
1464-element Array{Float64,1}:
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   
 0.0   
 ⋮     
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   
 0.0   
 0.0001
 0.0   

Now we solve the system. We look for the optimal currents in each of the tile coils, that will reproduce the goal magnetic field in the points of interest best. It is a linear least-squares problem.


In [11]:
optI = M \ Bpoi


Out[11]:
54-element Array{Float64,1}:
  27.697692356846243     
 -73.56830620721122      
  27.69769235684626      
  28.04486216166303      
 -74.94066812790211      
  27.697692356846222     
 -73.56830620721121      
 -27.697692356846268     
   1.5730249505734686e-14
  -1.0664287847591161e-14
  -1.7444299186529984e-14
  -1.178321869280364e-14 
   5.864674254375282e-16 
   ⋮                     
 -73.56830620721121      
 -74.94066812790211      
 -73.56830620721117      
 -27.697692356846268     
 -28.044862161663        
 -27.697692356846247     
   5.327389826883651e-15 
  -3.552713678800501e-15 
  -7.075722768033514e-16 
  27.697692356846233     
  28.044862161663033     
  27.69769235684626      

In [12]:
figure(figsize = (10, 10))
plot_vertices(vertex_positions, labels = false)
current_norm = 1000 / maximum(abs, optI)
plot_cells(cells, vertex_positions, optI * current_norm)


We proceed to simplify the system. The first step is for each edge to to add the currents of the adjacent tiles. We get the net current flowing along each edge.


In [13]:
edgecurrents = find_edgecurrents(g, cells, optI)


Out[13]:
Dict{LightGraphs.SimpleGraphs.SimpleEdge{Int64},Float64} with 108 entries:
  Edge 47 => 51 => -2.84514e-15
  Edge 25 => 26 => -1.37236
  Edge 29 => 30 => 1.37236
  Edge 51 => 52 => 27.6977
  Edge 20 => 22 => -0.34717
  Edge 36 => 52 => -27.6977
  Edge 49 => 53 => 3.55271e-14
  Edge 24 => 28 => 0.34717
  Edge 50 => 54 => -0.34717
  Edge 41 => 45 => 2.84217e-14
  Edge 43 => 44 => 45.8706
  Edge 7 => 8   => -27.6977
  Edge 13 => 14 => -45.8706
  Edge 8 => 22  => -27.6977
  Edge 19 => 20 => -1.37236
  Edge 18 => 30 => 1.94488
  Edge 34 => 36 => -6.01207e-15
  Edge 55 => 56 => 45.8706
  Edge 3 => 7   => 0.34717
  Edge 39 => 40 => 1.37236
  Edge 10 => 11 => -28.0449
  Edge 29 => 41 => 45.8706
  Edge 17 => 18 => -1.37236
  Edge 36 => 40 => -0.34717
  Edge 4 => 8   => -4.61853e-14
  ⋮             => ⋮

In [14]:
figure(figsize = (8, 8))
plot_vertices(vertex_positions, labels = false)
plot_edge_currents(g, edgecurrents, vertex_positions)


The result is a complicated net of current. We decompose the net into what we call simple loops.


In [15]:
simpleloops, simpleloopscurrents = find_all_simpleloops(g, edgecurrents)


Out[15]:
(Any[[1, 17, 29, 41, 42, 43, 44, 32, 20, 4, 3, 2, 1], [13, 25, 37, 53, 54, 55, 56, 40, 28, 16, 15, 14, 13], [5, 21, 33, 45, 46, 47, 48, 34, 22, 8, 7, 6, 5], [9, 23, 35, 49, 50, 51, 52, 36, 24, 12, 11, 10, 9], [18, 30, 31, 19, 18], [26, 38, 39, 27, 26], [2, 18, 17, 29, 30, 42, 43, 31, 32, 20, 19, 3, 2], [14, 26, 25, 37, 38, 54, 55, 39, 40, 28, 27, 15, 14], [2, 18, 17, 21, 33, 29, 30, 42, 46, 47  …  31, 32, 34, 22, 20, 19, 3, 7, 6, 2], [10, 14, 26, 25, 23, 35, 37, 38, 54, 50  …  55, 39, 40, 36, 24, 28, 27, 15, 11, 10]], Any[45.8706, 45.8706, 27.6977, 27.6977, 1.94488, 1.94488, 1.02519, 1.02519, 0.34717, 0.34717])

Now we plot the simple loops, together with the corresponding currents.


In [16]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
plot_loop(simpleloops[1], vertex_positions, color = "orange")
plot_loop(simpleloops[2], vertex_positions, color = "orange")
title("Current: $(simpleloopscurrents[1] * current_norm)")


Out[16]:
PyObject Text(0.5, 0.92, 'Current: 596.6090540199415')

In [17]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
plot_loop(simpleloops[3], vertex_positions, color = "green")
plot_loop(simpleloops[4], vertex_positions, color = "green")
title("Current: $(simpleloopscurrents[3] * current_norm)")


Out[17]:
PyObject Text(0.5, 0.92, 'Current: 360.24575754444464')

In [18]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
plot_loop(simpleloops[5], vertex_positions, color = "blue")
plot_loop(simpleloops[6], vertex_positions, color = "blue")
title("Current: $(simpleloopscurrents[5] * current_norm)")


Out[18]:
PyObject Text(0.5, 0.92, 'Current: 25.2957750846784')

In [19]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
plot_loop(simpleloops[7], vertex_positions, color = "indigo")
plot_loop(simpleloops[8], vertex_positions, color = "indigo")
title("Current: $(simpleloopscurrents[7] * current_norm)")


Out[19]:
PyObject Text(0.5, 0.92, 'Current: 13.334002907299462')

In [20]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
plot_loop(simpleloops[9], vertex_positions, color = "grey")
plot_loop(simpleloops[10], vertex_positions, color = "grey")
title("Current: $(simpleloopscurrents[9] * current_norm)")


Out[20]:
PyObject Text(0.5, 0.92, 'Current: 4.51541044363861')

We can characterise the performance of the design. For example by plotting the histogram of the difference of the goal field and the one generated with the design.


In [21]:
plot_deviation_histogram(poi, simpleloops, simpleloopscurrents, vertex_positions, Bgoal)


Out[21]:
PyObject Text(24.000000000000007, 0.5, '# POI')

Or we can plot the map of the difference between the goal field an the one produced by the system.


In [22]:
plot_loops_field(cells, optI, vertex_positions, [1, 2, 3], 0;
        n = 50, spanA = [-0.5, 0.5], spanB = [-0.5, 0.5], Bref = Bgoal, levels = -10:10)


Out[22]:
PyObject <matplotlib.colorbar.Colorbar object at 0x0000000039704D68>

A more complicated example

The magnetic field can be decomposed into linearly independent cartesian harmonic polynomials. Below are the polynomials up to the first order:

n = 1: $\quad P^x_1(\mathbf{r}) = 1 \quad P^y_1(\mathbf{r}) = 0 \quad P^z_1(\mathbf{r}) = 0$

n = 2: $\quad P^x_2(\mathbf{r}) = 0 \quad P^y_2(\mathbf{r}) = 1 \quad P^z_2(\mathbf{r}) = 0$

n = 3: $\quad P^x_3(\mathbf{r}) = 0 \quad P^y_3(\mathbf{r}) = 0 \quad P^z_3(\mathbf{r}) = 1$

n = 4: $\quad P^x_4(\mathbf{r}) = x \quad P^y_4(\mathbf{r}) = 0 \quad P^z_4(\mathbf{r}) = -z$

n = 5: $\quad P^x_5(\mathbf{r}) = y \quad P^y_5(\mathbf{r}) = x \quad P^z_5(\mathbf{r}) = 0$

n = 6: $\quad P^x_6(\mathbf{r}) = 0 \quad P^y_6(\mathbf{r}) = y \quad P^z_6(\mathbf{r}) = -z$

n = 7: $\quad P^x_7(\mathbf{r}) = z \quad P^y_7(\mathbf{r}) = 0 \quad P^z_7(\mathbf{r}) = x$

n = 8: $\quad P^x_8(\mathbf{r}) = 0 \quad P^y_8(\mathbf{r}) = z \quad P^z_8(\mathbf{r}) = y$

We will design a $n=5$ gradient coil on a system that is extended in the $y$ direction and has two large openings.

We will also assume that to construct the coil we will use wires with 10A, 1A and 0.1A per 100 μT/m field.


In [23]:
g, vertex_positions = cuboid_system([1, 2, 1], [3, 6, 3],
    skipfaces = [false, false, true, true, false, false])
poi = cuboid_poi([0.5, 0.5, 0.5], [0.0, 0.0, 0.0], [10, 10, 10], filled = true)

# the wires used to construct the coil
elemcurrents = [10.0, 1.0, 0.1]

figure(figsize = (6, 6))
plot_system(g, vertex_positions, poi)


Out[23]:
(-1.1, 1.1)

When there are large openings it takes a long time to find the cells automatically. It can be speeded up by providing the large cells manually.


In [24]:
# Find out the location of the openings
extrema(getindex.(vertex_positions, 2))


Out[24]:
(-1.0, 1.0)

In [25]:
# prepare the large cells 
front_face_unordered = [ i for i in eachindex(vertex_positions) if vertex_positions[i][2] < -0.9 ]
front_face = order_cell(g, front_face_unordered)
            
back_face_unordered = [ i for i in eachindex(vertex_positions) if vertex_positions[i][2] > 0.9 ]
back_face = order_cell(g, back_face_unordered)
                        
initialcells = [front_face, back_face]


Out[25]:
2-element Array{Array{Int64,1},1}:
 [1, 2, 3, 4, 30, 44, 60, 59, 58, 57, 43, 29, 1]     
 [25, 26, 27, 28, 42, 56, 84, 83, 82, 81, 55, 41, 25]

The goal field is a gradient coil, n = 5: $\quad P^x_5(\mathbf{r}) = y \quad P^y_5(\mathbf{r}) = x \quad P^z_5(\mathbf{r}) = 0$, magnitude is 100 μT/m.


In [26]:
Bgoal(x) = [2 * 100e-6 * x[2], 2 * 100e-6 * x[1], 0]


Out[26]:
Bgoal (generic function with 1 method)

We will use the solve_system function, which performs the whole design.


In [27]:
simpleloops, simpleloopscurrents = solve_system(g, vertex_positions, poi, Bgoal,
    verbose = true, initialcells = [front_face, back_face],
    mincurrent = minimum(elemcurrents) / 2)


Looking for cells in the graph...
Calculating the system's matrix...
Solving for currents in the cells...
Finding the total currents along the edges...
Decomposing the solution into simple loops...
Out[27]:
(Any[[1, 5, 31, 29, 1], [4, 8, 32, 30, 4], [21, 39, 41, 25, 21], [24, 40, 42, 28, 24], [43, 45, 61, 57, 43], [44, 46, 64, 60, 44], [53, 77, 81, 55, 53], [54, 80, 84, 56, 54], [1, 5, 6, 2, 1], [3, 4, 8, 7, 3]  …  [9, 13, 14, 18, 22, 26, 25, 21, 39, 41  …  81, 82, 78, 74, 70, 69, 65, 47, 33, 9], [12, 16, 15, 19, 23, 27, 28, 24, 40, 42  …  84, 83, 79, 75, 71, 72, 68, 48, 34, 12], [13, 14, 18, 22, 26, 25, 21, 39, 41, 55  …  82, 78, 74, 70, 69, 73, 51, 37, 17, 13], [15, 19, 23, 27, 28, 24, 40, 42, 56, 54  …  79, 75, 71, 72, 76, 52, 38, 20, 16, 15], [29, 43, 45, 47, 33, 31, 29], [30, 44, 46, 48, 34, 32, 30], [37, 39, 41, 55, 53, 51, 37], [38, 40, 42, 56, 54, 52, 38], [13, 14, 18, 22, 26, 25, 21, 39, 41, 55  …  77, 81, 82, 78, 74, 70, 69, 49, 35, 13], [15, 19, 23, 27, 28, 24, 40, 42, 56, 54  …  84, 83, 79, 75, 71, 72, 50, 36, 16, 15]], Any[728.547, 728.547, 728.547, 728.547, 728.547, 728.547, 728.547, 728.547, 622.42, 622.42  …  3.31922, 3.31922, 3.31922, 3.31922, 2.75133, 2.75133, 2.75133, 2.75133, 0.564779, 0.564779])

We decompose the solution into the currents that we want to build. We also calculate the real currents that will be flowing in the simpleloops, when they are constructed out of 10A, 1A and 0.1A wires.


In [28]:
simpleloopscurrents_decomp = decompose_currents(simpleloopscurrents, elemcurrents)
simpleloopscurrents_real = real_decomposed_currents(simpleloopscurrents_decomp, elemcurrents)


Out[28]:
48-element Array{Float64,1}:
 728.5               
 728.5               
 728.5               
 728.5               
 728.5               
 728.5               
 728.5               
 728.5               
 622.4               
 622.4               
 622.4               
 622.4               
 622.4               
   ⋮                 
   3.6               
   3.6               
   3.3               
   3.3               
   3.3               
   3.3               
   2.8               
   2.8               
   2.8               
   2.8               
   0.6000000000000001
   0.6000000000000001

We calculate the performance of the system build using the 10A, 1A and 0.1A wires.


In [29]:
plot_deviation_histogram(poi, simpleloops, simpleloopscurrents_real, vertex_positions, Bgoal)


Out[29]:
PyObject Text(24.000000000000007, 0.5, '# POI')

In [30]:
plot_loops_field(simpleloops, simpleloopscurrents_real, vertex_positions, [1, 2, 3], 0;
        n = 50, spanA = [-0.5, 0.5], spanB = [-1, 1], Bref = Bgoal, levels = -20:4:20)


Out[30]:
PyObject <matplotlib.colorbar.Colorbar object at 0x00000000025DAE10>

When we do not supply the reference field, we can plot the field of the coild.


In [31]:
plot_loops_field(simpleloops, simpleloopscurrents_real, vertex_positions, [1, 2, 3], 0;
        n = 50, spanA = [-0.5, 0.5], spanB = [-1, 1], levels = -50:5:50)


Out[31]:
PyObject <matplotlib.colorbar.Colorbar object at 0x000000003E22CAC8>

We print the decomposition of all the currents in the simple loops to the currents we want to use in the wires:


In [32]:
for i in eachindex(simpleloopscurrents)
    print("#$(lpad(i,2)): ")
    print("$(lpad(simpleloopscurrents[i], 20)) = ")
    print("$(lpad(simpleloopscurrents_decomp[i][1], 2)) * 10A  +  ")
    print("$(simpleloopscurrents_decomp[i][2]) * 1A  +  ")
    println("$(simpleloopscurrents_decomp[i][3]) * 0.1A")
end


# 1:    728.5474826025356 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 2:    728.5474826023292 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 3:    728.5474826023014 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 4:    728.5474826023014 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 5:    728.5474826022747 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 6:    728.5474826022484 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 7:    728.5474826022346 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 8:    728.5474826022219 = 72 * 10A  +  8 * 1A  +  5 * 0.1A
# 9:    622.4204080424164 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#10:    622.4204080422206 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#11:    622.4204080422206 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#12:    622.4204080422206 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#13:    622.4204080421588 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#14:    622.4204080421588 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#15:    622.4204080421531 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#16:    622.4204080421376 = 62 * 10A  +  2 * 1A  +  4 * 0.1A
#17:    268.8132969810194 = 26 * 10A  +  8 * 1A  +  8 * 0.1A
#18:     268.813296980954 = 26 * 10A  +  8 * 1A  +  8 * 0.1A
#19:     268.813296980954 = 26 * 10A  +  8 * 1A  +  8 * 0.1A
#20:   268.81329698094913 = 26 * 10A  +  8 * 1A  +  8 * 0.1A
#21:   40.578587195376855 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#22:    40.57858719536925 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#23:    40.57858719536925 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#24:    40.57858719536847 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#25:    40.57858719536847 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#26:     40.5785871953674 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#27:   40.578587195367156 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#28:   40.578587195366346 =  4 * 10A  +  0 * 1A  +  6 * 0.1A
#29:    7.290122543729126 =  0 * 10A  +  7 * 1A  +  3 * 0.1A
#30:    7.290122543729126 =  0 * 10A  +  7 * 1A  +  3 * 0.1A
#31:    3.579742959149229 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#32:   3.5797429591237773 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#33:     3.57974295912242 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#34:     3.57974295912242 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#35:    3.579742959122221 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#36:     3.57974295912107 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#37:    3.579742959118775 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#38:    3.579742959117418 =  0 * 10A  +  3 * 1A  +  6 * 0.1A
#39:    3.319215379759757 =  0 * 10A  +  3 * 1A  +  3 * 0.1A
#40:    3.319215379759757 =  0 * 10A  +  3 * 1A  +  3 * 0.1A
#41:    3.319215379759757 =  0 * 10A  +  3 * 1A  +  3 * 0.1A
#42:    3.319215379759757 =  0 * 10A  +  3 * 1A  +  3 * 0.1A
#43:    2.751333936315673 =  0 * 10A  +  2 * 1A  +  8 * 0.1A
#44:    2.751333936314908 =  0 * 10A  +  2 * 1A  +  8 * 0.1A
#45:    2.751333936314497 =  0 * 10A  +  2 * 1A  +  8 * 0.1A
#46:    2.751333936314497 =  0 * 10A  +  2 * 1A  +  8 * 0.1A
#47:    0.564779260279531 =  0 * 10A  +  0 * 1A  +  6 * 0.1A
#48:    0.564779260279531 =  0 * 10A  +  0 * 1A  +  6 * 0.1A

In [33]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 1:8
    plot_loop(simpleloops[i], vertex_positions, color = "C0")
end
title("Current: $(simpleloopscurrents[1])")


Out[33]:
PyObject Text(0.5, 0.92, 'Current: 728.5474826025356')

In [34]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 9:16
    plot_loop(simpleloops[i], vertex_positions, color = "C1")
end
title("Current: $(simpleloopscurrents[9])")


Out[34]:
PyObject Text(0.5, 0.92, 'Current: 622.4204080424164')

In [35]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 17:20
    plot_loop(simpleloops[i], vertex_positions, color = "C2")
end
title("Current: $(simpleloopscurrents[17])")


Out[35]:
PyObject Text(0.5, 0.92, 'Current: 268.8132969810194')

In [36]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 21:28
    plot_loop(simpleloops[i], vertex_positions, color = "C3")
end
title("Current: $(simpleloopscurrents[21])")


Out[36]:
PyObject Text(0.5, 0.92, 'Current: 40.578587195376855')

In [37]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 29:30
    plot_loop(simpleloops[i], vertex_positions, color = "C4")
end
title("Current: $(simpleloopscurrents[29])")


Out[37]:
PyObject Text(0.5, 0.92, 'Current: 7.290122543729126')

In [38]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 31:38
    plot_loop(simpleloops[i], vertex_positions, color = "C5")
end
title("Current: $(simpleloopscurrents[31])")


Out[38]:
PyObject Text(0.5, 0.92, 'Current: 3.579742959149229')

In [39]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 39:42
    plot_loop(simpleloops[i], vertex_positions, color = "C6")
end
title("Current: $(simpleloopscurrents[39])")


Out[39]:
PyObject Text(0.5, 0.92, 'Current: 3.319215379759757')

In [40]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 43:46
    plot_loop(simpleloops[i], vertex_positions, color = "C7")
end
title("Current: $(simpleloopscurrents[43])")


Out[40]:
PyObject Text(0.5, 0.92, 'Current: 2.751333936315673')

In [41]:
figure(figsize = (6, 6))
plot_vertices(vertex_positions, labels = false)
for i in 47:48
    plot_loop(simpleloops[i], vertex_positions, color = "C8")
end
title("Current: $(simpleloopscurrents[47])")


Out[41]:
PyObject Text(0.5, 0.92, 'Current: 0.564779260279531')