tbpsg_solution function returns part of PSG solution according to key word.
Syntax
[output] = tbpsg_solution(solution_str, outargstruc_arr,kew_word)
Description
[output] = tbpsg_solution(solution_str, outargstruc_arr,kew_word) returns the solution details of an optimization problem extracted from the solution reports solution_str and outargstruc_arr reported by tbpsg_run.
Input Arguments
solution_str |
string with solution report; |
outargstruc_arr |
array of output PSG data structures; |
kew_word |
key word that specify object to be displayed. |
Output Arguments
output |
array or cell array of outputs depends on kew_word |
kew_word |
Output |
---|---|
solution_status |
optimal / feasible / infeasible / calculated |
objective |
value of objective |
constraint |
value of constraints |
function |
value of functions |
function_name |
names of functions |
time |
[solving_time, data_loading_time, preprocessing_time] |
optimal_point_data |
value of optimal point |
optimal_point_vars |
header of optimal points |
point_constraints_data |
values of constraints |
point_constraints_vars |
names of constraints |
point_slack_constraint_data |
values of slacks of constraints |
point_dual_constraint_data |
values of dual constraints |
vector_constraints_data |
sell array with values of constraints in the case of vector constraint |
vector_slack_data |
sell array with values of slacks in the case of vector constraint |
vector_dual_data |
sell array with values of dual constraints in the case of vector constraint |
matrix_data |
value of ouput matrices |
matrix_vars |
header of ouput matrices |
vector_data |
value of output vectots |
Example
CVaR problem is defined in section Quick Start with PSG Toolbox.
Open PSG Toolbox:
>> tbpsg_toolbox
Load in PSG Toolbox problem from file .\Aorda\PSG\MATLAB\Examples\Toolbox\problem_cvar.mat
Open in PSG Toolbox menu "Save to Workspace" and save problem statement and toolbox structure to Workspace variables problem_statement and toolboxstruc_arr.
Optimize problem using tbpsg_run:
[solution_str,outargstruc_arr]=tbpsg_run(problem_statement, toolboxstruc_arr);
Check solution optimality:
>> output = tbpsg_solution(solution_str, outargstruc_arr,'solution_status')
output =
'optimal'
Extract optimal point from the solution reports:
>> output = tbpsg_solution(solution_str, outargstruc_arr,'optimal_point_data')
output =
0 0.6000 0.1900 0.2100
Special cases of tbpsg_solution function:
Function |
Description |
---|---|
checks is the solution of optimization problem optimal or not; |
|
objective value from the solution report; |
|
functions value from the solution report; |
|
names of functions used in problem; |
|
time of preprocessing and solution problem from the solution report; |
|
data of all points for solved optimization problem; |
|
header (names of variables) of all points for solved optimization problem; |
|
data of optimal point for solved optimization problem; |
|
header (names of variables) of optimal point for solved optimization problem; |
|
values of constraints; |
|
names of constraints; |
|
values of slacks of constraints; |
|
values of dual constraints; |
|
sell array with values of constraints in the case of vector constraint; |
|
sell array with values of slacks in the case of vector constraint; |
|
sell array with values of dual constraints in the case of vector constraint; |
|
data of matrices for solved optimization problem; |
|
headers (names of variables) of matrices for solved optimization problem; |
|
data of vectors for solved optimization problem. |
See also