OpTaS  1.0.7
An optimization-based task specification library for trajectory optimization and model predictive control.
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
optas.solver.ScipyMinimizeSolver Class Reference
Inheritance diagram for optas.solver.ScipyMinimizeSolver:
Inheritance graph
[legend]
Collaboration diagram for optas.solver.ScipyMinimizeSolver:
Collaboration graph
[legend]

Public Member Functions

def setup (self, str method="SLSQP", Union[None, float] tol=None, Union[None, Dict] options=None)
 
cs.np.ndarray f (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray jac (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray hess (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray v (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray dv (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray g (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray dg (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray ddg (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray h (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray dh (self, cs.np.ndarray x)
 Internal method. More...
 
cs.np.ndarray ddh (self, cs.np.ndarray x)
 Internal method. More...
 
None reset_initial_seed (self, x0)
 Reset initial seed for the optimization problem. More...
 
def reset_parameters (self, Dict[str, ArrayType] p)
 Reset the parameters. More...
 
def stats (self)
 Statistics relating to the previous call to solve. More...
 
def did_solve (self)
 Returns True when the problem was solved. More...
 
def number_of_iterations (self)
 Number of iterations it took the solver to converge. More...
 
- Public Member Functions inherited from optas.solver.Solver
def __init__ (self, Optimization optimization, bool error_on_fail=False)
 Constructor for the base Solver class. More...
 
type opt_type (self)
 Optimization type. More...
 
def setup (self, *args, **kwargs)
 Setup solver, note this method must return self. More...
 
None reset_initial_seed (self, Dict[str, ArrayType] x0)
 Reset initial seed for the optimization problem. More...
 
Dict solve (self)
 Solve the optimization problem. More...
 
Tuple violated_constraints (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Indicate the violated constraints. More...
 
CasADiArrayType evaluate_cost (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Evaluates the cost function for given decision variables x and parameters p. More...
 
List evaluate_cost_terms (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Evaluates each cost term for given decision variables and parameters. More...
 

Public Attributes

 method
 Method name. More...
 
 minimize_input
 Input to the minimize method. More...
 
- Public Attributes inherited from optas.solver.Solver
 opt
 Instance of the optimization problem. More...
 
 x0
 Initial guess for the optimization problem (set using reset_initial_seed). More...
 
 p
 Parameter vector. More...
 

Static Public Attributes

dictionary methods_req_jac
 Methods that require the Jacobian of the objective. More...
 
dictionary methods_req_hess
 Methods that require the Hessian of the objective. More...
 
dictionary methods_handle_constraints = {"COBYLA", "SLSQP", "trust-constr"}
 Methods that handle constrained optimization problems. More...
 

Private Member Functions

CasADiArrayType _solve (self)
 Solve the optimization problem using Scipy. More...
 

Private Attributes

 _stats
 Container for the statistics. More...
 
 _constraints
 Constraints definition passed to the minimize method. More...
 
 _solution
 

Additional Inherited Members

- Static Public Member Functions inherited from optas.solver.Solver
interp1d interpolate (cs.DM traj, float T, **interp_args)
 Interpolate a trajectory. More...
 

Detailed Description

Scipy solver (scipy.optimize.minimize) interface.

Member Function Documentation

◆ _solve()

CasADiArrayType optas.solver.ScipyMinimizeSolver._solve (   self)
private

Solve the optimization problem using Scipy.

   @return The solution of the optimization problem.

Reimplemented from optas.solver.Solver.

◆ ddg()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.ddg (   self,
cs.np.ndarray  x 
)

Internal method.

◆ ddh()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.ddh (   self,
cs.np.ndarray  x 
)

Internal method.

◆ dg()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.dg (   self,
cs.np.ndarray  x 
)

Internal method.

◆ dh()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.dh (   self,
cs.np.ndarray  x 
)

Internal method.

◆ did_solve()

def optas.solver.ScipyMinimizeSolver.did_solve (   self)

Returns True when the problem was solved.

   @return Boolean indicating if the solver converged.

Reimplemented from optas.solver.Solver.

◆ dv()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.dv (   self,
cs.np.ndarray  x 
)

Internal method.

◆ f()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.f (   self,
cs.np.ndarray  x 
)

Internal method.

◆ g()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.g (   self,
cs.np.ndarray  x 
)

Internal method.

◆ h()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.h (   self,
cs.np.ndarray  x 
)

Internal method.

◆ hess()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.hess (   self,
cs.np.ndarray  x 
)

Internal method.

◆ jac()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.jac (   self,
cs.np.ndarray  x 
)

Internal method.

◆ number_of_iterations()

def optas.solver.ScipyMinimizeSolver.number_of_iterations (   self)

Number of iterations it took the solver to converge.

   @return Number of iterations.

Reimplemented from optas.solver.Solver.

◆ reset_initial_seed()

None optas.solver.ScipyMinimizeSolver.reset_initial_seed (   self,
  x0 
)

Reset initial seed for the optimization problem.

   @param x0 The initial seed.

◆ reset_parameters()

def optas.solver.ScipyMinimizeSolver.reset_parameters (   self,
Dict[str, ArrayType]  p 
)

Reset the parameters.

   @param p The values for the parameters.

Reimplemented from optas.solver.Solver.

◆ setup()

def optas.solver.ScipyMinimizeSolver.setup (   self,
str   method = "SLSQP",
Union[None, float]   tol = None,
Union[None, Dict]   options = None 
)
Setup the Scipy solver.

@param method Type of solver. Default is "SLSQP".
@param tol Tolerance for termination. When tol is specified, the selected minimization algorithm sets some relevant solver-specific tolerance(s) equal to tol. For detailed control, use solver-specific options.
@param options A dictionary of solver options.
@return The instance of the solve (i.e. self).

◆ stats()

def optas.solver.ScipyMinimizeSolver.stats (   self)

Statistics relating to the previous call to solve.

   @return Dictionary containing the statistics.

Reimplemented from optas.solver.Solver.

◆ v()

cs.np.ndarray optas.solver.ScipyMinimizeSolver.v (   self,
cs.np.ndarray  x 
)

Internal method.

Member Data Documentation

◆ _constraints

optas.solver.ScipyMinimizeSolver._constraints
private

Constraints definition passed to the minimize method.

◆ _solution

optas.solver.ScipyMinimizeSolver._solution
private

◆ _stats

optas.solver.ScipyMinimizeSolver._stats
private

Container for the statistics.

◆ method

optas.solver.ScipyMinimizeSolver.method

Method name.

◆ methods_handle_constraints

dictionary optas.solver.ScipyMinimizeSolver.methods_handle_constraints = {"COBYLA", "SLSQP", "trust-constr"}
static

Methods that handle constrained optimization problems.

◆ methods_req_hess

dictionary optas.solver.ScipyMinimizeSolver.methods_req_hess
static
Initial value:
= {
"Newton-CG",
"dogleg",
"trust-ncg",
"trust-krylov",
"trust-exact",
"trust-constr",
}

Methods that require the Hessian of the objective.

◆ methods_req_jac

dictionary optas.solver.ScipyMinimizeSolver.methods_req_jac
static
Initial value:
= {
"CG",
"BFGS",
"Newton-CG",
"L-BFGS-B",
"TNC",
"SLSQP",
"dogleg",
"trust-ncg",
"trust-krylov",
"trust-exact",
"trust-constr",
}

Methods that require the Jacobian of the objective.

◆ minimize_input

optas.solver.ScipyMinimizeSolver.minimize_input

Input to the minimize method.


The documentation for this class was generated from the following file: