CTDirect.jl private functions

Index

Documentation

CTBase.OptimalControlSolutionMethod
OptimalControlSolution(docp, docp_solution) -> Any

Build OCP functional solution from DOCP discrete solution (given as a SolverCore.GenericExecutionStats)

source
CTBase.OptimalControlSolutionMethod
OptimalControlSolution(
    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.

source
CTBase.OptimalControlSolutionMethod
OptimalControlSolution(
    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)

source
CTDirect.DOCPType

Struct 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
source
CTDirect.DOCP_constraints!Method
DOCP_constraints!(c, xu, docp::CTDirect.DOCP) -> Any

Compute the constraints C for the DOCP problem (modeled as LB <= C(X) <= UB).

source
CTDirect.DOCP_initial_guessFunction
DOCP_initial_guess(docp) -> Any
DOCP_initial_guess(docp, init::OptimalControlInit) -> Any

Build initial guess for discretized problem

source
CTDirect.__ipopt_linear_solverMethod
__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.

source
CTDirect.__ipopt_mu_strategyMethod
__ipopt_mu_strategy() -> String

Used to set the default value of the μ strategy of Ipopt for the direct method. The default value is adaptive.

source
CTDirect.__ipopt_print_levelMethod
__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.

source
CTDirect.__madnlp_linear_solverMethod
__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.

source
CTDirect.constraints_bounds!Method
constraints_bounds!(
    docp::CTDirect.DOCP
) -> Tuple{Vector{Float64}, Vector{Float64}}

Build upper and lower bounds vectors for the DOCP nonlinear constraints.

source
CTDirect.get_single_variableMethod
get_single_variable(xu, docp, i::Int64) -> Any

Retrieve a single optimization variable (no dim check). Internal layout: [X0,U0, X1,U1, .., XN,UN,V]

source
CTDirect.get_variableMethod
get_variable(xu, docp) -> Any

Retrieve optimization variables from the NLP variables. Internal layout: [X0,U0, X1,U1, .., XN,UN,V]

source
CTDirect.parse_DOCP_solution_dualMethod
parse_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

source
CTDirect.parse_DOCP_solution_primalMethod
parse_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

source
CTDirect.setPathBounds!Method
setPathBounds!(
    docp::CTDirect.DOCP,
    index::Int64,
    lb,
    ub
) -> Int64

Set bounds for the path constraints at given time step

source
CTDirect.setPathConstraints!Method
setPathConstraints!(
    docp::CTDirect.DOCP,
    c,
    index::Int64,
    args::CTDirect.ArgsAtTimeStep,
    v
) -> Int64

Set the path constraints at given time step

source
CTDirect.setPointBounds!Method
setPointBounds!(
    docp::CTDirect.DOCP,
    index::Int64,
    lb,
    ub
) -> Int64

Set bounds for the boundary and variable constraints

source
CTDirect.setPointConstraints!Method
setPointConstraints!(
    docp::CTDirect.DOCP,
    c,
    index::Int64,
    args_0::CTDirect.ArgsAtTimeStep,
    args_f::CTDirect.ArgsAtTimeStep,
    v
) -> Int64

Set the boundary and variable constraints

source
CTDirect.setStateEquation!Method
setStateEquation!(
    docp::CTDirect.DOCP,
    c,
    index::Int64,
    args_trapeze
) -> Int64

Set the constraints corresponding to the state equation

source
CTDirect.set_box_multipliersMethod
set_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

source
CTDirect.set_constraints_and_multipliersMethod
set_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

source
CTDirect.set_variable!Method
set_variable!(xu, v_init, docp) -> Any

Set optimization variables in the NLP variables (for initial guess)

source
CTDirect.variables_bounds!Method
variables_bounds!(
    docp::CTDirect.DOCP
) -> Tuple{Vector{Float64}, Vector{Float64}}

Build upper and lower bounds vectors for the DOCP variable box constraints.

source