CTDirect.jl private functions
Index
CTDirect.ArgsAtTimeStep
CTDirect.DOCP
CTDirect.DOCP_constraints!
CTDirect.DOCP_constraints_check!
CTDirect.DOCP_initial_guess
CTDirect.DOCP_variables_check!
CTDirect.__grid_size
CTDirect.__ipopt_linear_solver
CTDirect.__ipopt_mu_strategy
CTDirect.__ipopt_print_level
CTDirect.__madnlp_linear_solver
CTDirect.__max_iterations
CTDirect.__time_grid
CTDirect.__tolerance
CTDirect.constraints_bounds!
CTDirect.get_final_time
CTDirect.get_initial_time
CTDirect.get_single_variable
CTDirect.get_time_at_time_step
CTDirect.get_unnormalized_time
CTDirect.get_variable
CTDirect.parse_DOCP_solution_dual
CTDirect.parse_DOCP_solution_primal
CTDirect.setPathBounds!
CTDirect.setPathConstraints!
CTDirect.setPointBounds!
CTDirect.setPointConstraints!
CTDirect.setStateEquation!
CTDirect.set_box_multipliers
CTDirect.set_constraints_and_multipliers
CTDirect.set_variable!
CTDirect.variables_bounds!
Documentation
CTBase.OptimalControlSolution
— MethodOptimalControlSolution(docp, docp_solution) -> Any
Build OCP functional solution from DOCP discrete solution (given as a SolverCore.GenericExecutionStats)
CTBase.OptimalControlSolution
— MethodOptimalControlSolution(
docp;
primal,
dual,
objective,
iterations,
constraints_violation,
message,
mult_LB,
mult_UB
) -> Any
Build OCP functional solution from the DOCP discrete solution, given as a vector. Costate will be retrieved from dual variables (multipliers) if available.
CTBase.OptimalControlSolution
— MethodOptimalControlSolution(
ocp::OptimalControlModel,
T,
X,
U,
v,
P;
objective,
iterations,
constraints_violation,
message,
stopping,
success,
constraints_types,
constraints_mult,
box_multipliers
) -> OptimalControlSolution
Build OCP functional solution from DOCP vector solution (given as raw variables and multipliers plus some optional infos)
CTDirect.ArgsAtTimeStep
— TypeUseful values at a time step: time, state, control, dynamics...
CTDirect.DOCP
— TypeStruct for discretized optimal control problem DOCP
Contains:
- a copy of the original OCP
- a NLP formulation of the DOCP
- data required to link the two problems
CTDirect.DOCP_constraints!
— MethodDOCP_constraints!(c, xu, docp::CTDirect.DOCP) -> Any
Compute the constraints C for the DOCP problem (modeled as LB <= C(X) <= UB).
CTDirect.DOCP_constraints_check!
— MethodDOCP_constraints_check!(cb, constraints, docp)
Check the nonlinear constraints violation for the DOCP problem.
CTDirect.DOCP_initial_guess
— FunctionDOCP_initial_guess(docp) -> Any
DOCP_initial_guess(docp, init::OptimalControlInit) -> Any
Build initial guess for discretized problem
CTDirect.DOCP_variables_check!
— MethodDOCP_variables_check!(vb, variables, docp)
Check the variables box constraints violation for the DOCP problem.
CTDirect.__grid_size
— Method__grid_size() -> Int64
Used to set the default grid size. The default value is 250
.
CTDirect.__ipopt_linear_solver
— Method__ipopt_linear_solver() -> String
Used to set the default value of the linear solver of Ipopt for the direct method. The default value is mumps
.
CTDirect.__ipopt_mu_strategy
— Method__ipopt_mu_strategy() -> String
Used to set the default value of the μ strategy of Ipopt for the direct method. The default value is adaptive
.
CTDirect.__ipopt_print_level
— Method__ipopt_print_level() -> Int64
Used to set the default value of the print level of Ipopt for the direct method. The default value is 5
.
CTDirect.__madnlp_linear_solver
— Method__madnlp_linear_solver() -> String
Used to set the default value of the linear solver of MadNLP for the direct method. The default value is umfpack
.
CTDirect.__max_iterations
— Method__max_iterations() -> Int64
Used to set the default maximum of iterations. The default value is 1000
.
CTDirect.__time_grid
— Method__time_grid()
Used to set the default time grid. The default value is nothing
.
CTDirect.__tolerance
— Method__tolerance() -> Float64
Used to set the default tolerance. The default value is 1e-8
.
CTDirect.constraints_bounds!
— Methodconstraints_bounds!(
docp::CTDirect.DOCP
) -> Tuple{Vector{Float64}, Vector{Float64}}
Build upper and lower bounds vectors for the DOCP nonlinear constraints.
CTDirect.get_final_time
— Methodget_final_time(xu, docp) -> Any
Retrieve final time for OCP (may be fixed or variable)
CTDirect.get_initial_time
— Methodget_initial_time(xu, docp) -> Any
Retrieve initial time for OCP (may be fixed or variable)
CTDirect.get_single_variable
— Methodget_single_variable(xu, docp, i::Int64) -> Any
Retrieve a single optimization variable (no dim check). Internal layout: [X0,U0, X1,U1, .., XN,UN,V]
CTDirect.get_time_at_time_step
— Methodget_time_at_time_step(xu, docp, i) -> Any
Get actual (un-normalized) time at give time step
CTDirect.get_unnormalized_time
— Methodget_unnormalized_time(xu, docp, t_normalized) -> Any
Get actual (un-normalized) time value
CTDirect.get_variable
— Methodget_variable(xu, docp) -> Any
Retrieve optimization variables from the NLP variables. Internal layout: [X0,U0, X1,U1, .., XN,UN,V]
CTDirect.parse_DOCP_solution_dual
— Methodparse_DOCP_solution_dual(
docp,
multipliers,
constraints
) -> Tuple{Any, Tuple{Any, Any, Any, Vector{Float64}, Vector{Float64}}, Tuple{Any, Any, Any, Vector{Float64}, Vector{Float64}}}
Recover OCP costate and constraints multipliers from DOCP multipliers
CTDirect.parse_DOCP_solution_primal
— Methodparse_DOCP_solution_primal(
docp,
solution;
mult_LB,
mult_UB
) -> Tuple{Any, Any, Any, Tuple{Tuple{Any, Any}, Tuple{Any, Any}, Tuple{Any, Any}}}
Recover OCP primal variables from DOCP solution
CTDirect.setPathBounds!
— MethodsetPathBounds!(
docp::CTDirect.DOCP,
index::Int64,
lb,
ub
) -> Int64
Set bounds for the path constraints at given time step
CTDirect.setPathConstraints!
— MethodsetPathConstraints!(
docp::CTDirect.DOCP,
c,
index::Int64,
args::CTDirect.ArgsAtTimeStep,
v
) -> Int64
Set the path constraints at given time step
CTDirect.setPointBounds!
— MethodsetPointBounds!(
docp::CTDirect.DOCP,
index::Int64,
lb,
ub
) -> Int64
Set bounds for the boundary and variable constraints
CTDirect.setPointConstraints!
— MethodsetPointConstraints!(
docp::CTDirect.DOCP,
c,
index::Int64,
args_0::CTDirect.ArgsAtTimeStep,
args_f::CTDirect.ArgsAtTimeStep,
v
) -> Int64
Set the boundary and variable constraints
CTDirect.setStateEquation!
— MethodsetStateEquation!(
docp::CTDirect.DOCP,
c,
index::Int64,
args_trapeze
) -> Int64
Set the constraints corresponding to the state equation
CTDirect.set_box_multipliers
— Methodset_box_multipliers(
T,
box_multipliers,
dim_x,
dim_u
) -> Tuple{CTDirect.var"#28#30", CTDirect.var"#29#31", CTDirect.var"#28#30", CTDirect.var"#29#31", Any, Any}
Process data related to box constraints for solution building
CTDirect.set_constraints_and_multipliers
— Methodset_constraints_and_multipliers(
T,
constraints_types,
constraints_mult
) -> Tuple{CTDirect.var"#16#22", CTDirect.var"#18#24", CTDirect.var"#20#26", Any, Any, CTDirect.var"#17#23", CTDirect.var"#19#25", CTDirect.var"#21#27", Any, Any}
Process data related to constraints for solution building
CTDirect.set_variable!
— Methodset_variable!(xu, v_init, docp) -> Any
Set optimization variables in the NLP variables (for initial guess)
CTDirect.variables_bounds!
— Methodvariables_bounds!(
docp::CTDirect.DOCP
) -> Tuple{Vector{Float64}, Vector{Float64}}
Build upper and lower bounds vectors for the DOCP variable box constraints.