Implementations¶
- class condor.implementations.simple.ExplicitSystem(model_instance)¶
Implementation for
ExplicitSystemmodel.No
Optionsexpected.
- class condor.implementations.simple.MultiMatchedField(matched_to=None, symmetric=None, **kwargs)¶
multi-match field, with symmetry checks
- flatten()¶
flatten matches to the on_field, defaults tot he match.
on_field is used to override which field instance’s dataclass gets filled in; this is currently used during TrajectoryAnalysis construction which creates its own copies of the matching fields
- element_class¶
alias of
MatchedElement
- class condor.implementations.simple.ExternalSolverModel(model_instance)¶
Implementation for External Solver models.
No
Optionsexpected.
- condor.implementations.sgm_trajectory.isnan(x)¶
- class condor.implementations.sgm_trajectory.TrajectoryAnalysis(model_instance)¶
Implementation for
TrajectoryAnalysismodel.All Options may be prefixed with
state_oradjoint_to apply only to the forward or reverse solvers, respectively. Without either prefix, the option will be passed to both solvers. For additional details on the Solver options, see thesweeping_gradient_methodsolvers.- class Solver(*values)¶
- CVODE = <class 'condor.solvers.sweeping_gradient_method.SolverCVODE'>¶
currently unsupported
- dopri5 = <class 'condor.solvers.sweeping_gradient_method.SolverSciPyDopri5'>¶
- dop853 = <class 'condor.solvers.sweeping_gradient_method.SolverSciPyDop853'>¶
- construct(model, state_solver=None, adjoint_solver=None, solver=Solver.dopri5, **kwargs)¶
Iterative Solvers¶
- class condor.implementations.iterative.AlgebraicSystem(model_instance)¶
Implementation for
AlgebraicSystemmodel.- 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
OptimizationProblemmodel.- 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) andSciPyBasesubclass optimization implementations.
- 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
OptimizationProblemmodels.- 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_optionsfor 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_optionsor 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
OptimizationProblemmodels.- 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)¶