forked from Future-Power-Networks/Simplus-Grid-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjCheckDim.m
28 lines (24 loc) · 811 Bytes
/
ObjCheckDim.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% This function checks if the model dimension obtained from the descritptor
% state space model matches the dimension that obtained from strings.
% Author(s): Yitong Li
%%
function [lx,lu,ly] = ObjCheckDim(Obj)
% Calculate the dimension from dss model
[~,ModelDss] = Obj.GetDSS(Obj);
[lx,lu,ly] = SimplusGT.DssGetDim(ModelDss);
% Calculate the dimension from strings
[StateString,InputString,OutputString] = Obj.GetString(Obj);
lx_ = length(StateString);
lu_ = length(InputString);
ly_ = length(OutputString);
% Compare
if (lx_~=lx)
error(['Error: state dimiension mismathch']);
end
if (lu_~=lu)
error(['Error: input dimiension mismathch']);
end
if (ly_~=ly)
error(['Error: output dimiension mismathch']);
end
end