def poolwithLUB(times1, times2, t_lb, t_ub): global Tempreatures, S, targetV temp1 = np.linspace(t_lb[0], t_ub[0], times1) temp2 = np.linspace(t_lb[1], t_ub[1], times1) temp3 = np.linspace(t_lb[2], t_ub[2], times1) temp4 = np.linspace(t_lb[3], t_ub[3], times1) carvs = np.linspace(65 / 60, 100 / 60, times2) for i, ti1 in enumerate(temp1): for j, ti2 in enumerate(temp2): for k, ti3 in enumerate(temp3): for z, ti4 in enumerate(temp4): for a, v in enumerate(carvs): temperatures = [ti1, ti2, ti3, ti4, 25] x, y = ek2.evaP1(temperatures, v) t1, t2, T, p = getttT(x, y) # print(t1, t2, T) if p2.checkT1T2T(t1, t2, T): # print("ok t1, t2, T") if targetMinSquare(x, y, v, p): Tempreatures = temperatures else: continue print("min S:", S) print("diff tempers are:", Tempreatures) print("carV: ", targetV)
def pools1(temperatures, times2): global Tempreatures diff = np.linspace(-10, 10, 21) carvs = np.linspace(65 / 60, 100 / 60, times2) for idx, carv in enumerate(carvs): for i in range(diff.size): temps = [] for j in range(4): temps.append(temperatures[j] + diff[i]) temps.append(25) # print("temps:", temps) # print("carv:", carv) # x, y = poll2(carv, temps) x, y = ek2.evaP1(temperatures, carv) t1, t2, T, p = getttT(x, y) # print(t1, t2, T) if p2.checkT1T2T(t1, t2, T): # print("ok t1, t2, T") if targetMinSquare(x, y, carv, p): print("success ont time.") Tempreatures = temps else: continue print("min S:", S) print("diff tempers are:", Tempreatures) print("carV: ", targetV)
def loops(times1, times2): global Tempreatures, S, targetV temp1 = np.linspace(165, 185, times1) temp2 = np.linspace(185, 205, times1) temp3 = np.linspace(225, 245, times1) temp4 = np.linspace(245, 265, times1) carvs = np.linspace(65, 100, times2) for i, ti1 in enumerate(temp1): for j, ti2 in enumerate(temp2): for k, ti3 in enumerate(temp3): for z, ti4 in enumerate(temp4): for a, v in enumerate(carvs): temperatures = [ti1, ti2, ti3, ti4, 25] # print(temperatures) # x, y = poll2(v, temperatures) x, y = ek2.evaP1(temperatures, v) t1, t2, T, p = getttT(x, y) if p2.checkT1T2T(t1, t2, T): print("ok t1, t2, T") if targetMinSquare(x, y, v, p): Tempreatures = temperatures else: continue print("min S:", S) print("diff tempers are:", Tempreatures) print("carV: ", targetV)
def poll(carv, tempreatures): dalt = 0.5 allLen = 435.5 tempreatures = [182, 203, 237, 254, 25] x, y = ek2.evaP1(tempreatures, carv) assert x.__len__() == y.__len__() timestart = -1 timeend = -1 t1 = 0 #温度上升过程中在150ºC~190ºC的时间 t2 = 0 #温度大于217ºC的时间 T = 0 #峰值温度 size = x.__len__() findS = False findE = False for i in range(size): if y[i]>=150 and findS==False: timestart = x[i] findS = True if y[i]>=190 and findE == False: timeend = x[i] findE = True break t1 = abs(timeend - timestart) findS = False findE = False for i in range(size): T = max(T, y[i]) if y[i] >= 217 and findS == False: timestart = x[i] findS = True if y[i] <217 and findE == False and findS == True: timeend = x[i] findE = True break t2 = abs(timeend - timestart) return t1, t2, T
def poolsALL(tempreatures, rge1, carvs, tub): global Tempreatures # tub = [185, 205, 245, 265] t1 = tempreatures[0] t2 = tempreatures[1] t3 = tempreatures[2] t4 = tempreatures[3] for idx, carv in enumerate(carvs): for ti1 in range(t1, tub[0], rge1): for ti2 in range(t2, tub[1], rge1): for ti3 in range(t3, tub[2], rge1): for ti4 in range(t4, tub[3], rge1): temperatures = [ti1, ti2, ti3, ti4, 25] x, y = ek2.evaP1(temperatures, carv) t1, t2, T, p = getttT(x, y) if p2.checkT1T2T(t1, t2, T): if targetMinSquare(x, y, carv, p): Tempreatures = temperatures else: continue