CTDirect API

Index

Documentation

CTDirect.available_methodsMethod
available_methods(

) -> Tuple{Tuple{Symbol, Symbol}, Tuple{Symbol, Symbol}, Tuple{Symbol, Symbol}}

Return the list of available methods to solve the optimal control problem.

source
CTDirect.direct_solveMethod
direct_solve(
    ocp::OptimalControlModel,
    description::Symbol...;
    display,
    grid_size,
    disc_method,
    time_grid,
    init,
    adnlp_backend,
    kwargs...
) -> OptimalControlSolution

Solve an OCP with a direct method

Arguments

  • ocp: optimal control problem as defined in CTBase
  • [description]: can specifiy for instance the NLP model and / or solver (:ipopt, :madnlp or :knitro)

Keyword arguments (optional)

  • display: ([true], false) will disable output if set to false
  • grid_size: number of time steps for the discretized problem ([250])
  • disc_method: discretization method ([:trapeze], :midpoint, gauss_legendre_2)
  • time_grid: explicit time grid (can be non uniform)
  • init: info for the starting guess (values or existing solution)
  • adnlp_backend: backend for automatic differentiation in ADNLPModels ([:optimized], :manual, :default)

All further keywords are passed to the inner call of solve_docp

source
CTDirect.direct_transcriptionMethod
direct_transcription(
    ocp::OptimalControlModel,
    description...;
    grid_size,
    disc_method,
    time_grid,
    init,
    adnlp_backend,
    solver_backend,
    show_time,
    matrix_free
) -> Tuple{CTDirect.DOCP, ADNLPModels.ADNLPModel{Float64, Vector{Float64}, Vector{Int64}}}

Discretize an optimal control problem into a nonlinear optimization problem (ie direct transcription)

Arguments

  • ocp: optimal control problem as defined in CTBase
  • [description]: can specifiy for instance the NLP model and / or solver (:ipopt, :madnlp or :knitro)

Keyword arguments (optional)

  • grid_size: number of time steps for the discretized problem ([250])
  • disc_method: discretization method ([:trapeze], :euler, :euler_implicit, :midpoint, gauss_legendre_2, gauss_legendre_3)
  • time_grid: explicit time grid (can be non uniform)
  • init: info for the starting guess (values as named tuple or existing solution)
  • adnlp_backend: backend for automatic differentiation in ADNLPModels ([:optimized], :manual, :default)
  • show_time: (:true, [:false]) show timing details from ADNLPModels
source