def test_dmatrix_2dim(self): dmatrix = ci.dmatrix(self.dim1, self.dim2) self.assertEqual(dmatrix.shape, (self.dim1, self.dim2))
def test_zero_states(self): nx = 0 xdata_ref = ci.dmatrix(0, 0) # In this case, the input value is not used by the function, and # therefor irrelevant at this point xdata = inputchecks.check_states_data(None, nx, self.number_of_intervals) assert_array_equal(xdata, xdata_ref)
def test_zero_controls(self): # In this case, the input value is not used by the function, and # therefor irrelevant at this point nq = 0 qdata_ref = ci.dmatrix(0, 1) qdata = inputchecks.check_constant_controls_data(None, nq) assert_array_equal(qdata, qdata_ref)
def test_zero_controls(self): # In this case, the input value is not used by the function, and # therefor irrelevant at this point nu = 0 udata_ref = ci.dmatrix(0, self.number_of_controls) udata = inputchecks.check_controls_data(None, nu, self.number_of_controls) assert_array_equal(udata, udata_ref)
def test_zero_equation_errors(self): neps_u = 0 weps_u_ref = ci.dmatrix(0, 0) # In this case, the input value is not used by the function, and # therefor irrelevant at this point weps_u = inputchecks.check_input_error_weightings(None, neps_u, self.number_of_intervals) assert_array_equal(weps_u, weps_u_ref)
def test_zero_states(self): nx = 0 xdata_ref = ci.dmatrix(0, 0) # In this case, the input value is not used by the function, and # therefor irrelevant at this point xdata = inputchecks.check_states_data(None, nx, \ self.number_of_intervals) assert_array_equal(xdata, xdata_ref)
def test_zero_controls(self): # In this case, the input value is not used by the function, and # therefor irrelevant at this point nu = 0 udata_ref = ci.dmatrix(0, self.number_of_controls) udata = inputchecks.check_controls_data(None, \ nu, self.number_of_controls) assert_array_equal(udata, udata_ref)
def test_zero_equation_errors(self): neps_u = 0 weps_u_ref = ci.dmatrix(0, 0) # In this case, the input value is not used by the function, and # therefor irrelevant at this point weps_u = inputchecks.check_input_error_weightings(None, \ neps_u, self.number_of_intervals) assert_array_equal(weps_u, weps_u_ref)
def test_dmatrix_1dim(self): dmatrix = ci.dmatrix(self.dim1) self.assertEqual(dmatrix.shape, (self.dim1, 1))