English 中文(简体)
在非线性系统中优先处理等
原标题:Prioritize equations in a nonlinear system

我试图用最小的平方法解决非线性低价竞标问题。 我取得了结果,但不幸的是,这并不十分准确。 主要问题是,第29至32段必须完全实现,但不是。 是否有办法将非线性系统中的方程式作为优先事项?

我的守则就是:

# Ethanol and 1_Propanol with 3 trays

from scipy.optimize import least_squares
import numpy as np


def equations(x):
    eq1 = x[18] - x[16] * x[19] * x[11] * (x[21] / (x[19] * x[11] * x[13])) ** (2.0 / 3.0)
    eq2 = x[19] - ((732.0 * x[10]) + (747.0 * x[9]))
    eq3 = x[13] - ((1.25E-5 * x[10]) + (1.6E-6 * x[9]))
    eq4 = x[2] - ((((((-6021.54) + (0.055134232180918 * (x[29] - 298.0))) + 2.61275786690816) * x[10])
                   + ((((-6883.827) + (0.058471271259418 * (x[29] - 298.0))) + 2.38446400137128) * x[9])))
    eq5 = x[11] - (((0.055134232180918 * (x[29])) + 2.61275786690816) * x[10] + ((0.058471271259418 * (x[29])) +
                                                                                 2.38446400137128) * x[9])
    eq6 = x[21] - ((((((0.001318 * (x[29])) + 0.16762) * x[10])
                     + (((-0.001075424413 * (x[29])) + 0.155701011727667) * x[9]))))
    eq7 = x[24] - (1.746 * x[22] + 2.76 * x[20])
    eq8 = x[15] - (1.0E-5 * x[22] + 6.5E-6 * x[20])
    eq9 = x[12] - ((((((((-6021.54) + (0.015220202121093 * (x[26] - 298.0))) + 1.60395800121061) + 922.194)
                      * x[22]) + ((((((-6883.827) + (0.01847750929725 * (x[26] - 298.0))) + 1.43843773750579)
                                    + 1067.523)) * x[20]))))
    eq10 = x[6] - ((((((((0.015220202121093 * (x[26])) + 1.60395800121061)
                        * x[22]) + (((0.01847750929725 * (x[26])) + 1.43843773750579)
                                    * x[20]))))))
    eq11 = x[5] - ((((((((5.07392141746E-4 * (x[29])) + 0.015070468544221)
                        * x[22]) + (((4.89248E-4 * (x[29])) + 0.014354384)
                                    * x[20]))))))
    eq12 = x[3] - (1.0 / (10.0 ** (5.24677 - 1598.673 / (x[28] + 46.424))))
    eq13 = x[0] - (1.0 / (10.0 ** (5.31384 - 1690.864 / (x[28] + 51.804))))
    eq14 = x[27] - (x[25] * x[24] * x[6] * ((x[5] / (x[24] * x[6] * x[15])) ** (2.0 / 3.0)))
    eq15 = 0.0 - ((2.0 * 28000.0) - (x[23] * x[2]) + (x[17] * 0.002))
    eq16 = 0.0 - ((0.2 * 30000.0) - (x[14] * x[12]) - (x[17] * 0.002))
    eq17 = 0.0 - ((2.0 * 0.5) - (x[23] * x[10]) + (x[8] * 0.002))
    eq18 = 0.0 - ((2.0 * 0.5) - (x[23] * x[9]) + (x[7] * 0.002))
    eq19 = 0.0 - ((0.2 * 0.6) - (x[14] * x[22]) - (x[8] * 0.002))
    eq20 = 0.0 - ((0.2 * 0.4) - (x[14] * x[20]) - (x[7] * 0.002))
    eq21 = 0.0 - (x[31] - (x[3] * x[4]))
    eq22 = 0.0 - (x[30] - (x[0] * x[1]))
    eq23 = x[17] - (x[18] * (x[28] - x[29]) + (x[8] * (((-6021.54 + (0.055134232180918 * (x[29] - 298.0))) +
                                                        2.61275786690816) + (x[7] * (
            (-6883.827 + (0.058471271259418 * (x[29] - 298.0))) + 2.38446400137128)))))
    eq24 = x[17] - (x[27] * (x[26] - x[28]) + (x[8] * ((((-6021.54 + (0.015220202121093 * (x[26] - 298.0))) +
                                                         1.60395800121061) + 922.194) + (x[7] * (
            ((-6883.827 + (0.01847750929725 * (x[26] - 298.0))) + 1.43843773750579) + 1067.523)))))
    eq25 = x[8] - (x[19] * x[16] * (x[4] - x[10]) + x[10] * (x[8] + x[7]))
    eq26 = x[7] - (x[19] * x[16] * (x[1] - x[9]) + x[9] * (x[8] + x[7]))
    eq27 = x[8] - (x[24] * x[25] * (x[22] - x[31]) + x[22] * (x[8] + x[7]))
    eq28 = x[7] - (x[24] * x[25] * (x[20] - x[30]) + x[20] * (x[8] + x[7]))
    eq29 = 1.0 - (x[10] + x[9])
    eq30 = 1.0 - (x[4] + x[1])
    eq31 = 1.0 - (x[22] + x[20])
    eq32 = 1.0 - (x[31] + x[30])

    return [eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12, eq13, eq14, eq15, eq16,
            eq17, eq18, eq19, eq20, eq21, eq22, eq23, eq24, eq25, eq26, eq27, eq28, eq29, eq30,
            eq31, eq32]


# Boundaries
# Upper bounds for specific variables
upper_bounds = np.ones(32) * np.inf
upper_bounds[1] = 1
upper_bounds[4] = 1
upper_bounds[9] = 1
upper_bounds[10] = 1
upper_bounds[20] = 1
upper_bounds[22] = 1
upper_bounds[30] = 1
upper_bounds[31] = 1

# Upper bounds for specific variables
bottom_bounds = np.zeros(32)
bottom_bounds[26] = 340
bottom_bounds[28] = 340
bottom_bounds[29] = 340

# Bounds array
bounds = (bottom_bounds, upper_bounds)
# bounds = (0, np.inf)


# Initial values
x0 = np.ones(32)
x0[1] = 0.5
x0[4] = 0.5
x0[9] = 0.5
x0[10] = 0.5
x0[20] = 0.5
x0[22] = 0.5
x0[30] = 0.5
x0[31] = 0.5

x0[26] = 370
x0[28] = 370
x0[29] = 370


# x0 = np.array([1, 1e-4, 1, 1, 1, 1, 1e-4, 1, 1, 1, 1, 1, 1, 1, 1, 1])


# Lösung des Gleichungssystems mit Variablengrenzen
res = least_squares(equations, x0, bounds=bounds, method= trf , ftol=1e-10, xtol=1e-10, gtol=1e-10)

print(res.x)
print( e0_K_tr1_c2 {0} .format(res.x[0]))
print( e0_x_Lint_tr1_c2 {0} .format(res.x[1]))
print( e0_h_L_tr1 {0} .format(res.x[2]))
print( e0_K_tr1_c1 {0} .format(res.x[3]))
print( e0_x_Lint_tr1_c1 {0} .format(res.x[4]))
print( e0_greek_lambda_V_tr1 {0} .format(res.x[5]))
print( e0_cp_V_tr1 {0} .format(res.x[6]))
print( e0_f_int_tr1_c2 {0} .format(res.x[7]))
print( e0_f_int_tr1_c1 {0} .format(res.x[8]))
print( e0_x_L_tr1_c2 {0} .format(res.x[9]))
print( e0_x_L_tr1_c1 {0} .format(res.x[10]))
print( e0_cp_L_tr1 {0} .format(res.x[11]))
print( e0_h_V_tr1 {0} .format(res.x[12]))
print( e0_D_L_tr1 {0} .format(res.x[13]))
print( e0_F_V_tr1 {0} .format(res.x[14]))
print( e0_D_V_tr1 {0} .format(res.x[15]))
print( e0_greek_beta_L_tr1 {0} .format(res.x[16]))
print( e0_e_int_tr1 {0} .format(res.x[17]))
print( e0_greek_alpha_L_tr1 {0} .format(res.x[18]))
print( e0_greek_rho_L_tr1 {0} .format(res.x[19]))
print( e0_x_V_tr1_c2 {0} .format(res.x[20]))
print( e0_greek_lambda_L_tr1 {0} .format(res.x[21]))
print( e0_x_V_tr1_c1 {0} .format(res.x[22]))
print( e0_F_L_tr1 {0} .format(res.x[23]))
print( e0_greek_rho_V_tr1 {0} .format(res.x[24]))
print( e0_greek_beta_V_tr1 {0} .format(res.x[25]))
print( e0_T_V_tr1 {0} .format(res.x[26]))
print( e0_greek_alpha_V_tr1 {0} .format(res.x[27]))
print( e0_T_int_tr1 {0} .format(res.x[28]))
print( e0_T_L_tr1 {0} .format(res.x[29]))
print( e0_x_Vint_tr1_c2 {0} .format(res.x[30]))
print( e0_x_Vint_tr1_c1 {0} .format(res.x[31]))

print( Zusammensetztungen: )

print( e0_x_Vint_tr1_c1 {0} .format(res.x[31]))
print( e0_x_Vint_tr1_c2 {0} .format(res.x[30]))

print( e0_x_V_tr1_c1 {0} .format(res.x[22]))
print( e0_x_V_tr1_c2 {0} .format(res.x[20]))

print( e0_x_Lint_tr1_c1 {0} .format(res.x[4]))
print( e0_x_Lint_tr1_c2 {0} .format(res.x[1]))

print( e0_x_L_tr1_c1 {0} .format(res.x[10]))
print( e0_x_L_tr1_c2 {0} .format(res.x[9]))

www.un.org/chinese/ga/president

Zusammensetztungen:
e0_x_Vint_tr1_c1 0.5189962572539993
e0_x_Vint_tr1_c2 0.24082903753005624
e0_x_V_tr1_c1 2.3066615630447933e-32
e0_x_V_tr1_c2 1.246796204196686e-33
e0_x_Lint_tr1_c1 0.9999999999999999
e0_x_Lint_tr1_c2 0.01258253962013115
e0_x_L_tr1_c1 7.013309435002394e-33
e0_x_L_tr1_c2 3.0913699644636455e-33

e0_x_Vint_tr1_c1 + e0_x_Vint_tr1_c 应当是1,但不是。

问题回答

取消你的多余的父母,并改革你的平衡,以便他们更容易被人 de。

Replace your indexed variables with named variables. I show a quick way to do this via NamedTuple.

见<代码>lm。 当我管理时,它声称找到了比<代码>trf低10倍(30.7)的解决办法(399)。 解决办法还不是od,res.fun[16][17]有差错5;但没有任何魔弹可改进。 有必要了解该领域的问题。 如果与他人相比,某种解决办法的“事项更多”,那么你就可以简单地按其权重来扩大这些公式。

添加回归测试。 就我所显示的结果而言,这些公式相当于你原来的公式。

途径核对<代码>。

"""Ethanol and 1_Propanol with 3 trays"""

from pprint import pprint
from typing import NamedTuple

from numpy.random import default_rng
from scipy.optimize import least_squares
import numpy as np


class Vars(NamedTuple):
    e0_K_tr1_c2: float            # 0
    e0_x_Lint_tr1_c2: float       # 1
    e0_h_L_tr1: float             # 2
    e0_K_tr1_c1: float            # 3
    e0_x_Lint_tr1_c1: float       # 4
    e0_lambda_V_tr1: float        # 5
    e0_cp_V_tr1: float            # 6
    e0_f_int_tr1_c2: float        # 7
    e0_f_int_tr1_c1: float        # 8
    e0_x_L_tr1_c2: float          # 9
    e0_x_L_tr1_c1: float          # 10
    e0_cp_L_tr1: float            # 11
    e0_h_V_tr1: float             # 12
    e0_D_L_tr1: float             # 13
    e0_F_V_tr1: float             # 14
    e0_D_V_tr1: float             # 15
    e0_beta_L_tr1: float          # 16
    e0_e_int_tr1: float           # 17
    e0_alpha_L_tr1: float         # 18
    e0_rho_L_tr1: float           # 19
    e0_x_V_tr1_c2: float          # 20
    e0_lambda_L_tr1: float        # 21
    e0_x_V_tr1_c1: float          # 22
    e0_F_L_tr1: float             # 23
    e0_rho_V_tr1: float           # 24
    e0_beta_V_tr1: float          # 25
    e0_T_V_tr1: float             # 26
    e0_alpha_V_tr1: float         # 27
    e0_T_int_tr1: float           # 28
    e0_T_L_tr1: float             # 29
    e0_x_Vint_tr1_c2: float       # 30
    e0_x_Vint_tr1_c1: float       # 31


def equations(x: np.ndarray) -> tuple[float, ...]:
    v = Vars(*x)

    eq1 = v.e0_alpha_L_tr1 - v.e0_beta_L_tr1 * v.e0_rho_L_tr1 * v.e0_cp_L_tr1 * (
        v.e0_lambda_L_tr1 / (v.e0_rho_L_tr1 * v.e0_cp_L_tr1 * v.e0_D_L_tr1)
    ) ** (2 / 3)

    eq2 = v.e0_rho_L_tr1 - (732 * v.e0_x_L_tr1_c1 + 747 * v.e0_x_L_tr1_c2)
    eq3 = v.e0_D_L_tr1 - (1.25E-5 * v.e0_x_L_tr1_c1 + 1.6E-6 * v.e0_x_L_tr1_c2)

    eq4 = v.e0_h_L_tr1 - (
        (
            -6021.54
            + 0.055134232180918 * (v.e0_T_L_tr1 - 298)
            + 2.61275786690816
        ) * v.e0_x_L_tr1_c1
        + (
            -6883.827
            + 0.058471271259418 * (v.e0_T_L_tr1 - 298)
            + 2.38446400137128
        ) * v.e0_x_L_tr1_c2
    )

    eq5 = v.e0_cp_L_tr1 - (
        (
            0.055134232180918 * v.e0_T_L_tr1 + 2.61275786690816
        ) * v.e0_x_L_tr1_c1
        + (
            0.058471271259418 * v.e0_T_L_tr1 + 2.38446400137128
        ) * v.e0_x_L_tr1_c2
    )
    eq6 = v.e0_lambda_L_tr1 - (
        (
            0.001318 * v.e0_T_L_tr1 + 0.16762
        ) * v.e0_x_L_tr1_c1
        + (
            -0.001075424413 * v.e0_T_L_tr1 + 0.155701011727667
        ) * v.e0_x_L_tr1_c2
    )

    eq7 = v.e0_rho_V_tr1 - (1.746 * v.e0_x_V_tr1_c1 + 2.76 * v.e0_x_V_tr1_c2)
    eq8 = v.e0_D_V_tr1 - (1E-5 * v.e0_x_V_tr1_c1 + 6.5E-6 * v.e0_x_V_tr1_c2)

    eq9 = v.e0_h_V_tr1 - (
        (
            -6021.54
            + 0.015220202121093 * (v.e0_T_V_tr1 - 298)
            + 1.60395800121061
            + 922.194
        ) * v.e0_x_V_tr1_c1
        + (
            -6883.827
            + 0.01847750929725 * (v.e0_T_V_tr1 - 298)
            + 1.43843773750579
            + 1067.523
        ) * v.e0_x_V_tr1_c2
    )
    eq10 = v.e0_cp_V_tr1 - (
        (
            0.015220202121093 * v.e0_T_V_tr1 + 1.60395800121061
        ) * v.e0_x_V_tr1_c1
        + (
            0.01847750929725 * v.e0_T_V_tr1 + 1.43843773750579
        ) * v.e0_x_V_tr1_c2
    )
    eq11 = v.e0_lambda_V_tr1 - (
        (
            5.07392141746E-4 * v.e0_T_L_tr1 + 0.015070468544221
        ) * v.e0_x_V_tr1_c1
        + (
            4.89248E-4 * v.e0_T_L_tr1 + 0.014354384
        ) * v.e0_x_V_tr1_c2
    )

    eq12 = v.e0_K_tr1_c1 - 1 / 10**(5.24677 - 1598.673 / (v.e0_T_int_tr1 + 46.424))
    eq13 = v.e0_K_tr1_c2 - 1 / 10**(5.31384 - 1690.864 / (v.e0_T_int_tr1 + 51.804))

    eq14 = v.e0_alpha_V_tr1 - (
        v.e0_beta_V_tr1 * v.e0_rho_V_tr1 * v.e0_cp_V_tr1 * (
            v.e0_lambda_V_tr1 / (
                v.e0_rho_V_tr1 * v.e0_cp_V_tr1 * v.e0_D_V_tr1
            )
        ) ** (2 / 3)
    )

    eq15 = -(2 * 28000 - v.e0_F_L_tr1 * v.e0_h_L_tr1 + v.e0_e_int_tr1 * 0.002)
    eq16 = -(0.2 * 30000 - v.e0_F_V_tr1 * v.e0_h_V_tr1 - v.e0_e_int_tr1 * 0.002)
    eq17 = -(2 * 0.5 - v.e0_F_L_tr1 * v.e0_x_L_tr1_c1 + v.e0_f_int_tr1_c1 * 0.002)
    eq18 = -(2 * 0.5 - v.e0_F_L_tr1 * v.e0_x_L_tr1_c2 + v.e0_f_int_tr1_c2 * 0.002)
    eq19 = -(0.2 * 0.6 - v.e0_F_V_tr1 * v.e0_x_V_tr1_c1 - v.e0_f_int_tr1_c1 * 0.002)
    eq20 = -(0.2 * 0.4 - v.e0_F_V_tr1 * v.e0_x_V_tr1_c2 - v.e0_f_int_tr1_c2 * 0.002)

    eq21 = -(v.e0_x_Vint_tr1_c1 - v.e0_K_tr1_c1 * v.e0_x_Lint_tr1_c1)
    eq22 = -(v.e0_x_Vint_tr1_c2 - v.e0_K_tr1_c2 * v.e0_x_Lint_tr1_c2)

    eq23 = v.e0_e_int_tr1 - (
        v.e0_alpha_L_tr1 * (v.e0_T_int_tr1 - v.e0_T_L_tr1)
        + v.e0_f_int_tr1_c1 * (
            -6021.54
            + 0.055134232180918 * (v.e0_T_L_tr1 - 298)
            + 2.61275786690816
            # really?
        # )
            + v.e0_f_int_tr1_c2 * (
                -6883.827 +
                0.058471271259418 * (v.e0_T_L_tr1 - 298)
                + 2.38446400137128
            )
        )
    )

    eq24 = v.e0_e_int_tr1 - (
        v.e0_alpha_V_tr1 * (v.e0_T_V_tr1 - v.e0_T_int_tr1)
        + v.e0_f_int_tr1_c1 * (
            -6021.54
            + 0.015220202121093 * (v.e0_T_V_tr1 - 298)
            + 1.60395800121061
            + 922.194
            # really?
        # )
            + v.e0_f_int_tr1_c2 * (
                -6883.827
                + 0.01847750929725 * (v.e0_T_V_tr1 - 298)
                + 1.43843773750579
                + 1067.523
            )
        )
    )

    eq25 = v.e0_f_int_tr1_c1 - (
        v.e0_rho_L_tr1 * v.e0_beta_L_tr1 * (
            v.e0_x_Lint_tr1_c1 - v.e0_x_L_tr1_c1
        )
        + v.e0_x_L_tr1_c1 * (v.e0_f_int_tr1_c1 + v.e0_f_int_tr1_c2)
    )
    eq26 = v.e0_f_int_tr1_c2 - (
        v.e0_rho_L_tr1 * v.e0_beta_L_tr1 * (
            v.e0_x_Lint_tr1_c2 - v.e0_x_L_tr1_c2
        )
        + v.e0_x_L_tr1_c2 * (v.e0_f_int_tr1_c1 + v.e0_f_int_tr1_c2)
    )
    eq27 = v.e0_f_int_tr1_c1 - (
        v.e0_rho_V_tr1 * v.e0_beta_V_tr1 * (
            v.e0_x_V_tr1_c1 - v.e0_x_Vint_tr1_c1
        )
        + v.e0_x_V_tr1_c1 * (v.e0_f_int_tr1_c1 + v.e0_f_int_tr1_c2)
    )
    eq28 = v.e0_f_int_tr1_c2 - (
        v.e0_rho_V_tr1 * v.e0_beta_V_tr1 * (
            v.e0_x_V_tr1_c2 - v.e0_x_Vint_tr1_c2
        )
        + v.e0_x_V_tr1_c2 * (v.e0_f_int_tr1_c1 + v.e0_f_int_tr1_c2)
    )

    eq29 = 1 - (v.e0_x_L_tr1_c1 + v.e0_x_L_tr1_c2)
    eq30 = 1 - (v.e0_x_Lint_tr1_c1 + v.e0_x_Lint_tr1_c2)
    eq31 = 1 - (v.e0_x_V_tr1_c1 + v.e0_x_V_tr1_c2)
    eq32 = 1 - (v.e0_x_Vint_tr1_c1 + v.e0_x_Vint_tr1_c2)

    return (eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10,
            eq11, eq12, eq13, eq14, eq15, eq16, eq17, eq18, eq19, eq20,
            eq21, eq22, eq23, eq24, eq25, eq26, eq27, eq28, eq29, eq30,
            eq31, eq32)


def regression_test(x0: np.ndarray) -> None:
    y = equations(x0)
    assert np.allclose(
        y,
        [ 0.00000000e+00, -7.38500000e+02,  9.99992950e-01,  6.44709509e+03,
         -2.25156291e+01,  7.93463011e-01, -1.25300000e+00,  9.99991750e-01,
          5.45609068e+03, -6.75527448e+00,  8.00909148e-01,  9.60890608e-01,
          9.50476815e-01,  0.00000000e+00, -5.59990020e+04, -5.99899800e+03,
         -5.02000000e-01, -5.02000000e-01,  3.82000000e-01,  4.22000000e-01,
          0.00000000e+00,  0.00000000e+00,  1.28931902e+04,  1.09111814e+04,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          ],
        rtol=0, atol=1e-4,
    )

    rand = default_rng(seed=0)
    x = rand.uniform(low=0, high=2, size=32)
    y = equations(x)
    assert np.allclose(
        y,
        [-8.89664807e-02, -2.59056243e+03,  6.71477620e-02,  2.27496385e+04,
         -8.97636119e+00, -3.16304973e-01, -1.26737482e+00,  3.51297461e-01,
          7.17475798e+03, -1.06230892e+00,  1.80356351e+00, -1.59115277e+28,
         -3.04937193e+26, -6.69625188e-01, -5.59998961e+04, -5.99749540e+03,
          1.10987295e+00,  1.41775827e+00,  1.83947353e+00,  5.57239541e-03,
         -7.24077112e-01, -6.89518259e-01,  1.75063897e+04,  1.47800191e+04,
         -3.05993271e+00, -1.36098936e+00, -2.85999752e+00,  2.56167351e+00,
         -2.50185196e+00, -1.16611391e+00, -3.97888172e-01, -1.15473631e+00,
         ],
        rtol=1e-8, atol=0,
    )


def make_x0() -> np.ndarray:
    # Initial values
    x0 = np.ones(32)
    x0[1] = 0.5
    x0[4] = 0.5
    x0[9] = 0.5
    x0[10] = 0.5
    x0[20] = 0.5
    x0[22] = 0.5
    x0[30] = 0.5
    x0[31] = 0.5

    x0[26] = 370
    x0[28] = 370
    x0[29] = 370

    return x0


def solve(x0: np.ndarray) -> Vars:
    # Boundaries
    # Upper bounds for specific variables
    upper_bounds = np.ones(32) * np.inf
    upper_bounds[1] = 1
    upper_bounds[4] = 1
    upper_bounds[9] = 1
    upper_bounds[10] = 1
    upper_bounds[20] = 1
    upper_bounds[22] = 1
    upper_bounds[30] = 1
    upper_bounds[31] = 1

    # Upper bounds for specific variables
    bottom_bounds = np.zeros(32)
    bottom_bounds[26] = 340
    bottom_bounds[28] = 340
    bottom_bounds[29] = 340

    # Lösung des Gleichungssystems mit Variablengrenzen
    res = least_squares(
        fun=equations, x0=x0,
        # bounds=(bottom_bounds, upper_bounds),  # not supported in lm
        method= lm ,
        ftol=1e-10, xtol=1e-10, gtol=1e-10,
    )
    assert res.success
    return Vars(*res.x)


def dump(x: Vars) -> None:
    pprint(x._asdict())


def main() -> None:
    x0 = make_x0()
    regression_test(x0)
    x = solve(x0)
    dump(x)


if __name__ ==  __main__ :
    main()
{ e0_D_L_tr1 : -3.153455326530358e-05,
  e0_D_V_tr1 : -1.1587439723602964e-07,
  e0_F_L_tr1 : 238.54480306733882,
  e0_F_V_tr1 : 77.47446571613764,
  e0_K_tr1_c1 : 0.037073038396163216,
  e0_K_tr1_c2 : 0.0415066264116303,
  e0_T_L_tr1 : 370.01620238146296,
  e0_T_V_tr1 : 370.08840660312256,
  e0_T_int_tr1 : 369.87307769775657,
  e0_alpha_L_tr1 : 0.7873519340882127,
  e0_alpha_V_tr1 : 0.9907642433831764,
  e0_beta_L_tr1 : 6.32097377867498,
  e0_beta_V_tr1 : 3.1237618757158137,
  e0_cp_L_tr1 : -0.8524632541977617,
  e0_cp_V_tr1 : 1.4589746647295014e-10,
  e0_e_int_tr1 : 0.9000991615287355,
  e0_f_int_tr1_c1 : 0.013961863763987132,
  e0_f_int_tr1_c2 : -0.8851432427665892,
  e0_h_L_tr1 : 234.7567427792555,
  e0_h_V_tr1 : 77.44484615094777,
  e0_lambda_L_tr1 : -2.9017291589262634e-07,
  e0_lambda_V_tr1 : -0.002879488763847938,
  e0_rho_L_tr1 : -26.78220344133098,
  e0_rho_V_tr1 : 0.3540599834963324,
  e0_x_L_tr1_c1 : -0.016596667401249928,
  e0_x_L_tr1_c2 : -0.019590931353320663,
  e0_x_Lint_tr1_c1 : -0.01655760209280515,
  e0_x_Lint_tr1_c2 : -0.014224743726371676,
  e0_x_V_tr1_c1 : -0.006255058443665765,
  e0_x_V_tr1_c2 : -0.007836086147376716,
  e0_x_Vint_tr1_c1 : 0.12728635010584385,
  e0_x_Vint_tr1_c2 : 0.57358225613658}




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签