Skip to content

Commit

Permalink
copied from cyipopt code and only changed a few things relevant for opty
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter230655 committed Jan 19, 2025
1 parent c92117c commit 790d9c0
Showing 1 changed file with 33 additions and 46 deletions.
79 changes: 33 additions & 46 deletions opty/direct_collocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,59 +200,46 @@ def __init__(self, obj, obj_grad, equations_of_motion, state_symbols,
# 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.
"""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
Parameters
----------
x : array-like, shape(n*N + q*N + r + s, )
Initial guess.
status: integer
lagrange : array-like, shape(n*(N-1) + o, ), optional (default=[])
Initial values for the constraint multipliers (only if warm start option is chosen).
gives the status of the algorithm
zl : array-like, shape(n*N + q*N + r + s, ), optional (default=[])
Initial values for the multipliers for lower variable bounds (only if warm start option is chosen).
status_msg: string
zu : array-like, shape(n*N + q*N + r + s, ), optional (default=[])
Initial values for the multipliers for upper variable bounds (only if warm start option is chosen).
gives the status of the algorithm as a message
Returns
-------
x : :py:class:`numpy.ndarray`, shape `(n*N + q*N + r + s, )`
Optimal solution.
info: :py:class:`dict` with the following entries
``x``: :py:class:`numpy.ndarray`, shape `(n*N + q*N + r + s, )`
optimal solution
``g``: :py:class:`numpy.ndarray`, shape `(n*(N-1) + o, )`
constraints at the optimal solution
``obj_val``: :py:class:`float`
objective value at optimal solution
``mult_g``: :py:class:`numpy.ndarray`, shape `(n*(N-1) + o, )`
final values of the constraint multipliers
``mult_x_L``: :py:class:`numpy.ndarray`, shape `(n*N + q*N + r + s, )`
bound multipliers at the solution
``mult_x_U``: :py:class:`numpy.ndarray`, shape `(n*N + q*N + r + s, )`
bound multipliers at the solution
``status``: :py:class:`int`
gives the status of the algorithm
``status_msg``: :py:class:`str`
gives the status of the algorithm as a message
"""

Expand Down

0 comments on commit 790d9c0

Please sign in to comment.