User Interface to Solve the Optimization Problem
The solver requires a set of parameters. Thereafter, we can just run the solver using the problem defined by the augmented lagrangian.
Solver Parameters
The solver has many knobs. The recommended settings are below:
using TrajOptSOCPs; #hide
currSolveParams = solverParams(0.1, 0.5,
8, 10,
10^-4,
10, 10^6,
2.5, 2, 0.2, 0.2, 0.4)
TrajOptSOCPs.solParamPrint(currSolveParams)
For more information, see
TrajOptSOCPs.solverParams
— TypeLine Search Parameters (Notation from Toussaint Notes (2020))
paramA::Float16
# Used in Line Search, should be [0.01, 0.3]
paramB::Float16
# Used in Line Search, should be [0.1, 0.8]
Iteration Counter Parameters
maxOuterIters::Int32
# Number of Outer Loop iterations
maxNewtonSteps::Int32
# Number of Newton Steps per Outer Loop iterations
Exit Condition Parameter
rTol::Float64
# When steps are within rTol, loop will stop.
Penalty Update Parameters
penaltyStep::Float16
# Multiplies the penalty parameter per outer loop
penaltyMax::Float64
# Maximum value of the penalty parameter
Trust Region Parameters (Notation from Nocedal et Yuan (1998))
trSizeStart::Float32
# Starting size of the trust region
trc1::Float16
# Success Size Increase Parameter (1 < c1)
trc2::Float16
# Taylor Series Error Parameter (0 < c2 < 1)
trc3::Float16
# Failed Size Reduction Parameter (0 < c3 < c4)
trc4::Float16
# Failed Size Reduction Parameter (c3 < c4 < 1)
TrajOptSOCPs.solParamPrint
— FunctionPrints the struct variables in the solverParams
struct.
See also: solverParams
for more information.
Solve it!
At last, we can solve the problem!
# Initialize the primal-dual vector
# initTraj is from the rocket guess trajectory
# lambdaInit is from the dynamics constraints
initTrajPD = [initTraj; lambdaInit]
trajLambdaSolved, resArr = ALPrimalNewtonMain(initTrajPD, alRocket, currSolveParams)
For more information, see
TrajOptSOCPs.ALPrimalNewtonMain
— FunctionALPrimalNewtonMain(y0, al::augLag, sp::solverParams)
Performs a maximum on N
outer steps as specified by solverParams
. May return early if the residual is lower than the tolerance specified by solverParams
and the constraint penalty is high enough.
The function operates on an augmented lagrangian (AL) with primals (P) only (as opposed to a Primal-Dual set-up) for second-order cone programs (SOCP). See newtonTRLS_ALP
for more information on the Newton Steps
returns (yStates, residuals) which are:
yStates
: An array with one entry of the primal vector per Newton stepresiduals
: An array with one entry of the residual vector per Newton step
See also: augLag