opmcoils.BiplanarCoil#

class opmcoils.BiplanarCoil(planemesh, center, N_suh=50, standoff=1.6)[source]#

Biplanar coil.

Parameters:
planemeshmesh

One of the meshes in the biplanar mesh pair. The loaded mesh is duplicated and positioned in space using the standoff and center.

centerarray, shape (3, )

The center of the biplanar mesh pair.

N_suhint

The number of harmonics to use in

standofffloat

The distance between the mesh pairs.

Attributes:
trace_widthfloat

The trace width of the coil in mm.

cu_ozfloat

The copper ounces per square feet.

loops_loop

The discretized current loop.

inductancefloat

The coil self-inductance

lengthfloat

The total length of the coil.

resistancefloat

The coil resistance.

Methods

add_shield(mesh)

Add a shielded room.

discretize([N_contours, trace_width, cu_oz])

Discretize the solution into N_contours

evaluate(target_type, target_points, ...[, ...])

Evaluate the coil.

fit(target_points, target_field[, abs_error])

Create bfield specifications used when optimizing the coil geometry

make_cuts()

Make cuts to join loops.

plot([check_normals])

Plot the coil.

plot_coil([discretized, single])

Plot the coil

plot_field(target_points)

Plot the field.

predict(target_points)

Predict the field.

remove_shield()

Remove existing shield

save(pcb_fname, kicad_header_fname[, ...])

Save the files to be loaded in KICAD.

plot_field_2D

__init__(planemesh, center, N_suh=50, standoff=1.6)[source]#

Methods

__init__(planemesh, center[, N_suh, standoff])

add_shield(mesh)

Add a shielded room.

discretize([N_contours, trace_width, cu_oz])

Discretize the solution into N_contours

evaluate(target_type, target_points, ...[, ...])

Evaluate the coil.

fit(target_points, target_field[, abs_error])

Create bfield specifications used when optimizing the coil geometry

make_cuts()

Make cuts to join loops.

plot([check_normals])

Plot the coil.

plot_coil([discretized, single])

Plot the coil

plot_field(target_points)

Plot the field.

plot_field_2D()

predict(target_points)

Predict the field.

remove_shield()

Remove existing shield

save(pcb_fname, kicad_header_fname[, ...])

Save the files to be loaded in KICAD.

Attributes

inductance

The coil self-inductance

length

The total length of the coil.

resistance

The coil resistance.

shape

The length and width of the coil.

add_shield(mesh)[source]#

Add a shielded room.

discretize(N_contours=40, trace_width=4.0, cu_oz=4.0)[source]#

Discretize the solution into N_contours

Parameters:
N_contoursint

The number of contours.

trace_widthfloat

The tracewidth in mm.

cu_ozfloat

The trace thickness in oz/ft^2.

evaluate(target_type, target_points, target_field, target_points_z, metrics='all')[source]#

Evaluate the coil.

Parameters:
target_pointsarray, (n_points, 3)

Plot the field at the target points.

fit(target_points, target_field, abs_error=0.025)[source]#

Create bfield specifications used when optimizing the coil geometry

The absolute target field amplitude is not of importance, and it is scaled to match the C matrix in the optimization function.

Parameters:
target_fieldarray, shape (n_points, 3)

The vector target field.

property inductance#

The coil self-inductance

property length#

The total length of the coil.

make_cuts()[source]#

Make cuts to join loops.

plot(check_normals=False)[source]#

Plot the coil.

Parameters:
target_pointsarray, (n_points, 3)

Plot the field at the target points.

plot_coil(discretized=True, single=True)[source]#

Plot the coil

Parameters:
discretizedbool

Plot the discretized coil.

singlebool

Plot only one coil loop in the pair. Applies only if discretized is True.

Returns:
plotterpyvista.Plotter

The plotter object.

plot_field(target_points)[source]#

Plot the field.

Parameters:
target_pointsarray, (n_points, 3)

Plot the field at the target points.

predict(target_points)[source]#

Predict the field.

Parameters:
target_pointsarray, (n_points, 3)

Plot the field at the target points.

Returns:
B_predictedarray, (n_points, 3)

The predicted field at the target points.

remove_shield()[source]#

Remove existing shield

property resistance#

The coil resistance.

save(pcb_fname, kicad_header_fname, bounds=None, origin=(750, 750), bounds_wholeloop=True)[source]#

Save the files to be loaded in KICAD.

Parameters:
pdb_fnamestr

The file name of the KICAD pcb file.

kicad_header_fnamestr

The file name of the KICAD header.

boundstuple of (min_x, max_x, min_y, max_y)

Save only loops within the bounds expressed in mm.

origintuple of (x, y)

The origin in mm.

property shape#

The length and width of the coil.