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

 

Special cases of tbpsg_solution function:

 

Function

Description

tbpsg_isoptimal

checks is the solution of optimization problem optimal or not;

tbpsg_objective

objective value from the solution report;

tbpsg_function_data

functions value from the solution report;

tbpsg_function_names

names of functions used in problem;

tbpsg_time

time of preprocessing and solution problem from the solution report;

tbpsg_point_data

data of all points for solved optimization problem;

tbpsg_point_vars

header (names of variables) of all points for solved optimization problem;

tbpsg_optimal_point_data

data of optimal point for solved optimization problem;

tbpsg_optimal_point_vars

header (names of variables) of optimal point for solved optimization problem;

tbpsg_constraints_data

values of constraints;

tbpsg_constraints_vars

names of constraints;

tbpsg_slack_data

values of slacks of constraints;

tbpsg_dual_data

values of dual constraints;

tbpsg_vector_constraint_data

sell array with values of constraints in the case of vector constraint;

tbpsg_vector_dual_data

sell array with values of slacks in the case of vector constraint;

tbpsg_vector_dual_data

sell array with values of dual constraints in the case of vector constraint;

tbpsg_matrix_data

data of matrices for solved optimization problem;

tbpsg_matrix_vars

headers (names of variables) of matrices for solved optimization problem;

tbpsg_vector_data

data of vectors for solved optimization problem.

 

See also

tbpsg_toolbox, tbpsg_vars, tbpsg_run, tbpsg_solution_struct