def test_event_equation_function(switch_fixture):
sys = SwitchedSystem(
dim_output=1,
event_variable_equation_function=event_variable_equation_function,
event_bounds=switch_fixture[0],
state_equations_functions=switch_fixture[1],
output_equations_functions=switch_fixture[2],
)
assert sys.state_update_equation_function == full_state_output
for x in np.linspace(bounds_min, bounds_max):
if not np.any(np.isclose(x, switch_fixture[0])):
assert ~np.any(np.isclose(
sys.event_equation_function(x, x),
0
))
for zero in switch_fixture[0]:
npt.assert_allclose(
sys.event_equation_function(len(switch_fixture[0]), zero),
0
)
评论列表
文章目录