test_numeric_system.py 文件源码

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

项目:simupy 作者: sixpearls 项目源码 文件源码
def test_output_equation_function_kwarg():
    with pytest.raises(ValueError, match=need_output_equation_function_msg):
        DynamicalSystem(dim_output=N)

    args = np.random.rand(N+1)

    sys = DynamicalSystem(dim_state=N,
                          state_equation_function=ones_equation_function)
    npt.assert_allclose(
        sys.output_equation_function(args[0], args[1:]),
        args[1:]
    )

    sys = DynamicalSystem(dim_state=1,
                          state_equation_function=ones_equation_function,
                          output_equation_function=ones_equation_function)
    npt.assert_allclose(
        sys.output_equation_function(args[0], args[1:]),
        np.ones(N)
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号