diff --git a/nosnoc/model.py b/nosnoc/model.py index 0709984..dd8ba82 100644 --- a/nosnoc/model.py +++ b/nosnoc/model.py @@ -322,8 +322,8 @@ def preprocess_model(self, opts: NosnocOpts): self.std_compl_res_fun = ca.Function('std_compl_res_fun', [z, self.p], [std_compl_res]) if opts.pss_mode == PssMode.STEWART: mu00_stewart = casadi_vertcat_list([ca.mmin(g_Stewart_list[ii]) for ii in range(n_sys)]) - self.mu00_stewart_fun = ca.Function('mu00_stewart_fun', [self.x, self.p], [mu00_stewart]) - self.g_Stewart_fun = ca.Function('g_Stewart_fun', [self.x, self.p], [g_Stewart]) + self.mu00_stewart_fun = ca.Function('mu00_stewart_fun', [self.x, self.z, self.p], [mu00_stewart]) + self.g_Stewart_fun = ca.Function('g_Stewart_fun', [self.x, self.z, self.p], [g_Stewart]) def create_stage_vars(self, opts: NosnocOpts): """ diff --git a/nosnoc/solver.py b/nosnoc/solver.py index 23f97a9..d8f8884 100644 --- a/nosnoc/solver.py +++ b/nosnoc/solver.py @@ -285,8 +285,8 @@ def create_function_calculate_vector_field(self, sigma, p=[], v=[]): ca.sum1(theta)-1 ) )) - def fun(x, u): - g = self.model.g_Stewart_fun(x, p) + def fun(x, u, z=[0]): + g = self.model.g_Stewart_fun(x, z, p) theta = theta_fun(0, g)[:-1] F = self.model.F_fun(x, u, p, v) return np.dot(F, theta) diff --git a/test/test_simple_car_algebraics.py b/test/test_simple_car_algebraics.py new file mode 100644 index 0000000..56c3d15 --- /dev/null +++ b/test/test_simple_car_algebraics.py @@ -0,0 +1,12 @@ +import unittest +from examples.simple_car_algebraics.simple_car_algebraic import solve_ocp + + +class TestSimpleCarAlgebraics(unittest.TestCase): + + def test_simple_solving(self): + solve_ocp() + + +if __name__ == "__main__": + unittest.main()