コード例 #1
0
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)
コード例 #2
0
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)
コード例 #3
0
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)
コード例 #4
0
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