Cut operation splits a PSG Matrix to a set of PSG Matrices with an equal number of rows.
Syntax
cut(N,input_matrix ) |
Parameters
input_matrix |
name of input Matrix; |
N |
number of generated PSG Matrices (with an equal number of rows in every PSG Matrix). |
Remarks
• | Cut operation is used in functions defined on multiple matrices with the same headers, and equal number of rows. In this case, an input matrix for Cut operation is constructed by combining N matrices in one large matrix. |
• | Cut operation, for instance, is used in functions: |
Description
cut(N,input_matrix) operation splits input PSG Matrix
to N matrices with an equal number of rows:
matrix_1
matrix_2
................................................................................................
matrix_N
where .
Example
Operation cut splits matrix_34 into 2 matrices (matrix_3, matrix_4):
matrix_34:
x1 |
x2 |
x4 |
scenario_benchmark |
1 7 -2 0 2 -3 0 -2 |
4 -5 8 -3 -1 6 11 5 |
3 -6 0 9 1 -7 -3 9 |
-2 11 6 10 15 -1 40 7 |
The matrix_34 is in file matrix_34.txt in PSG Matrix format (see, PSG Matrix in General (Text) Format).
matrix_3:
x1 |
x2 |
x4 |
scenario_benchmark |
1 7 -2 0 |
4 -5 8 -3 |
3 -6 0 9 |
-2 11 6 10 |
The matrix_3 is in file matrix_3.txt in PSG Matrix format (see, PSG Matrix in General (Text) Format).
matrix_4:
x1 |
x2 |
x4 |
scenario_benchmark |
2 -3 0 -2 |
-1 6 11 5 |
1 -7 -3 9 |
15 -1 40 7 |
The matrix_4 is in file matrix_4.txt in PSG Matrix format (see, PSG Matrix in General (Text) Format).
Next, we consider two equivalent methods of calculation cvar_max_risk function:
• | Using the cut operation: |
Function call: cvar_max_risk(0.65, cut(2,matrix_34)).
at point_1:
component_name |
value |
x1 x2 x4 |
1 1 1 |
The point point_1 is in file point_1.txt (see, PSG Point).
To calculate cvar_max_risk at point_1 run problem in file problem_cut_cvar_max_risk_test.txt (see, Calculate Problem):
calculate
point: point_1
value:
cvar_max_risk(0.65, cut(2,matrix_34))
Value of cvar_max_risk(0.65, cut(2,matrix_34)) at point_1 equals 2.714.
• | Without using the cut operation: |
Function call: cvar_max_risk(0.65, matrix_3,matrix_4).
at point_1:
component_name |
value |
x1 x2 x4 |
1 1 1 |
The point point_1 is in file point_1.txt (see, PSG Point).
To calculate cvar_max_risk at point_1 run problem in file problem_cvar_max_risk_test.txt (see, Calculate Problem):
calculate
point: point_1
value:
cvar_max_risk(0.65, matrix_3, matrix_4)
Value of cvar_max_risk(0.65, matrix_3, matrix_4) at point_1 equals 2.714.
Files problem_cut_cvar_max_risk_test.txt, problem_cvar_max_risk_test.txt, matrix_34.txt,matrix_3.txt, matrix_4.txt and point_1.txt are in folder .\Aorda\PSG\Examples\Functions\cut_cvar_max_risk_test.
Case Studies with Cut Operation
See also