Example #1
0
    def v2p(self, func_of_t_v: numpy.ndarray) -> numpy.ndarray:
        '''The conversion function from :math:`(T, V)` to :math:`(T, P)` grid

        .. math::
            f(T, V) \\rightarrow f(T, P)

        :param func_of_t_v: the input function :math:`f(T, V)` under the :math:`(T, V)` grid
        :returns: the output function :math:`f(T, P)` under the :math:`(T, P)` grid
        '''
        return v2p(func_of_t_v,
                   self.calculator.qha_calculator.volume_base.pressures,
                   self.p_array)
Example #2
0
def volume(vs: Vector, desired_ps: Vector, ps: Matrix) -> Matrix:
    """
    Convert the volumes as a function of temperature and pressure, i.e., on a :math:`(T, P)` grid.

    :param vs: A vector of volumes.
    :param desired_ps: A vector of desired pressures.
    :param ps: A matrix, the pressure as a function of temperature and volume, i.e., :math:`P(T,V)`, in atomic unit.
    :return: A matrix, the volume as a function of temperature and pressure, i.e., :math:`V(T, P)`.
    """
    nt, ntv = ps.shape
    vs = vs.reshape(1, -1).repeat(nt, axis=0)
    return v2p(vs, ps, desired_ps)
Example #3
0
 def cv_tp_au(self):
     return v2p(self.cv_tv_au, self.p_tv_au, self.desired_pressures)
Example #4
0
 def g_tp_ry(self):
     return v2p(self.g_tv_ry, self.p_tv_au, self.desired_pressures)
Example #5
0
 def v2p1d(x_old: numpy.array, p_old: numpy.array, p_new: numpy.array):
     from numpy import newaxis as nax
     return v2p(x_old[nax, ::-1], p_old[nax, ::-1], p_new)[0]