From 3c94a0c7057384ca603e53091dcb43a1dc26bae2 Mon Sep 17 00:00:00 2001 From: schoener Date: Fri, 8 Oct 2021 15:49:49 +0200 Subject: [PATCH] transfer work to desktop --- src/coil_class.py | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/coil_class.py b/src/coil_class.py index e773ea5..e6dc261 100644 --- a/src/coil_class.py +++ b/src/coil_class.py @@ -9,6 +9,8 @@ import matplotlib.pyplot as plt import logging as log from scipy import special as sp +import time + from src import physical_constants as cs @@ -127,6 +129,7 @@ class BCoil: :param raster_value: wire height/raster_value is distance between rastered points in one wire :return: 2 dim array [[z1,R1], [z2,R2], ...] """ + outer_raster = np.zeros((self.get_N(),2)) it = 0 z_start = self.get_zmin() + self.get_tot_wire_height()/2 # (distance_coils/2 - windings * wire_height/2 + wire_height/2)*1e-3 @@ -146,8 +149,34 @@ class BCoil: outer_raster[it] = [z_pos, R_pos] it += 1 + return outer_raster + def inner_raster(self, raster_value): + """ + Gives back inner raster for one wire around pos + Args: + pos: [z_pos, r_pos] + raster_value: if N produces a N x N raster for rectangular and cut out of this for round + + Returns: array containing raster around [[z_pos_in_1,r_pos_in_1],...] + """ + if raster_value ==1: + return pos + + inner_raster = np.zeros((raster_value**2,2)) + it = 0 + for xx_in in range(0, raster_value): + for zz_in in range(0, raster_value): + z_pos_in = - self.wire_height/2 + zz_in * self.wire_height/(raster_value-1) + r_pos_in = - self.wire_width/2 + xx_in * self.wire_width/(raster_value-1) + + inner_raster[it] = [z_pos_in, r_pos_in] + it += 1 + return inner_raster + + def inner_raster_pos + def print_info(self): print(" ") @@ -524,11 +553,13 @@ class BCoil: return cf.resistivity_copper(T) * self.get_wire_length() / self.get_wire_area() -HH_Coil = BCoil(HH=1, distance=10, radius=10, layers=2, windings=2, wire_height=1, wire_width=1, - insulation_thickness=0.25, is_round=True, winding_offset= True) +HH_Coil = BCoil(HH=1, distance=10, radius=10, layers=2, windings=2, wire_height=1.5, wire_width=2.5, + insulation_thickness=0.25, is_round=False, winding_offset=False) + +pos = [1,7] +print(HH_Coil.inner_raster(pos,10)) + - -print(HH_Coil.winding_raster())