API

OptimalControlProblems.beamMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.beam_sMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.chainMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.chain_sMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.gliderMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.glider_sMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.grid_size_dataMethod
grid_size_data(problem::Symbol) -> Any

Return the number of discretisation steps, from the metadata, for a given optimal control problem.

Arguments

  • problem::Symbol: The name of the problem.

Returns

  • Int: The number of discretisation steps (N) of the specified problem.

Example

julia> grid_size_data(:beam)
500
source
OptimalControlProblems.jacksonMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.mergeMethod
merge(
    A::NamedTuple,
    B::NamedTuple
) -> NamedTuple{names, T} where {N, names, T<:NTuple{N, Any}}

Merge two NamedTuples, with the second one overriding keys from the first when duplicated.

Arguments

  • A::NamedTuple: first set of key–value pairs.
  • B::NamedTuple: second set of key–value pairs, takes precedence if keys overlap.

Returns

  • ::NamedTuple: merged named tuple containing keys from both A and B.

Example

julia> merge((a=1, b=2), (b=3, c=4))
(a = 1, b = 3, c = 4)
source
OptimalControlProblems.mergeMethod
merge(A::NamedTuple, _::Nothing) -> NamedTuple

Merge a NamedTuple with nothing.

Arguments

  • A::NamedTuple: a named tuple to keep.
  • ::Nothing: placeholder, ignored.

Returns

  • ::NamedTuple: returns A unchanged.

Example

julia> merge((a=1,), nothing)
(a = 1,)
source
OptimalControlProblems.mergeMethod
merge(_::Nothing, _::NamedTuple)

Throw an error when attempting to merge nothing with a NamedTuple.

Arguments

  • ::Nothing: indicates there is no data to merge.
  • ::NamedTuple: the data that cannot be merged.

Returns

  • This function always throws CTBase.UnauthorizedCall.

Example

julia> merge(nothing, (a=1,))
ERROR: CTBase.UnauthorizedCall("There is nothing to merge.")
source
OptimalControlProblems.mergeMethod
merge(_::Nothing, _::Nothing)

Merge two Nothing values.

Arguments

  • ::Nothing: first argument.
  • ::Nothing: second argument.

Returns

  • nothing::Nothing: always returns nothing.

Example

julia> merge(nothing, nothing)
nothing
source
OptimalControlProblems.metadataMethod
metadata(problem::Symbol) -> Any

Return a dictionary containing the metadata of problem.

To get specific data, the following keys are valid:

  • grid_size::Int: the default number of steps. For example:
:grid_size => 500,
  • parameters::Union{Nothing,NamedTuple}: the list of parameters. For example:
:parameters => (
    t0 = 0,
    tf = 1,
    x₁_l = 0,
    x₁_u = 0.1,
    x₁_t0 = 0,
    x₂_t0 = 1,
    x₁_tf = 0,
    x₂_tf = -1,
),

Example

julia> data = metadata(:beam)
julia> data[:grid_size]
500
source
OptimalControlProblems.metadataMethod
metadata() -> OrderedCollections.OrderedDict{Any, Any}

Return the dictionary containing the metadata of all available optimal control problems.

Example

julia> metadata()
source
OptimalControlProblems.parameters_dataMethod
parameters_data(
    problem::Symbol,
    parameters::Union{Nothing, NamedTuple}
) -> Union{Nothing, NamedTuple}

Return the parameter set associated with a given problem, optionally merged with user-supplied parameters.

Arguments

  • problem::Symbol: the name of the problem.
  • parameters::Union{Nothing,NamedTuple}: user-supplied parameters to override or extend the defaults. If nothing, returns the default parameters unchanged.

Returns

  • ::Union{Nothing,NamedTuple}: the merged parameters. Throws CTBase.UnauthorizedCall if attempting to merge with a problem that has no parameters.

Example

julia> parameters_data(:beam, (tf = 2,))
(t0 = 0, tf = 2, ...)
source
OptimalControlProblems.parameters_dataMethod
parameters_data(problem::Symbol) -> Any

Return the parameter set associated with a given problem.

Arguments

  • problem::Symbol: the name of the problem whose parameters are requested.

Returns

  • ::Union{Nothing,NamedTuple}: the parameters of the problem, or nothing if none exist.

Example

julia> parameters_data(:beam)
(t0 = 0, tf = 1, ...)
source
OptimalControlProblems.problemsMethod
problems() -> Vector{Symbol}

Returns the list of available optimal control problems.

Returns

  • Vector{Symbol}: A vector of problem names as symbols.

Example

julia> OptimalControlProblems.problems()
[:problem1, :problem2, :problem3]
source
OptimalControlProblems.robbinsMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.robotMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.robot_sMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.rocketMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.rocket_sMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.steeringMethod

DocStringExtensions.TypedMethodSignatures()

This method throws an ExtensionError and is called if the required backend is not available. ```

source
OptimalControlProblems.beamMethod
beam(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing the Beam problem using the OptimalControl backend. The function sets up the state and control variables, boundary conditions, dynamics, path constraints, and the objective functional. It then performs direct transcription to generate a discrete optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type to specify the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object, representing the discretised problem.
  • nlp: The corresponding nonlinear programming model generated from the DOCP, ready for solver input.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.beam(OptimalControlBackend(); N=100);

References

  • BOCOP repository: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.beam_sMethod
beam_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing the Beam problem using the OptimalControl backend. The function sets up the state and control variables, boundary conditions, dynamics, path constraints, and the objective functional. It then performs direct transcription to generate a discrete optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type to specify the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object, representing the discretised problem.
  • nlp: The corresponding nonlinear programming model generated from the DOCP, ready for solver input.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.beam(OptimalControlBackend(); N=100);

References

  • BOCOP repository: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.chainMethod
chain(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing the Hanging Chain problem. The function defines state and control variables, boundary conditions, and system dynamics, with the objective of minimising the vertical displacement of the chain's midpoint. It performs direct transcription to produce a discretised optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the discretised Hanging Chain problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.chain(OptimalControlBackend(); N=100);

References

  • Formulation inspired by OptimalControl approach to variational problems and chain equilibrium.
  • Original problem source: BOCOP repository
source
OptimalControlProblems.chain_sMethod
chain_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing the Hanging Chain problem. The function defines state and control variables, boundary conditions, and system dynamics, with the objective of minimising the vertical displacement of the chain's midpoint. It performs direct transcription to produce a discretised optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the discretised Hanging Chain problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.chain(OptimalControlBackend(); N=100);

References

  • Formulation inspired by OptimalControl approach to variational problems and chain equilibrium.
  • Original problem source: BOCOP repository
source
OptimalControlProblems.double_oscillatorMethod
double_oscillator(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing a double oscillator system. The function defines state and control variables, system dynamics, boundary conditions, and an objective functional to be minimised. It uses direct transcription to produce a discretised optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the double oscillator system.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.double_oscillator(OptimalControlBackend(); N=100);

References

  • Coudurier, C., Lepreux, O., & Petit, N. (2018). Optimal bang-bang control of a mechanical double oscillator using averaging methods. IFAC-PapersOnLine, 51(2), 49-54. [CLP2018]
  • Formulation follows OptimalControl approach to mechanical oscillator trajectory optimisation.
source
OptimalControlProblems.double_oscillator_sMethod
double_oscillator_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem representing a double oscillator system. The function defines state and control variables, system dynamics, boundary conditions, and an objective functional to be minimised. It uses direct transcription to produce a discretised optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the double oscillator system.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.double_oscillator(OptimalControlBackend(); N=100);

References

  • Coudurier, C., Lepreux, O., & Petit, N. (2018). Optimal bang-bang control of a mechanical double oscillator using averaging methods. IFAC-PapersOnLine, 51(2), 49-54. [CLP2018]
  • Formulation follows OptimalControl approach to mechanical oscillator trajectory optimisation.
source
OptimalControlProblems.ducted_fanMethod
ducted_fan(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for a planar ducted fan system. The function defines state and control variables, system dynamics, boundary conditions, and a cost functional combining control effort and final time. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=250: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the planar ducted fan.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.ducted_fan(OptimalControlBackend(); N=250);

References

  • Graichen, K., & Petit, N. (2009). Incorporating a class of constraints into the dynamics of optimal control problems. Optimal Control Applications and Methods, 30(6), 537-561. [GP2009]
  • Problem instance follows OptimalControl formulation for ducted fan trajectory optimisation.
source
OptimalControlProblems.ducted_fan_sMethod

The Ducted Fan Problem: Implement the optimal control of a planar ducted fan. Instance taken from [GP2009]. The problem is formulated as an OptimalControl model. Ref: Graichen, K., & Petit, N. (2009). Incorporating a class of constraints into the dynamics of optimal control problems. Optimal Control Applications and Methods, 30(6), 537-561.

source
OptimalControlProblems.electric_vehicleMethod
electric_vehicle(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for an electric vehicle trajectory. The function defines state and control variables, vehicle dynamics, boundary conditions, and a cost functional representing energy and control effort. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the electric vehicle trajectory optimisation.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.electric_vehicle(OptimalControlBackend(); N=500);

References

  • Nicolas Petit and Antonio Sciarretta. "Optimal drive of electric vehicles using an inversion-based trajectory generation approach." IFAC Proceedings Volumes 44, no. 1 (2011): 14519-14526. [PS2011]
  • Problem instance follows OptimalControl formulation for electric vehicle trajectory optimisation.
source
OptimalControlProblems.electric_vehicle_sMethod
electric_vehicle_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for an electric vehicle trajectory. The function defines state and control variables, vehicle dynamics, boundary conditions, and a cost functional representing energy and control effort. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the electric vehicle trajectory optimisation.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.electric_vehicle(OptimalControlBackend(); N=500);

References

  • Nicolas Petit and Antonio Sciarretta. "Optimal drive of electric vehicles using an inversion-based trajectory generation approach." IFAC Proceedings Volumes 44, no. 1 (2011): 14519-14526. [PS2011]
  • Problem instance follows OptimalControl formulation for electric vehicle trajectory optimisation.
source
OptimalControlProblems.gliderMethod
glider(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for a hang glider trajectory. The function defines state and control variables, glider dynamics in a thermal updraft, boundary conditions, and a cost functional aiming to maximise the final horizontal position. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the hang glider trajectory optimisation.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.glider(OptimalControlBackend(); N=500);

References

  • Original formulation from MadNLP/COPSBenchmark.
  • Problem inspired by glider dynamics with thermal updraft and lift modelling.
source
OptimalControlProblems.glider_sMethod
glider_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for a hang glider trajectory. The function defines state and control variables, glider dynamics in a thermal updraft, boundary conditions, and a cost functional aiming to maximise the final horizontal position. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the hang glider trajectory optimisation.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.glider(OptimalControlBackend(); N=500);

References

  • Original formulation from MadNLP/COPSBenchmark.
  • Problem inspired by glider dynamics with thermal updraft and lift modelling.
source
OptimalControlProblems.insuranceMethod
insurance(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for an insurance system optimisation. The function defines state and control variables, system dynamics, constraints on insurance, expenses, revenue, health, utility, and auxiliary variables, and sets up a cost functional aimed at maximising expected utility over time. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the insurance optimisation problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.insurance(OptimalControlBackend(); N=500);

References

source
OptimalControlProblems.insurance_sMethod
insurance_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for an insurance system optimisation. The function defines state and control variables, system dynamics, constraints on insurance, expenses, revenue, health, utility, and auxiliary variables, and sets up a cost functional aimed at maximising expected utility over time. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the insurance optimisation problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.insurance(OptimalControlBackend(); N=500);

References

source
OptimalControlProblems.jacksonMethod
jackson(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Jackson benchmark model. The function sets up state and control variables, system dynamics, bounds, initial and final conditions, and a cost functional aimed at minimising the third state variable at final time. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Jackson problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.jackson(OptimalControlBackend(); N=500);

References

source
OptimalControlProblems.jackson_sMethod
jackson_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Jackson benchmark model. The function sets up state and control variables, system dynamics, bounds, initial and final conditions, and a cost functional aimed at minimising the third state variable at final time. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Jackson problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.jackson(OptimalControlBackend(); N=500);

References

source
OptimalControlProblems.robbinsMethod
robbins(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Robbins benchmark model. This function defines the state and control variables, system dynamics, initial and final conditions, and the cost functional, which minimises a weighted sum of the state and control contributions. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model. Reference: Robbins Problem on BOCOP

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Robbins problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.robbins(OptimalControlBackend(); N=500);
source
OptimalControlProblems.robbins_sMethod
robbins_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Robbins benchmark model. This function defines the state and control variables, system dynamics, initial and final conditions, and the cost functional, which minimises a weighted sum of the state and control contributions. It returns both a discretised direct optimal control problem (DOCP) and the corresponding nonlinear programming (NLP) model. Reference: Robbins Problem on BOCOP

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Robbins problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.robbins(OptimalControlBackend(); N=500);
source
OptimalControlProblems.robotMethod
robot(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for a robotic arm moving between two points. This function defines the state and control variables, system dynamics, initial and final conditions, and the cost functional, which minimises the total time taken to perform the motion. Reference: Robot arm problem on BOCOP here

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=250: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the robot arm problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.robot(OptimalControlBackend(); N=250);
source
OptimalControlProblems.robot_sMethod
robot_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for a robotic arm moving between two points. This function defines the state and control variables, system dynamics, initial and final conditions, and the cost functional, which minimises the total time taken to perform the motion. Reference: Robot arm problem on BOCOP here

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=250: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the robot arm problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.robot(OptimalControlBackend(); N=250);
source
OptimalControlProblems.rocketMethod
rocket(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Goddard rocket. This function defines the state variables (altitude, velocity, mass), the control variable (thrust), system dynamics, constraints, initial and final conditions, and the cost functional, which maximises the final altitude. Reference: Goddard Rocket Problem here

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Goddard rocket problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.rocket(OptimalControlBackend(); N=500);
source
OptimalControlProblems.rocket_sMethod
rocket_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Goddard rocket. This function defines the state variables (altitude, velocity, mass), the control variable (thrust), system dynamics, constraints, initial and final conditions, and the cost functional, which maximises the final altitude. Reference: Goddard Rocket Problem here

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Goddard rocket problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.rocket(OptimalControlBackend(); N=500);
source
OptimalControlProblems.space_shuttleMethod
space_shuttle(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Space Shuttle reentry trajectory. This function defines the state variables (altitude, longitude, latitude, velocity, flight path angle, azimuth), the control variables (angle of attack, bank angle), system dynamics, constraints, initial and terminal conditions, and the cost functional, which maximises the latitude (cross range) at the terminal point. Reference: Original JuMP model formulation here. Note: No heating limit path constraint is included.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Space Shuttle reentry trajectory.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.space_shuttle(OptimalControlBackend(); N=500);
source
OptimalControlProblems.space_shuttle_sMethod
space_shuttle_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Space Shuttle reentry trajectory. This function defines the state variables (altitude, longitude, latitude, velocity, flight path angle, azimuth), the control variables (angle of attack, bank angle), system dynamics, constraints, initial and terminal conditions, and the cost functional, which maximises the latitude (cross range) at the terminal point. Reference: Original JuMP model formulation here. Note: No heating limit path constraint is included.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Space Shuttle reentry trajectory.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.space_shuttle(OptimalControlBackend(); N=500);
source
OptimalControlProblems.steeringMethod
steering(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for steering a particle along a trajectory. The objective is to minimise the total time taken to reach a specified terminal state, subject to control limits and particle dynamics. The state vector has four components, and the control is a single scalar input.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the particle steering problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.steering(OptimalControlBackend(); N=500);
source
OptimalControlProblems.steering_sMethod
steering_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for steering a particle along a trajectory. The objective is to minimise the total time taken to reach a specified terminal state, subject to control limits and particle dynamics. The state vector has four components, and the control is a single scalar input.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the particle steering problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.steering(OptimalControlBackend(); N=500);
source
OptimalControlProblems.vanderpolMethod
vanderpol(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Van der Pol oscillator with a control input. The objective is to minimise a quadratic cost composed of the state and control effort over a fixed time horizon. The problem formulation can be found here.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Van der Pol problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.vanderpol(OptimalControlBackend(); N=500);
source
OptimalControlProblems.vanderpol_sMethod
vanderpol_s(
    ::OptimalControlBackend,
    description::Symbol...;
    grid_size,
    parameters,
    kwargs...
) -> Union{CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ADNLPBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}, CTDirect.DOCP{_A, CTModels.Model{TD, TimesModelType, StateModelType, ControlModelType, VariableModelType, DynamicsModelType, ObjectiveModelType, ConstraintsModelType, BuildExaModelType}, CTDirect.ExaBackend} where {_A<:CTDirect.Discretization, TD<:CTModels.TimeDependence, TimesModelType<:CTModels.AbstractTimesModel, StateModelType<:CTModels.AbstractStateModel, ControlModelType<:CTModels.AbstractControlModel, VariableModelType<:CTModels.AbstractVariableModel, DynamicsModelType<:Function, ObjectiveModelType<:CTModels.AbstractObjectiveModel, ConstraintsModelType<:CTModels.AbstractConstraintsModel, BuildExaModelType<:Union{Nothing, Function}}}

Constructs an OptimalControl problem for the Van der Pol oscillator with a control input. The objective is to minimise a quadratic cost composed of the state and control effort over a fixed time horizon. The problem formulation can be found here.

Arguments

  • ::OptimalControlBackend: Placeholder type specifying the OptimalControl backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation points for the direct transcription grid.

Returns

  • docp: The direct optimal control problem object representing the Van der Pol problem.
  • nlp: The corresponding nonlinear programming model obtained from the DOCP, suitable for numerical optimisation.

Example

julia> using OptimalControlProblems

julia> docp = OptimalControlProblems.vanderpol(OptimalControlBackend(); N=500);
source
CTModels.controlMethod
control(
    model::GenericModel
) -> Union{JuMPModels.var"#457#459", JuMPModels.var"#458#460"}

Extract and interpolate the control trajectory from a JuMP model of an optimal control problem.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Returns

  • fu::Function: A function of continuous time returning the interpolated control. If the control is scalar, the function returns a scalar; otherwise, a vector.

Example

julia> u = OptimalControlProblems.control(model)
julia> u(0.25)
0.42
source
CTModels.control_componentsMethod
control_components(model::GenericModel) -> Any

Return the list of control component names stored in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :control_components.

Returns

  • Vector{String}: The names of the control components.

Example

julia> OptimalControlProblems.control_components(model)
["Fex"]
source
CTModels.control_dimensionMethod
control_dimension(model::GenericModel) -> Any

Return the number of control components in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :control_components.

Returns

  • Int: The number of control components.

Example

julia> OptimalControlProblems.control_dimension(model)
1
source
CTModels.costateMethod
costate(
    model::GenericModel
) -> Union{JuMPModels.var"#462#465", JuMPModels.var"#463#466"}

Extract and interpolate the costate trajectory (dual variables associated with states) from a JuMP model of an optimal control problem.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Returns

  • fp::Function: A function of continuous time returning the interpolated costate. If the costate is scalar, the function returns a scalar; otherwise, a vector.

Example

julia> p = OptimalControlProblems.costate(model)
julia> p(0.75)
[-0.12, 0.05]
source
CTModels.iterationsMethod
iterations(model::GenericModel) -> Any

Get the number of iterations from a JuMP model.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Example

julia> OptimalControlProblems.iterations(model)
20
source
CTModels.stateMethod
state(
    model::GenericModel
) -> Union{JuMPModels.var"#453#455", JuMPModels.var"#454#456"}

Extract and interpolate the state trajectory from a JuMP model of an optimal control problem.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Returns

  • fx::Function: A function of continuous time returning the interpolated state. If the state is scalar, the function returns a scalar; otherwise, a vector.

Example

julia> x = OptimalControlProblems.state(model)
julia> x(0.5)
[0.23, 0.71]
source
CTModels.state_componentsMethod
state_components(model::GenericModel) -> Any

Return the list of state component names stored in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :state_components.

Returns

  • Vector{String}: The names of the state components.

Example

julia> OptimalControlProblems.state_components(model)
["x", "v", "θ", "ω"]
source
CTModels.state_dimensionMethod
state_dimension(model::GenericModel) -> Any

Return the number of state components in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :state_components.

Returns

  • Int: The number of state components.

Example

julia> OptimalControlProblems.state_dimension(model)
4
source
CTModels.time_gridMethod
time_grid(model::GenericModel) -> Any

Compute the discretised time grid for a given optimal control problem solved with JuMP.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Returns

  • t_jp::AbstractVector{Float64}: A vector of time points spanning from initial time t0 = 0 to the final time tf.

Example

julia> tgrid = OptimalControlProblems.time_grid(model)
0.0:0.1:1.0
source
CTModels.variable_componentsMethod
variable_components(model::GenericModel) -> Any

Return the list of additional variable component names stored in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :variable_components.

Returns

  • Vector{String}: The names of the additional variable components.

Example

julia> OptimalControlProblems.variable_components(model)
["tf", "ddx"]
source
CTModels.variable_dimensionMethod
variable_dimension(model::GenericModel) -> Any

Return the number of additional variable components in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :variable_components.

Returns

  • Int: The number of additional variable components.

Example

julia> OptimalControlProblems.variable_dimension(model)
2
source
ExaModels.objectiveMethod
objective(model::GenericModel) -> Any

Get the objective value from a JuMP model.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Example

julia> OptimalControlProblems.objective(model)
1.5
source
ExaModels.variableMethod
variable(model::GenericModel) -> Any

Extract scalar or vector decision variables (such as final time when free) from a JuMP model of an optimal control problem.

Arguments

  • model::JuMP.GenericModel: The JuMP model containing the problem solution.

Returns

  • var::Union{Float64,Vector{Float64}}:
    • Float64[] if the problem defines no additional variables.
    • A scalar if there is one variable.
    • A vector if multiple variables exist.

Example

julia> v = OptimalControlProblems.variable(model)
1.5
source
JuMPModels.costate_componentsMethod
costate_components(model::GenericModel) -> Any

Return the list of costate component names stored in a JuMP model.

Arguments

  • model::JuMP.GenericModel: A JuMP model that contains the key :costate_components.

Returns

  • Vector{String}: The names of the costate components.

Example

julia> costate_components(model)
["∂x", "∂v", "∂θ", "∂ω"]
source
OptimalControlProblems.beamMethod
beam(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs a JuMP model representing the Beam optimal control problem. The objective is to minimise the control effort while satisfying boundary conditions and the linear beam dynamics. The problem is formulated as in the BOCOP repository.

Arguments

  • ::JuMPBackend: Placeholder type to specify the JuMP backend or solver interface.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time grid.

Returns

  • model::JuMP.Model: A JuMP model containing the decision variables, dynamics constraints, boundary conditions, and the quadratic objective function.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.beam(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.chainMethod
chain(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Hanging Chain Problem. The goal is to determine the equilibrium shape of a chain of fixed length L hanging between two fixed points a and b, by minimising its potential energy. The formulation follows a standard optimal control approach with discretised dynamics and constraints.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the hanging chain optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.chain(JuMPBackend(); N=300)

References

source
OptimalControlProblems.double_oscillatorMethod
double_oscillator(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Double Oscillator Optimal Control Problem. The objective is to compute an optimal control trajectory for a mechanical double oscillator system, minimising a quadratic cost on positions and control. The system dynamics are discretised over N steps, with collocation constraints enforcing the dynamics.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the double oscillator optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.double_oscillator(JuMPBackend(); N=200)

References

  • [CLP2018] Coudurier, C., Lepreux, O., & Petit, N. (2018). Optimal bang-bang control of a mechanical double oscillator using averaging methods. IFAC-PapersOnLine, 51(2), 49–54.
source
OptimalControlProblems.ducted_fanMethod
ducted_fan(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Planar Ducted Fan Optimal Control Problem. The objective is to determine the optimal control inputs for a planar ducted fan to move from a given initial state to a desired final state, minimising a combination of control effort and final time. The system is discretised over N steps, with collocation constraints enforcing the dynamics.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=250: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the planar ducted fan optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.ducted_fan(JuMPBackend(); N=100)

References

  • Graichen, K., & Petit, N. (2009). Incorporating a class of constraints into the dynamics of optimal control problems. Optimal Control Applications and Methods, 30(6), 537–561. [GP2009]
source
OptimalControlProblems.electric_vehicleMethod
electric_vehicle(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Electric Vehicle Optimal Control Problem. The objective is to compute the optimal control trajectory for an electric vehicle to travel a fixed distance while minimising a combination of energy consumption and control effort. The system dynamics are discretised over N steps, and collocation constraints are used to enforce the vehicle's kinematic and dynamic equations.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the electric vehicle optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.electric_vehicle(JuMPBackend(); N=100)

References

  • Petit, N., & Sciarretta, A. (2011). Optimal drive of electric vehicles using an inversion-based trajectory generation approach. IFAC Proceedings Volumes, 44(1), 14519–14526. [PS2011]
source
OptimalControlProblems.gliderMethod
glider(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Hang Glider Optimal Control Problem. The objective is to compute the optimal trajectory of a hang glider that maximises the final horizontal position while accounting for aerodynamic forces and a thermal updraft. The system dynamics are discretised over N steps, and collocation constraints enforce the kinematic and dynamic equations of the glider.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the hang glider optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.glider(JuMPBackend(); N=100)

References

  • Hang Glider Problem formulation as in: https://www.mcs.anl.gov/~more/cops/
source
OptimalControlProblems.insuranceMethod
insurance(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Insurance Optimal Control Problem. The model represents a simplified insurance management scenario where the objective is to optimise the utility function U over time, subject to capital accumulation dynamics and other constraints. The system is discretised using N steps, and collocation constraints enforce the dynamics of the states I, m, and x₃.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the insurance optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.insurance(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.jacksonMethod
jackson(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Jackson Optimal Control Problem. The model represents a dynamic system with three state variables a, b, and x₃ and a control variable u. The objective is to maximise the final value of x₃ by optimising the control u over the time horizon [0, tf]. The dynamics are discretised using N steps with trapezoidal collocation.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps in the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the Jackson optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.jackson(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.robbinsMethod
robbins(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Robbins Optimal Control Problem. The model represents a three-dimensional state system controlled by a single input u. The objective is to minimise a cost functional that combines linear and quadratic terms of the state and control over a fixed time horizon.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time grid.

Returns

  • model::JuMP.Model: A JuMP model representing the Robbins optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.robbins(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/control-toolbox/bocop/tree/main/bocop
source
OptimalControlProblems.robotMethod
robot(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Robot Arm Optimal Control Problem. The model represents a robot arm with three states (ρ, θ, ϕ) controlled by three inputs (uρ, uθ, uϕ). The objective is to minimise the final time required for the robot arm to move between specified initial and final positions while respecting dynamic and boundary constraints.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=250: (Keyword) Number of discretisation steps for the time horizon.

Returns

  • model::JuMP.Model: A JuMP model representing the robot arm optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.robot(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/MadNLP/COPSBenchmark.jl/blob/main/src/robot.jl
source
OptimalControlProblems.rocketMethod
rocket(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Goddard Rocket Optimal Control Problem. The model represents the dynamics of a Goddard rocket with three states (altitude h, velocity v, and mass m) and one control input (T for thrust). The objective is to maximise the final altitude of the rocket while satisfying boundary conditions and dynamic constraints.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time horizon.

Returns

  • model::JuMP.Model: A JuMP model representing the Goddard rocket optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.rocket(JuMPBackend(); N=200)

References

  • Problem formulation available at: https://github.com/MadNLP/COPSBenchmark.jl/blob/main/src/rocket.jl
source
OptimalControlProblems.space_shuttleMethod
space_shuttle(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Space Shuttle Reentry Trajectory Problem. The model represents the dynamics of a space shuttle reentry with multiple states (altitude h, longitude ϕ, latitude θ, velocity v, flight path angle γ, azimuth ψ) and control inputs (angle of attack α and bank angle β). The objective is to maximise the terminal latitude (cross-range) while satisfying boundary conditions and vehicle dynamics. Note: no heating limit path constraint is included in this formulation.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time horizon.

Returns

  • model::JuMP.Model: A JuMP model representing the space shuttle reentry optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.space_shuttle(JuMPBackend(); N=200)

References

  • Problem formulation and tutorial available at: https://jump.dev/JuMP.jl/stable/tutorials/nonlinear/spaceshuttlereentry_trajectory/
source
OptimalControlProblems.steeringMethod
steering(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Particle Steering Problem. The model represents the dynamics of a particle with four state variables (x₁, x₂, x₃, x₄) and a control input u. The objective is to minimise the final time required for the particle to reach a specified altitude and terminal velocity while satisfying the system dynamics and boundary conditions.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time horizon.

Returns

  • model::JuMP.Model: A JuMP model representing the particle steering optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.steering(JuMPBackend(); N=200)

References

  • Problem formulation available at: https://github.com/MadNLP/COPSBenchmark.jl/blob/main/src/steering.jl
source
OptimalControlProblems.vanderpolMethod
vanderpol(
    ::JuMPBackend,
    args...;
    grid_size,
    parameters,
    kwargs...
) -> JuMP.Model

Constructs and returns a JuMP model for the Van der Pol Problem, a classic nonlinear oscillator system. The model represents the dynamics of the Van der Pol oscillator with control input u and seeks to minimise the quadratic cost over the states and control.

Arguments

  • ::JuMPBackend: Specifies the backend for building the JuMP model.
  • grid_size::Int=500: (Keyword) Number of discretisation steps for the time horizon.

Returns

  • model::JuMP.Model: A JuMP model representing the Van der Pol optimal control problem.

Example

julia> using OptimalControlProblems
julia> using JuMP

julia> model = OptimalControlProblems.vanderpol(JuMPBackend(); N=100)

References

  • Problem formulation available at: https://github.com/control-toolbox/bocop/tree/main/bocop
source