Implementations¶
- class condor.implementations.simple.ExplicitSystem(model_instance)¶
Implementation for
ExplicitSystem
model.No
Options
expected.
- class condor.implementations.simple.ExternalSolverModel(model_instance)¶
Implementation for External Solver models.
No
Options
expected.
- class condor.implementations.sgm_trajectory.TrajectoryAnalysis(model_instance)¶
Implementation for
TrajectoryAnalysis
model.- Options:
state_atol (
float
) – absolute tolerance for forward evalautionstate_rtol (
float
) – relative tolerance for forward evalautionstate_adaptive_max_step_size (
float
) – actually a minimum number of steps per time-defined segment for the forward evaluationstate_max_step_size (
float
) – maximum step size for the forward evaluationstate_solver (
TrajectoryAnalysis.Solver
) – enum member for solver typeadjoint_* – same as above, for the adjoint solution
- construct(model, state_atol=1e-12, state_rtol=1e-06, state_adaptive_max_step_size=0.0, state_max_step_size=0, adjoint_atol=1e-12, adjoint_rtol=1e-06, adjoint_adaptive_max_step_size=4.0, adjoint_max_step_size=0, state_solver=Solver.dopri5, adjoint_solver=Solver.dopri5)¶
Iterative Solvers¶
- class condor.implementations.iterative.AlgebraicSystem(model_instance)¶
Implementation for
AlgebraicSystem
model.- Options:
atol (
float
) – absolute tolerance (default 1e-12)rtol (
float
) – relative tolerance (default 1e-12)warm_start (
bool
) – flag indicating whether subsequent calls should initialize the variable values to the last-run solution (default True)max_iter (
int
) – maximum number of iterations before terminating solver (default 100)error_on_fail (
bool
) – flag indicating whether to raise an error if the solver fails to converge within specified tolerance before reaching max_iter (default False)
- construct(model, atol=1e-12, rtol=1e-12, warm_start=True, exact_hessian=True, max_iter=100, re_initialize=None, default_initializer=0.0, error_on_fail=False)¶
- class condor.implementations.iterative.OptimizationProblem(model_instance)¶
Implementation base class for
OptimizationProblem
model.- Options:
init_callback (
callable
) – callback with signature , called when an optimization problem is evalauted. Once when embedded or every time as a standalone.iter_callback (
callable
) – callback with signature , called at each iteration of theCasadiNlpsolImplementation
(only IPOPT) andSciPyBase
subclass optimization implementaitons.
- make_warm_start(x0=None, lam_g0=None, lam_x0=None)¶
- default_options = {}¶
- construct(model, iter_callback=None, init_callback=None, **options)¶
- load_initializer(model_instance)¶
- class condor.implementations.iterative.CasadiNlpsolImplementation(model_instance)¶
Implementation layer for casadi nlpsol for
OptimizationProblem
models.- Options:
method (
CasadiNlpsolImplementation.Method
) – value from method enum to specify supported methodsexact_hessian (
bool
) – flag to use second order gradient information; use limited Broyden update otherwisecalc_lam_x (
bool
) – flag to calculate the lagrange multipliers solution, used for IPOPT to perform a true warm start**options – remaining keyword arguments are passed to casadi’s nlpsol’s constructor’s solver-specific options argument. See
method_default_options
for the defaults
- method_strings = {Method.fatrop: 'fatrop', Method.ipopt: 'ipopt', Method.qrsqp: 'sqpmethod', Method.snopt: 'snopt'}¶
- method_default_options = {Method.ipopt: {'sb': 'yes', 'warm_start_init_point': 'yes'}, Method.snopt: {'warm_start_init_point': False}}¶
- property default_options¶
derived property to get a copy of
method_default_options
or an empty dict
- construct(model, exact_hessian=True, method=Method.ipopt, calc_lam_x=False, **options)¶
- run_optimizer(model_instance)¶
- class condor.implementations.iterative.ScipyMinimizeBase(model_instance)¶
Base implementation class for SciPy minimize for
OptimizationProblem
models.- Options:
**options – keyword options are passed directly to scipy.minimize’s options keyword argument
- construct(model, **options)¶
- prepare_constraints(extra_args)¶
- run_optimizer(model_instance)¶