mrdmd.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:PyDMD 作者: mathLab 项目源码 文件源码
def partial_dynamics(self, level, node=None):
        """
        Return the time evolution of the specific `level` and of the specific
        `node`; if `node` is not specified, the method returns the time evolution
        of the given `level` (all the nodes).

        :param int level: the index of the level from where the time evolution
            is extracted.
        :param int node: the index of the node from where the time evolution is
            extracted; if None, the time evolution is extracted from all the
            nodes of the given level. Default is None.
        """

        def dynamic(eigs, amplitudes, step, nsamples):
            omega = old_div(
                np.log(np.power(eigs, old_div(1., step))),
                self.original_time['dt']
            )
            partial_timestep = np.arange(nsamples) * self.dmd_time['dt']
            vander = np.exp(np.multiply(*np.meshgrid(omega, partial_timestep)))
            return (vander * amplitudes).T

        if node:
            indeces = [self._index_list(level, node)]
        else:
            indeces = [self._index_list(level, i) for i in range(2**level)]

        level_dynamics = [
            dynamic(
                self._eigs[idx], self._b[idx], self._steps[idx],
                self._nsamples[idx]
            ) for idx in indeces
        ]
        return scipy.linalg.block_diag(*level_dynamics)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号