FORCES Pro gives you full control over the part of the solution that should be outputted by the solver. It is also possible to obtain the Lagrange multipliers of certain constraints. To define a standard output as a slice of the primal solution vector, use the function
output = newOutput(name, maps2stage, idxWithinStage)
stages.newOutput(name, maps2stage, idxWithinStage)
where name is the name you give to the output (you will need this to read it after calling the solver). The index vector (or integer) maps2stage defines to which stage this output maps to. The last argument, idxWithinStage allows the user to select which indices from the stage vector should be outputted by the solver.
To define an output as a slice of certain Lagrange multipliers, use the function
output = newOutput(name, maps2stage, idxWithinStage, maps2const)
stages.newOutput(name, maps2stage, idxWithinStage, maps2const)
where the remaining argument maps2const specifies the constraint associated with the Lagrange multipliers being requested.
Possible string values for argument maps2const
To define an output to be the first two elements of the primal solution vector, use the following command:
output1 = newOutput('u0', 1, 1:2)
stages.newOutput('u0', 1, range(1,3))
To define an output to be the first and third indices of the Lagrange multipliers for the equality constraints of the second stage, use the following command:
output2 = newOutput('dual_eq0', 2, [1 3], 'r')
stages.newOutput('dual_eq0', 2, list(1,3), 'r')