tbpsg_run function solves a problem prepared in PSG Toolbox.
Syntax
[solution_str,outargstruc_arr] = tbpsg_run(problem_statement, toolboxstruc_arr)
Description
[solution_str,outargstruc_arr] = tbpsg_run(problem_statement, toolboxstruc_arr)solves an optimization problem prepared in PSG Toolbox and specified by problem statement problem_statement, and data stored in structure toolboxstruc_arr.
Input Arguments
problem_statement |
string with description of optimization problem (see Problem Statement); |
toolboxstruc_arr |
array of PSG data structures (see PSG Data Objects). |
Output Arguments
solution_str |
string with solution report; |
outargstruc_arr |
array of output PSG data structures. |
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.
MATLAB command to optimize the problem:
[solution_str,outargstruc_arr]=tbpsg_run(problem_statement, toolboxstruc_arr);
Output:
solution_str =
Problem: solution_status = optimal
Timing: Data_loading_time = 0.01, Preprocessing_time = 0.00, Solving_time = 0.00
Variables: optimal_point = point_
Objective: = -4.350000000000
Constraint: = 1.000000000000e+000, [-4.440892098501e-016]
Constraint: = 4.500000000000e+000, [0.000000000000e+000]
Function: avg_g(matrix_scenarios) = 4.500000000000e+000
Function: cvar_risk_example(0.95,matrix_scenarios) = -4.350000000000e+000
Function: linear(matrix_budget) = 1.000000000000e+000
outargstruc_arr =
object_name: 'point_problem_1'
variables: 'x1 x2 x3 x4'
type: 'point'
values: [0 0.6000 0.1900 0.2100]
See also
tbpsg_toolbox, tbpsg_vars, tbpsg_solution, tbpsg_solution_struct