Example: Function call:   prmulti_ni_dev(-5, matrix_1, matrix_5). Parameter  = -5 and matrix_1:

 

x1

x2

x3

x4

scenario_benchmark

scenario_probability

1

7

4

-5

8

4

3

-6

-2

11

0.4

0.6

 

matrix_5:

 

x1

x2

x3

x4

scenario_benchmark

11

7

3

2

2

6

0

16

9

1

 

at point_1:

 

component_name

value

x1

x2

x3

x4

1

1

1

1

 

MATLAB code (.\Aorda\PSG\MATLAB\Examples\Func_value_prmulti_ni_dev.m) for function calculation:

 

%Calculation of functions with PSG Subroutine 'functionvalue'

%Define data:

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

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

c1 = [-2;11];

p1 = [0.4;0.6];

H2 = [11 3 2 0;7 2 6 16];

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

c2 = [9;1];

a = [1;1;1;1];

%Calculate prmulti_ni_dev function with parameter -5 at point 'a':

val1 = functionvalue('prmulti_ni_dev', -5, {H1 ,H2}, {c1 ,c2}, {p1 ,[]}, a);

%Display function value:

disp(sprintf('functionvalue = %g', val1));

%=======================================================================

%Calculation of functions with PSG Subroutine 'mpsg_function_value'

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

iargstruc_arr(1) = matrix_pack('matrix_1', H1, [],  c1, p1);

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

iargstruc_arr(2) = matrix_pack('matrix_2', H2, [],  c2, []);

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

iargstruc_arr(3) = point_pack('point_1', a, []);

%Calculate prmulti_ni_dev function with parameter -5 at point 'point_1':

val2 = mpsg_function_value('prmulti_ni_dev(-5,matrix_1,matrix_2)','point_1',iargstruc_arr);

%Display function value:

disp(sprintf('mpsg_function_value = %g', val2));

 

 

Program output:

 

functionvalue = 0.970113

mpsg_function_value = 0.970113