grow_polytope.m

来自「一个matlab的将军模型」· M 代码 · 共 29 行

M
29
字号
function box = grow_polytope(CE,dE,CI,dI,tmp)

%This function will 'grow' a polytope that has a dimension less than n. 
%The 'sizetol' parameter that is specified by the user in the parameter m-file
%is used as the size to grow the polytope.  If this parameter is not specified,
%then the default of 1e-4 is used.

global GLOBAL_AUTOMATON
global GLOBAL_PIHA
global GLOBAL_APPROX_PARAM

delta = GLOBAL_APPROX_PARAM.grow_size;


for i=1:length(dE)
   CI=[CE(i,:) ; CI];
   dI=[dE(i)+delta ; dI];
   CI=[-CE(i,:) ; CI];
   dI=[-( dE(i)-delta ) ; dI];
end

state_region=GLOBAL_AUTOMATON{tmp(1)}.interior_region{tmp(2)}.state{tmp(3)}.polytope;

[d,c,CI_state,dI_state]=linearcon_data(state_region);

box=linearcon(d,c,[CI ; CI_state],[dI ; dI_state]);
box=clean_up(box);

return

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?