Пример #1
0
    def solve_maxwell(i, s, p, tol=1e-7):
        # Set state 's' = to data point in 'p'
        s["P"], s["T"] = p["P"][i], p["T"][i]
        s = VdW.a_T(s, p)  # Solve 'a' for current temperature.
        er = 1  # Defines initial error
        while er > tol:
            a_old = s["a"]  # Used to track iteration error
            s = VdW.V_root(s, p)  # Solve 'V_l' 'V_v' state
            s = VdW.a_maxwell(s, p)  # Solve 'a' explicitly
            er = abs(s["a"] - a_old)

        m = VdW.a_m_sol(s, p)  # Update 'm'
        p["m"] = m
        return s["a"], p["m"]  # s, p
Пример #2
0
    def solve_maxwell(i, s, p, tol=1e-7):
        # Set state 's' = to data point in 'p'
        s['P'], s['T'] = p['P'][i], p['T'][i]
        s = VdW.a_T(s, p)  # Solve 'a' for current temperature.
        er = 1  # Defines initial error
        while er > tol:
            a_old = s['a']  # Used to track iteration error
            s = VdW.V_root(s, p)  # Solve 'V_l' 'V_v' state
            s = VdW.a_maxwell(s, p)  # Solve 'a' explicitly
            er = abs(s['a'] - a_old)

        m = VdW.a_m_sol(s, p)  # Update 'm'
        p['m'] = m
        return s['a'], p['m']  #s, p
Пример #3
0
 def residuals(m, a, T):  # (Parameter(s), Output Data, Input Data) # p['T']
     p["m"] = m
     s["T"] = T
     return a - VdW.a_T(s, p)["a"]  # Error function to correlate m with T
Пример #4
0
 def residuals(m, a, T):  # (Parameter(s), Output Data, Input Data) # p['T']
     p['m'] = m
     s['T'] = T
     return a - VdW.a_T(s, p)['a']  # Error function to correlate m with T