Example: Function call:  ro_err(matrix_1, matrix_coeff).

 

matrix_1:

 

x1

x2

x3

x4

scenario_benchmark

scenario_probability

1

7

-2

0

4

-5

8

-3

8

4

-1

-4

3

-6

0

9

-2

11

6

10

0.2

0.2

0.3

0.3

 

matrix_coeff:

 

c1

c2

c3

c4

0.25

0.92

0.25

0.94

0.25

0.96

0.25

0.98

 

 

MATLAB code (./PSG/Example/Func_value_ro_err.m) for function minimization:

 

%Define data:

H1 = [1 4 8 3;7 -5 4 -6;-2 8 -1 0;0 -3 -4 9];

header_1 = {'x1', 'x2', 'x3', 'x4'};

c1 = [-2;11;6;10];

p1 = [0.2;0.2;0.3;0.3];

 

H2 = [0.25 0.25 0.25 0.25;0.92 0.94 0.96 0.98];

header_2 = {'c1', 'c2', 'c3', 'c4'};

 

%Create the PSG matrix 'matrix_1'(structure containing header and matrix body) and pack it to structure 'iargstruc_arr':

iargstruc_arr(1) = tbpsg_matrix_pack('matrix_1', H1, header_1,  c1, p1);

%Create the PSG matrix 'matrix_2'(structure containing header and matrix body) and pack it to structure 'iargstruc_arr':

iargstruc_arr(2) = tbpsg_matrix_pack('matrix_coef', H2, header_2);

 

%Create problem statement:

problem_statement = sprintf('%s\n',...

'minimize',...

'  ro_err(matrix_1,matrix_coef)',...

'');

 

%Minimize ro_err function with parameter 0.65 :

[solution_str, outargstruc_arr] = tbpsg_run(problem_statement, iargstruc_arr);

%Extract value of function from solution report:

val = tbpsg_function_data(solution_str, outargstruc_arr);

%Extract values of output points:

output = tbpsg_point_data(solution_str, outargstruc_arr);

%Display function value:

disp(' ')

disp(sprintf('ro_err function value = %g', val(1)));

disp(' ')

disp(sprintf('Pseudo R2 = %g', val(2)));

disp(' ')

disp('Contributions (normed increments) = ');

disp(output{2})

 

 

Program output:

 

ro_err function value = 1.36502e-013

 

Pseudo R2 = 1

 

Contributions (normed increments) =

   0.4576    0.2558    0.1430    0.1436