Skip to content

Commit

Permalink
docstrings changed for solve to match opty
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter230655 committed Jan 19, 2025
1 parent 44b5d8d commit fa77376
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions opty/direct_collocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,65 @@ def __init__(self, obj, obj_grad, equations_of_motion, state_symbols,

self.obj_value = []

# this is added only to correct the docstring, which is a bit different with
# opty compared to cyipopt.
def solve(self, free):
"""
**solve**(x)
Returns the optimal solution and an info dictionary.
Solves the posed optimization problem starting at point x.
Parameters:
x (array-like, shape(n*N + q*N + r + s, ))
Initial guess.
Returns:
x (array, shape(n*N + q*N + r + s, ))
optimal solution.
info (dictionary)
x: ndarray, shape(n*N + q*N + r + s, )
optimal solution
g: ndarray, shape(n*(N-1) + o, )
constraints at the optimal solution
obj_val: float
objective value at optimal solution
mult_g: ndarray, shape(n*(N-1) + o, )
final values of the constraint multipliers
mult_x_L: ndarray, shape(n*N + q*N + r + s, )
bound multipliers at the solution
mult_x_U: ndarray, shape(n*N + q*N + r + s, )
bound multipliers at the solution
status: integer
gives the status of the algorithm
status_msg: string
gives the status of the algorithm as a message
"""
return super().solve(free)

def _generate_bound_arrays(self):
lb = -self.INF * np.ones(self.num_free)
ub = self.INF * np.ones(self.num_free)
Expand Down

0 comments on commit fa77376

Please sign in to comment.