added updated time response
This commit is contained in:
parent
80aec59c32
commit
e3da39dd9b
@ -14,7 +14,7 @@ import matplotlib
|
||||
# matplotlib.use('Agg')
|
||||
# get_ipython().run_line_magic('matplotlib', 'qt')
|
||||
# get_ipython().run_line_magic('matplotlib', 'inline')
|
||||
import time
|
||||
# import time
|
||||
|
||||
from src import physical_constants as cs
|
||||
|
||||
@ -782,13 +782,13 @@ class BCoil:
|
||||
R = R_ref * (1 + alpha * (T - T_ref))
|
||||
return R
|
||||
|
||||
def resistance(self, T):
|
||||
def resistance(self, tempr):
|
||||
"""
|
||||
Calculates resistance of one coil of configuration
|
||||
|
||||
Parameters
|
||||
----------
|
||||
T : double
|
||||
tempr : double
|
||||
temperature in degree Celsius
|
||||
|
||||
Returns
|
||||
@ -797,7 +797,10 @@ class BCoil:
|
||||
resistance in Ohm
|
||||
"""
|
||||
|
||||
return BCoil.resistivity_copper(T) * self.get_wire_length() / self.get_wire_area()
|
||||
return BCoil.resistivity_copper(tempr) * self.get_wire_length() / self.get_wire_area()
|
||||
|
||||
def tau(self, tempr = 22):
|
||||
return self.induct_perry()/self.resistance(tempr)
|
||||
|
||||
|
||||
def main():
|
||||
|
123
time_response/03_FINAL_time_response.py
Normal file
123
time_response/03_FINAL_time_response.py
Normal file
@ -0,0 +1,123 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Tue Sep 7 13:18:18 2021
|
||||
|
||||
@author: Joschka
|
||||
"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from src import coil_class as BC
|
||||
|
||||
HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = 0.5,
|
||||
wire_width = 0.5, insulation_thickness = (0.546-0.5)/2, is_round = True,
|
||||
winding_scheme= 2)
|
||||
HH_Coil.set_R_inner(45.6)
|
||||
HH_Coil.set_d_min(2*24.075)
|
||||
# HH_Coil.print_info()
|
||||
|
||||
|
||||
I = 1
|
||||
Max_field = HH_Coil.max_field(I)
|
||||
HH_Coil.cooling(I, 22)
|
||||
|
||||
|
||||
# AHH_Coil = BC.BCoil(-1, 82 , 47.3 , 4, 6, wire_width= 1, wire_height= 1.5 ,layers_spacing = 0.25, windings_spacing= 0.25)
|
||||
|
||||
def I_current(Coil, I_0, t):
|
||||
L = Coil.induct_perry()
|
||||
|
||||
R = Coil.resistance(22.5)
|
||||
print(f"L={L}")
|
||||
print(f" R= {R}")
|
||||
tau = L / R
|
||||
print(f" τ = {tau}")
|
||||
I = I_0 * (1 - np.exp(-R / L * t))
|
||||
return I
|
||||
|
||||
|
||||
def I_current_exp(I_0, R, L, t):
|
||||
print("")
|
||||
print(L / R)
|
||||
I = I_0 * (1 - np.exp(-R / L * t))
|
||||
return I
|
||||
|
||||
#%%
|
||||
def U_t(t, coil, U_0, I_end, scaling):
|
||||
U_end = I_end * coil.resistance(22)
|
||||
U = (U_0-U_end) * np.exp(-t/coil.tau() * scaling) + U_end
|
||||
return U
|
||||
|
||||
# t = np.linspace(0, 0.005, 1000)
|
||||
# plt.plot(t* 1e3,U_t(t, HH_Coil, 15, I))
|
||||
# plt.xlabel("t [ms]")
|
||||
# plt.show()
|
||||
# print(U_t(0, HH_Coil, 15, I))
|
||||
|
||||
|
||||
|
||||
|
||||
U_vec = np.vectorize(U_t)
|
||||
|
||||
|
||||
def I_t_exp(time, coil, I_end, U_0, scaling):
|
||||
I = U_vec(time, coil, U_0, I_end, scaling) / coil.resistance(22) * (1 - np.exp(- time/coil.tau()))
|
||||
return I
|
||||
|
||||
def I_t_cut(time, coil, I_end, U_0):
|
||||
I = U_0 / coil.resistance(22) * (1 - np.exp(- time / coil.tau()))
|
||||
if I >= I_end:
|
||||
I = I_end
|
||||
return I
|
||||
|
||||
I_t_cut_vec = np.vectorize(I_t_cut)
|
||||
|
||||
|
||||
|
||||
|
||||
# %%
|
||||
t = np.linspace(0, 0.003, 10000)
|
||||
fig, axs = plt.subplots(2, 1, figsize = (7,7.5))
|
||||
fig.suptitle(f"Time response HH-coil: I_max = {I} A --> Max Field = {Max_field:.2f} G \n \n I(t) = U(t) / R * (1 - exp(- R/L * t))")
|
||||
ax = axs[0]
|
||||
# ax.title("test")
|
||||
ax.plot(t * 1e3, I_current(HH_Coil, I, t), label=f"U_0 = U_end = 1.5 V")
|
||||
|
||||
for U_0 in [10, 15, 28, 58]:
|
||||
ax.plot(t * 1e3, I_t_cut_vec(t, HH_Coil, I, U_0), label=f"U_0 = {U_0} V, U_end = 1.5 V")
|
||||
|
||||
# for scaling in np.arange(2,5,0.5):
|
||||
# ax.plot(t * 1e3, I_t_exp(t, HH_Coil, I, 15, scaling), label=f"Exponential decay U")
|
||||
|
||||
ax.set_xlabel("time [ms]")
|
||||
ax.set_ylabel("current I [A]")
|
||||
ax.legend()
|
||||
|
||||
ax = axs[1]
|
||||
|
||||
ax.plot(t * 1e6, I_current(HH_Coil, I, t), label=f"U_0 = U_end = 1.5 V")
|
||||
|
||||
for U_0 in [10, 15, 28, 58]:
|
||||
ax.plot(t * 1e6, I_t_cut_vec(t, HH_Coil, I, U_0), label=f"U_0 = {U_0} V, U_end = 1.5 V")
|
||||
# for scaling in np.arange(2,5,0.5):
|
||||
# ax.plot(t * 1e3, I_t_exp(t, HH_Coil, I, 15, scaling), label=f"Exponential decay U")
|
||||
|
||||
ax.set_xlabel("time [μs]")
|
||||
ax.set_ylabel("current I [A]")
|
||||
ax.set_xlim(0,120)
|
||||
ax.legend()
|
||||
|
||||
plt.savefig('time_response_estimation.png', dpi=400)
|
||||
plt.show()
|
||||
|
||||
# %%
|
||||
|
||||
print(f"L = {HH_Coil.induct_perry() * 1e6} μH")
|
||||
print(f"R = {HH_Coil.resistance(22)}")
|
||||
|
||||
V_max = 15
|
||||
I_set = 5e-3
|
||||
L = HH_Coil.induct_perry()
|
||||
f_drop = V_max/(2*np.pi*L*I_set)
|
||||
print(f_drop)
|
@ -14,14 +14,14 @@ from IPython import get_ipython
|
||||
|
||||
# get_ipython().run_line_magic('matplotlib', 'qt')
|
||||
|
||||
I = 1.25
|
||||
I = 1
|
||||
|
||||
HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = 0.5,
|
||||
wire_width = 0.5, insulation_thickness = (0.546-0.5)/2, is_round = True,
|
||||
winding_scheme= 2)
|
||||
HH_Coil.set_R_inner(45.6)
|
||||
HH_Coil.set_d_min(2*24.075)
|
||||
|
||||
HH_Coil = BC.BCoil(HH=1, distance=54, radius=48, layers=8, windings=8, wire_height=0.5, wire_width=0.5,
|
||||
windings_spacing=0.25, layers_spacing=0.25)
|
||||
HH_Coil.set_R_outer(49.3)
|
||||
HH_Coil.set_d_min(49.8)
|
||||
HH_Coil.print_info()
|
||||
# todo: asdkjflö
|
||||
|
||||
# Fast_Coil = BC.BCoil(HH = 1, distance = 54 ,radius = 48 , layers = 8, windings = 8, wire_height =0.5, wire_width = 0.5,windings_spacing=0, layers_spacing = 0)
|
||||
# Fast_Coil.set_R_outer(49.3)
|
||||
|
BIN
time_response/time_response_estimation.png
Normal file
BIN
time_response/time_response_estimation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 401 KiB |
BIN
time_response_estimation.png
Normal file
BIN
time_response_estimation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 400 KiB |
Loading…
Reference in New Issue
Block a user