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)
)
评论列表
文章目录