def __init__(self, text, colour = None, size = None): Spectrum.__init__(self, text) self.colour = colour self.size = size self.make_spacer_line() self.construct()
def __init__(self, bins, s=1, r=2, thermal_t=600.0): self.bins = bins self.scaling = s self.e2 = 1e6 self.thermal_t = thermal_t # Maxwellian distribution, Eq.(9-6) self.m = lambda x: x**0.5 * np.exp(-x / (k * self.thermal_t)) # U235 chi distribution, Eq.(2-112) self.chi = lambda x: np.exp(-1.036e-6 * x) * np.sinh( (2.29e-6 * x)**0.5) # Middle energy range self.f = lambda x: 1 / x self.r = 0 E = np.logspace(-5, 1, 1000) R = np.array([self.balance(e) for e in E]) self.e1 = np.interp(r, R, E) self.r = r self.c1 = 1.0 self.c2 = self.m(self.e1) / self.f(self.e1) self.c3 = self.c2 * self.f(self.e2) / self.chi(self.e2) vals = self.make_discrete(self.bins, self.scaling) Spectrum.__init__(self, self.bins, vals, False, dfde=True)
def __init__(self, P): self.power = P data = self.get_data() S = self.calc_scaling_factor() bins = data[:, 0] vals = data[:, 1][1:] Spectrum.__init__(self, bins, vals, False, S)
def __init__(self, bins, s=1, r=2, thermal_t=600.0): self.bins = bins self.scaling = s self.e2 = 1e6 self.thermal_t = thermal_t # Maxwellian distribution, Eq.(9-6) self.m = lambda x: x ** 0.5 * np.exp(-x / (k * self.thermal_t)) # U235 chi distribution, Eq.(2-112) self.chi = lambda x: np.exp(-1.036e-6 * x) * np.sinh((2.29e-6 * x) ** 0.5) # Middle energy range self.f = lambda x: 1 / x self.r = 0 E = np.logspace(-5, 1, 1000) R = np.array([self.balance(e) for e in E]) self.e1 = np.interp(r, R, E) self.r = r self.c1 = 1.0 self.c2 = self.m(self.e1) / self.f(self.e1) self.c3 = self.c2 * self.f(self.e2) / self.chi(self.e2) vals = self.make_discrete(self.bins, self.scaling) Spectrum.__init__(self, self.bins, vals, False, dfde=True)
def __init__(self, text, on_char = "O", off_char = " "): Spectrum.__init__(self, text) self.on_char = on_char self.off_char = off_char * len(self.on_char)
def __init__(self, surface_data, spectrum_data): self.N = surface_data[0] self.M = surface_data[1] random_phases = surface_data[2] kfrag = surface_data[3] self.wind = surface_data[4] Spectrum.__init__(self, spectrum_data) self.spectrum = self.get_spectrum() if kfrag == 'log': self.k = np.logspace(np.log10(self.k_m/4), np.log10(self.k_edge['Ku']), self.N + 1) elif kfrag == 'quad': self.k = np.zeros(self.N+1) for i in range(self.N+1): self.k[i] = self.k_m/4 + (self.k_edge['Ku']-self.k_m/4)/(self.N+1)**2*i**2 else: self.k = np.linspace(self.k_m/4, self.k_edge['Ku'], self.N + 1) self.k_ku = self.k[ np.where(self.k <= self.k_edge['Ku']) ] self.k_c = self.k[ np.where(self.k <= self.k_edge['C']) ] print(\ "Параметры модели:\n\ N={},\n\ M={},\n\ U={} м/с,\n\ Band={}\n\ mean=0".format(self.N,self.M,self.U10,self.band) ) self.phi = np.linspace(-np.pi, np.pi,self.M + 1) self.phi_c = self.phi + self.wind if random_phases == 0: self.psi = np.array([ [0 for m in range(self.M) ] for n in range(self.N) ]) elif random_phases == 1: self.psi = np.array([ [ np.random.uniform(0,2*pi) for m in range(self.M)] for n in range(self.N) ]) print(\ "Методы:\n\ Случайные фазы {}\n\ Отбеливание 0\n\ Заостренная волна {}\n\ ".format(bool(random_phases), False) ) print('Вычисление амплитуд гармоник...') self.A = self.amplitude(self.k) self.F = self.angle(self.k,self.phi) print('Подготовка завершена.')