agentlib_mpc.optimization_backends.casadi_ package
Subpackages
- agentlib_mpc.optimization_backends.casadi_.core package
- Submodules
- agentlib_mpc.optimization_backends.casadi_.core.VariableGroup module
- agentlib_mpc.optimization_backends.casadi_.core.casadi_backend module
- agentlib_mpc.optimization_backends.casadi_.core.discretization module
- agentlib_mpc.optimization_backends.casadi_.core.system module
- Module contents
Submodules
agentlib_mpc.optimization_backends.casadi_.admm module
- class agentlib_mpc.optimization_backends.casadi_.admm.ADMMCollocation(options: CasadiDiscretizationOptions)[source]
Bases:
DirectCollocation
- class agentlib_mpc.optimization_backends.casadi_.admm.ADMMMultipleShooting(options: CasadiDiscretizationOptions)[source]
Bases:
MultipleShooting
- class agentlib_mpc.optimization_backends.casadi_.admm.CasADiADMMBackend(config: dict)[source]
Bases:
CasADiBaseBackend
,ADMMBackend
Class doing optimization of ADMM subproblems with CasADi.
- property coupling_grid
Returns the grid on which the coupling variables are discretized.
- discretization_types: dict[DiscretizationMethod, Type[DiscretizationT]] = {DiscretizationMethod.collocation: <class 'agentlib_mpc.optimization_backends.casadi_.admm.ADMMCollocation'>, DiscretizationMethod.multiple_shooting: <class 'agentlib_mpc.optimization_backends.casadi_.admm.ADMMMultipleShooting'>}
- save_result_df(results: Results, now: float = 0)[source]
Save the results of solve into a dataframe at each time step.
Example results dataframe:
value_type variable … lower variable T_0 T_0_slack … T_0_slack mDot_0 time_step … 2 0.000000 298.160000 NaN … NaN NaN
101.431499 297.540944 -149.465942 … -inf 0.0 450.000000 295.779780 -147.704779 … -inf 0.0 798.568501 294.720770 -146.645769 … -inf 0.0
- Parameters:
results –
now –
Returns:
- system: CasadiADMMSystem
- system_type
alias of
CasadiADMMSystem
- class agentlib_mpc.optimization_backends.casadi_.admm.CasadiADMMSystem[source]
Bases:
FullSystem
- exchange_diff: OptimizationParameter
- exchange_multipliers: OptimizationParameter
- global_couplings: OptimizationParameter
- initialize(model: CasadiModel, var_ref: VariableReference)[source]
- local_couplings: OptimizationVariable
- local_exchange: OptimizationVariable
- multipliers: OptimizationParameter
- penalty_factor: OptimizationParameter
agentlib_mpc.optimization_backends.casadi_.basic module
- class agentlib_mpc.optimization_backends.casadi_.basic.BaseSystem[source]
Bases:
System
- algebraics: OptimizationVariable
- controls: OptimizationVariable
- cost_function: MX
- initial_state: OptimizationParameter
- initialize(model: CasadiModel, var_ref: VariableReference)[source]
- model_constraints: Constraint
- model_parameters: OptimizationParameter
- non_controlled_inputs: OptimizationParameter
- ode: MX
- outputs: OptimizationVariable
- states: OptimizationVariable
- class agentlib_mpc.optimization_backends.casadi_.basic.CasADiBaseBackend(config: dict)[source]
Bases:
CasADiBackend
Class doing optimization of ADMM subproblems with CasADi.
- discretization_types: dict[DiscretizationMethod, Type[DiscretizationT]] = {DiscretizationMethod.collocation: <class 'agentlib_mpc.optimization_backends.casadi_.basic.DirectCollocation'>, DiscretizationMethod.multiple_shooting: <class 'agentlib_mpc.optimization_backends.casadi_.basic.MultipleShooting'>}
- system: BaseSystem
- system_type
alias of
BaseSystem
- class agentlib_mpc.optimization_backends.casadi_.basic.CollocationMatrices(order: int, root: numpy.ndarray, B: numpy.ndarray, C: numpy.ndarray, D: numpy.ndarray)[source]
Bases:
object
- B: ndarray
- C: ndarray
- D: ndarray
- order: int
- root: ndarray
- class agentlib_mpc.optimization_backends.casadi_.basic.DirectCollocation(options: CasadiDiscretizationOptions)[source]
Bases:
Discretization
- initialize(system: BaseSystem, solver_factory: SolverFactory)[source]
Initializes the trajectory optimization problem, creating all symbolic variables of the OCP, the mapping function and the numerical solver.
- class agentlib_mpc.optimization_backends.casadi_.basic.MultipleShooting(options: CasadiDiscretizationOptions)[source]
Bases:
Discretization
- initialize(system: BaseSystem, solver_factory: SolverFactory)[source]
Initializes the trajectory optimization problem, creating all symbolic variables of the OCP, the mapping function and the numerical solver.
agentlib_mpc.optimization_backends.casadi_.casadi_admm_nn module
agentlib_mpc.optimization_backends.casadi_.casadi_nn module
agentlib_mpc.optimization_backends.casadi_.full module
- class agentlib_mpc.optimization_backends.casadi_.full.CasADiFullBackend(config: dict)[source]
Bases:
CasADiBackend
Class doing optimization of ADMM subproblems with CasADi.
- discretization_types: dict[DiscretizationMethod, Type[DiscretizationT]] = {DiscretizationMethod.collocation: <class 'agentlib_mpc.optimization_backends.casadi_.full.DirectCollocation'>, DiscretizationMethod.multiple_shooting: <class 'agentlib_mpc.optimization_backends.casadi_.full.MultipleShooting'>}
- system: FullSystem
- system_type
alias of
FullSystem
- class agentlib_mpc.optimization_backends.casadi_.full.DirectCollocation(options: CasadiDiscretizationOptions)[source]
Bases:
DirectCollocation
- class agentlib_mpc.optimization_backends.casadi_.full.FullSystem[source]
Bases:
BaseSystem
- initialize(model: CasadiModel, var_ref: FullVariableReference)[source]
- last_control: OptimizationParameter
- r_del_u: OptimizationParameter
- class agentlib_mpc.optimization_backends.casadi_.full.MultipleShooting(options: CasadiDiscretizationOptions)[source]
Bases:
MultipleShooting
agentlib_mpc.optimization_backends.casadi_.minlp module
- class agentlib_mpc.optimization_backends.casadi_.minlp.CasADiMINLPBackend(config: dict)[source]
Bases:
CasADiBackend
Class doing optimization of ADMM subproblems with CasADi.
- discretization_types: dict[DiscretizationMethod, Type[DiscretizationT]] = {DiscretizationMethod.collocation: <class 'agentlib_mpc.optimization_backends.casadi_.minlp.DirectCollocation'>}
- system: CasadiMINLPSystem
- system_type
alias of
CasadiMINLPSystem
- class agentlib_mpc.optimization_backends.casadi_.minlp.CasadiMINLPSystem[source]
Bases:
BaseSystem
- binary_controls: OptimizationVariable
- initialize(model: CasadiModel, var_ref: MINLPVariableReference)[source]
- class agentlib_mpc.optimization_backends.casadi_.minlp.DirectCollocation(options: CasadiDiscretizationOptions)[source]
Bases:
DirectCollocation