@@ -1711,28 +1711,6 @@ def test_interconnect_unused_output():
17111711 outputs = ['y' ],
17121712 ignore_outputs = ['v' ])
17131713
1714- def test_nonuniform_timepts ():
1715- """Test non-uniform time points for simulations"""
1716- sys = ct .LinearIOSystem (ct .rss (2 , 1 , 1 ))
1717-
1718- # Start with a uniform set of times
1719- unifpts = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
1720- uniform = [1 , 2 , 3 , 2 , 1 , - 1 , - 3 , - 5 , - 7 , - 3 , 1 ]
1721- t_unif , y_unif = ct .input_output_response (sys , unifpts , uniform )
1722-
1723- # Create a non-uniform set of inputs
1724- noufpts = [0 , 2 , 4 , 8 , 10 ]
1725- nonunif = [1 , 3 , 1 , - 7 , 1 ]
1726- t_nouf , y_nouf = ct .input_output_response (sys , noufpts , nonunif )
1727-
1728- # Make sure the outputs agree at common times
1729- np .testing .assert_almost_equal (y_unif [noufpts ], y_nouf , decimal = 6 )
1730-
1731- # Resimulate using a new set of evaluation points
1732- t_even , y_even = ct .input_output_response (
1733- sys , noufpts , nonunif , t_eval = unifpts )
1734- np .testing .assert_almost_equal (y_unif , y_even , decimal = 6 )
1735-
17361714def test_input_output_broadcasting ():
17371715 # Create a system, time vector, and noisy input
17381716 sys = ct .rss (6 , 2 , 3 )
@@ -1773,3 +1751,25 @@ def test_input_output_broadcasting():
17731751 with pytest .raises (ValueError , match = "inconsistent" ):
17741752 resp_bad = ct .input_output_response (
17751753 sys , T , (U [0 , :], U [:2 , :- 1 ]), [X0 , P0 ])
1754+
1755+ def test_nonuniform_timepts ():
1756+ """Test non-uniform time points for simulations"""
1757+ sys = ct .LinearIOSystem (ct .rss (2 , 1 , 1 ))
1758+
1759+ # Start with a uniform set of times
1760+ unifpts = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
1761+ uniform = [1 , 2 , 3 , 2 , 1 , - 1 , - 3 , - 5 , - 7 , - 3 , 1 ]
1762+ t_unif , y_unif = ct .input_output_response (sys , unifpts , uniform )
1763+
1764+ # Create a non-uniform set of inputs
1765+ noufpts = [0 , 2 , 4 , 8 , 10 ]
1766+ nonunif = [1 , 3 , 1 , - 7 , 1 ]
1767+ t_nouf , y_nouf = ct .input_output_response (sys , noufpts , nonunif )
1768+
1769+ # Make sure the outputs agree at common times
1770+ np .testing .assert_almost_equal (y_unif [noufpts ], y_nouf , decimal = 6 )
1771+
1772+ # Resimulate using a new set of evaluation points
1773+ t_even , y_even = ct .input_output_response (
1774+ sys , noufpts , nonunif , t_eval = unifpts )
1775+ np .testing .assert_almost_equal (y_unif , y_even , decimal = 6 )
0 commit comments