discontinuities.py 文件源码

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

项目:simupy 作者: sixpearls 项目源码 文件源码
def event_variable_equation(self, event_variable_equation):
        assert event_variable_equation.atoms(sp.Symbol) <= set(
            self.constants_values.keys()) | set([dynamicsymbols._t])
        self._event_variable_equation = event_variable_equation
        if self.dim_state:
            assert find_dynamicsymbols(event_variable_equation) <= \
                set(self.state)
            self.event_variable_equation_function = self.code_generator(
                [dynamicsymbols._t] + sp.flatten(self.state),
                self._event_variable_equation.subs(self.constants_values),
                **self.code_generator_args
            )
        else:
            assert find_dynamicsymbols(event_variable_equation) <= \
                set(self.input)
            self.event_variable_equation_function = self.code_generator(
                [dynamicsymbols._t] + sp.flatten(self.input),
                self._event_variable_equation.subs(self.constants_values),
                **self.code_generator_args
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号