|
9 | 9 | # ------------------------------------------------------------------------ |
10 | 10 | # Canonical solve function - Layer 3 (Pure Execution) |
11 | 11 | # All inputs are concrete types, no defaults, no normalization |
| 12 | + |
| 13 | +""" |
| 14 | +$(TYPEDSIGNATURES) |
| 15 | +
|
| 16 | +Resolve an optimal control problem using fully specified, concrete components (Layer 3). |
| 17 | +
|
| 18 | +This is the lowest-level execution layer for solving an optimal control problem. It expects all |
| 19 | +components (initial guess, discretizer, modeler, and solver) to be fully instantiated and |
| 20 | +normalized. It discretizes the problem and passes it to the underlying `solve` pipeline. |
| 21 | +
|
| 22 | +# Arguments |
| 23 | +- `ocp::CTModels.AbstractModel`: The optimal control problem to solve |
| 24 | +- `initial_guess::CTModels.AbstractInitialGuess`: Normalized initial guess for the solution |
| 25 | +- `discretizer::CTDirect.AbstractDiscretizer`: Concrete discretization strategy |
| 26 | +- `modeler::CTSolvers.AbstractNLPModeler`: Concrete NLP modeling strategy |
| 27 | +- `solver::CTSolvers.AbstractNLPSolver`: Concrete NLP solver strategy |
| 28 | +- `display::Bool`: Whether to display the OCP configuration before solving |
| 29 | +
|
| 30 | +# Returns |
| 31 | +- `CTModels.AbstractSolution`: The solution to the optimal control problem |
| 32 | +
|
| 33 | +# Example |
| 34 | +```julia |
| 35 | +# Conceptual usage pattern for Layer 3 solve |
| 36 | +ocp = Model(time=:final) |
| 37 | +# ... define OCP ... |
| 38 | +init = CTModels.build_initial_guess(ocp, nothing) |
| 39 | +disc = CTDirect.Collocation(grid_size=100) |
| 40 | +mod = CTSolvers.ADNLP() |
| 41 | +sol = CTSolvers.Ipopt() |
| 42 | +
|
| 43 | +solution = solve(ocp, init, disc, mod, sol; display=true) |
| 44 | +``` |
| 45 | +
|
| 46 | +See also: [`solve_explicit`](@ref), [`solve_descriptive`](@ref) |
| 47 | +""" |
12 | 48 | function CommonSolve.solve( |
13 | 49 | ocp::CTModels.AbstractModel, |
14 | 50 | initial_guess::CTModels.AbstractInitialGuess, # Already normalized by Layer 1 |
|
0 commit comments