diff --git a/opty/direct_collocation.py b/opty/direct_collocation.py index db6607c..316c119 100644 --- a/opty/direct_collocation.py +++ b/opty/direct_collocation.py @@ -745,6 +745,7 @@ def __init__(self, equations_of_motion, state_symbols, self._generate_timeshift_constraints() self._precalc_timshift_input_derivatives() self.num_instance_constraints = len(self.instance_constraints) + self.num_constraints += self.num_instance_constraints self._identify_functions_in_instance_constraints() self._find_closest_free_index() self.eval_instance_constraints = self._instance_constraints_func() @@ -1957,6 +1958,9 @@ def constraints(free): eom_con_vals = func(free_states, all_specified, all_constants, time_interval) + if all_specified.shape[0] == 1: + all_specified.squeeze() + if self.instance_constraints is not None: if typ == 'con': ins_con_vals = self.eval_instance_constraints(free)