U_delta = U_arr[n_d, n_p] = U_beam_on - U_beam_off signal = signal_arr[n_d, n_p] = U_delta / U_beam_off T_max = T_max_arr[n_d, n_p] = np.amax( wire.record_dict["T_distribution"][-1]) T_avg = T_avg_arr[n_d, n_p] = np.average( wire.record_dict["T_distribution"][-1]) if True: # Calculate endstate of heat flow x_lst = [ 1000 * ((i + 0.5) * wire.l_segment - (wire.l_wire / 2)) for i in range(wire.n_wire_elements) ] wire.T_distribution = wire.record_dict["T_distribution"][-1] f_el_arr = [wire.f_el(j) for j in range(wire.n_wire_elements)] f_conduction_arr = [ wire.f_conduction(j) for j in range(wire.n_wire_elements) ] f_rad_arr = [ wire.f_rad(j) for j in range(wire.n_wire_elements) ] f_beam_arr = [ wire.f_beam(j) for j in range(wire.n_wire_elements) ] # Plot endstate of heat flow fig = plt.figure(0, figsize=(8, 6.5)) ax1 = plt.gca()
# Plot Temperature over Wire plt.figure(0, figsize=(8, 6.5)) ax1 = plt.gca() ax1.set_aspect(0.1) x_lst = [ 1000 * ((i + 0.5) * wire.l_segment - (wire.l_wire / 2)) for i in range(wire.n_wire_elements) ] T_beam_off = wire.record_dict["T_distribution"][0] T_beam_on = wire.record_dict["T_distribution"][-1] T_lst = [T_beam_off, T_beam_on] R_arr = np.zeros(2) for i, T_dist in enumerate(T_lst): wire.T_distribution = T_dist R_arr[i] = wire.resistance_total() U_delta = (R_arr[1] - R_arr[0]) * wire.i_current signal = (R_arr[1] - R_arr[0]) / R_arr[0] ax1.plot(x_lst, T_lst[0] - 273.15, "-", label=r"Beam Off, " + "R = {:.3f}".format(R_arr[0]) + r"$\Omega$") ax1.plot(x_lst, T_lst[1] - 273.15, "-", label=r"Beam On, " + "R = {:.3f}".format(R_arr[1]) + r"$\Omega$") ax1.set_ylabel("Temperature [°C]")
ani.save(animate_dir + 'basic_animation.gif', writer="imagemagick", fps=30) #plt.show() # Calculate heat flow over time x_lst = [ 1000 * ((i + 0.5) * wire.l_segment - (wire.l_wire / 2)) for i in range(wire.n_wire_elements) ] t_lst = wire.record_dict["time"] f_el_arr = np.zeros((record_steps + 1, wire.n_wire_elements)) f_conduction_arr = np.zeros((record_steps + 1, wire.n_wire_elements)) f_rad_arr = np.zeros((record_steps + 1, wire.n_wire_elements)) f_beam_arr = np.zeros((record_steps + 1, wire.n_wire_elements)) for i, time in enumerate(wire.record_dict["time"]): wire.T_distribution = wire.record_dict["T_distribution"][i] f_el_arr[i] = [wire.f_el(j) for j in range(wire.n_wire_elements)] f_conduction_arr[i] = [ wire.f_conduction(j) for j in range(wire.n_wire_elements) ] f_rad_arr[i] = [wire.f_rad(j) for j in range(wire.n_wire_elements)] f_beam_arr[i] = [wire.f_beam(j) for j in range(wire.n_wire_elements)] #Heat flow in ohmic heating lead up t_lst_0 = wire_no_beam.record_dict["time"] f_el_arr_0 = np.zeros((record_steps + 1, wire.n_wire_elements)) f_conduction_arr_0 = np.zeros((record_steps + 1, wire.n_wire_elements)) f_rad_arr_0 = np.zeros((record_steps + 1, wire.n_wire_elements)) f_beam_arr_0 = np.zeros((record_steps + 1, wire.n_wire_elements)) for i, time in enumerate(wire_no_beam.record_dict["time"]): wire_no_beam.T_distribution = wire_no_beam.record_dict["T_distribution"][i]