Example: Function call: ksm_max(matrix_kx, vector_yi, vector_qi).

 

matrix_kx:

 

s1

s2

s3

s4

s5

s6

s7

s8

scenario_benchmark

2

-1

1

15

12

34

17

94

2

 

vector_yi:

 

id

value

1

2

3

4

5

6

-2

0

1

5

7

11

 

vector_qi:

 

id

value

1

2

3

4

5

6

0.1

0.2

0.15

0.15

0.3

0.1

 

at point_mn:

 

component_name

value

s1

s2

s3

s4

s5

s6

s7

s8

0.125

0.125

0.125

0.125

0.125

0.125

0.125

0.125

 

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

 

%Define data:

H1 = [2 -1 1 15 12 34 17 94];

c1 = 2;

V1 = [-2,0,1,5,7,11];

V2 = [0.1,0.2,0.15,0.15,0.3,0.1];

a = [0.125;0.125;0.125;0.125;0.125;0.125;0.125;0.125];

%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, []);

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

iargstruc_arr(2) = vector_pack('vector_yi', V1);

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

iargstruc_arr(3) = vector_pack('vector_qi', V2);

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

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

%Calculate ksm_max function at point 'point_1':

val1 = mpsg_function_value('ksm_max(matrix_1,vector_yi,vector_qi)','point_1',iargstruc_arr);

%Display function value:

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

 

Program output:

 

mpsg_function_value = 6.25e-001

 

This function can't be evaluated with PSG Subroutine 'functionvalue' because input matrices include different variables