亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? spl_sim.m

?? 一個matlab的將軍模型
?? M
字號:
function spl_sim
% Function  	: spl_sim                          
% Credate   	: 06/02/00		                  
% CURDATE		: 06/02/00   
% Description	: This function draw the polytope starting in one
%					  given region for some uncertainty and time step
%                using GLOBAL_PIHA, GLOBAL_AUTOMATON and
%					  GLOBAL_TRANSITIONS structures


% record initial time stamp
time = cputime;

% using all data from data structure
global_var;

% clear figure and make initial arrangements to plot
clf;
hold on;

%  Load  GLOBAL_PIHA.InitialLocation to initloc                         %
initloc = length(GLOBAL_AUTOMATON{1}.initstate);
%GLOBAL_PIHA.InitialLocations;

  %Plot polytopes of initloc using GLOBAL_AUTOMATON    						%
for i=1:length(initloc)
   plot(GLOBAL_PIHA.InitialContinuousSet{i})
   hold on ;
end

END = 0;

actloc   = unique(initloc);
nextloc  = [];
plotloc  = [];
counter  = 1;
oldloc   = [];
omniloc = unique(initloc);

%  Plot 'tree' of polytopes using GLOBAL_AUTOMATON    						%
while  ~END
   for i=1:length(actloc)
     plotloc = [plotloc GLOBAL_TRANSITION{actloc(i)}];   
   end
   plotloc = unique(setdiff(plotloc,omniloc));
   omniloc  = unique([omniloc plotloc]);
   if isempty(plotloc)
      END =1;
   else
  		actloc  = plotloc;
      plotloc= [];
      counter = counter + 1;
      fprintf(1,'Depth #%4.0f \n',counter)
      fprintf('Drawing  polytopes, please wait... ');%
      for i=1:length(actloc)
         var_location 	= GLOBAL_XSYS2AUTO_MAP{actloc(i)}(1);
  			if ~(strcmp(var_location,'terminal'))& ~(strcmp(var_location,'out_of_bound'))&~(strcmp(var_location,'null_event'));
   			var_face			= GLOBAL_XSYS2AUTO_MAP{actloc(i)}(2);
            var_state		= GLOBAL_XSYS2AUTO_MAP{actloc(i)}(3);
            hold on;
            plot(GLOBAL_AUTOMATON{var_location}.face{var_face}.state{var_state}.polytope,[1 0 0]);%[sqrt(i)/i (length(actloc) - i)/length(actloc) log(i+1)/(i+1)]);
 %           if 7
 %              fprintf('transition %4.0f Location %4.0f face %4.0f state %4.0f\n',actloc(i),var_location,var_face,var_state);
 %              pause;
 %           end
        elseif (strcmp(var_location,'out_of_bound'))
            fprintf('Location %4.0f is out_of_bound\n',actloc(i));
 				%save locat actloc;
        end
      end
      fprintf('done! \n');
      %pause;
  end
end
nextloc = omniloc;
Elapsed_time = cputime - time



% SECOND PART
% This part was used to draw flowpipes. It's not used anymore
if 1
   
% Initializing data from system dynamics.
   A_plus = [-1  1  1;...
        		-1  0  0;...
        		-1  1  0];
   A_minus = [ -1  1  1;...
        			0.5 -1  0;...
		         -1  1  0];
%A_plus =[ -3.3216            -25.736            0.0;...
%          25.736              -3.3216           0.0;...
%           3.14631            -5.10887    0.0];
%
%A_minus =[-3.3216           -25.736            0.0;...
%          25.736             -3.3216           0.0;...
%           3.14631            -5.10887    0.0];

B = [0;0;0];
T = 0.5;
N = 4;
Ninterval = 5;
hard_calc= 0; 
   
fprintf('Press any key to draw flowpipe...\n');
pause
fprintf('Drawing  flowpipes, please wait... \n');
for i=1:length(nextloc)
  var_location 	= GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(1);
  if ~(strcmp(var_location,'terminal'))&~(strcmp(var_location,'null_event'))&~(strcmp(var_location,'out_of_bound'))
      if ismember(var_location,GLOBAL_XSYS2AUTO_MAP{GLOBAL_PIHA.InitialLocations}(1))
         X0=GLOBAL_PIHA.InitialContinuousSet{1};
         %X0=GLOBAL_AUTOMATON{i}.initstate{length(GLOBAL_AUTOMATON{i}.initstate)}.polytope;		
      else   
       	var_face			= GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(2);
      	var_state		= GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(3);
     		X0=GLOBAL_AUTOMATON{var_location}.face{var_face}.state{var_state}.polytope;
      end
      [AM,b] = overall_system_matrix(GLOBAL_PIHA.SCSBlocks, ...
        GLOBAL_PIHA.Locations{var_location}.q);
  		if rank(AM) == size(AM,1)
		  Ainv = inv(AM);
		else
		  Ainv = [];
		end
      inv = location_invariant(var_location);
      [CE,dE,CI,dI] = linearcon_data(inv);
      [Xsim,Tstamp,Telapsed]= compute_flow_sim(AM,Ainv,b,X0,inv,T);
      Xini = X0;
      Vini = vertices(Xini);
    	eAT = expm(AM*Telapsed/Ninterval);
 		displacement = step_response(AM,Ainv,b,Telapsed/Ninterval);
      for k = 1:Ninterval
    		Vk = transform(Vini,eAT,displacement);
    		Xk = transform(Xini,eAT,displacement);
         CH = polyhedron(Vini|Vk);
         plot(CH,[0.5 0.7 0.6]);
         Vini = Vk;
         Xini = Xk;
      end
      if ~hard_calc
      	eAT = expm(AM*Tstamp);
 			displacement = step_response(AM,Ainv,b,Tstamp);
      	Xpoly  = transform(Xsim,eAT,displacement);
         REG2 	 = polyhedron(vertices(Xsim)|vertices(Xpoly));
         CI 	 = get_param(REG2,'CI'); 
         dI 	 = get_param(REG2,'dI'); 
         REG	 = linearcon([],[],CI,dI);
      else
         REG = psim_lin(AM,b,Xsim,Tstamp,1);
      end
     	for j=1:length(REG)
        	plot(inv&REG(j),[.7 .7 .6]);%[i*0.0005 j*0.2 0.8])
      end
	end
   fprintf(1,'Iteration # %4.0f \n',i)
end
fprintf('done! \n');
pause
end

return
% -----------------------------------------------------------------------------

function [Xsim,Tstamp,Telapsed] = compute_flow_sim(A,Ainv,b,X0,inv,T)

% simulate the dynamics  for each vertice, finding the new set of points
% where vector field leaves the invariant. Only for a `linear` dynamics.
%
% Syntax:
%   "[Xsim,Tstamp] = compute_flow_sim(A,Ainv,b,X0,CI,dI,T)"
%
% Description:
%   Simulate each vertice, approximating the time when trajectory crosses
%   any hyperplane. Returns:
%
%   - The new vertices (For the time when first trajectory hits a hyperplane)
%   
%   - Time stamp between the first and the last crossing of any hyperplane
%
%    The inputs to this function are
%
%   * "A": the system matrix
%
%   * "Ainv": the inverse of "A" if it exists, otherwsie it should be
%     "[]"
%
%   * "b": constant input vector for the affine dynamics
%
%   * "X0": a "linearcon" object represeting the initial set
%
%   * inv: invariant (linearcon object)
%
%   * "T": the time step for the trajectory
%
%   The output "Xsim" is a "linearcon" object,(a polytope) representing the
%   transformed segment approximation. "Tstamp" is a real number recording the
%   time stamp for the flowpipe which englobes the intersection region with 
%   the invariant.
%
% Implementation:
%   To approximate the segment, we do the following:
%   
%   1) simulate the points until the first trajectory hits a hyperplane. 
%      Record the value of the vertices at that time and also the time value.
%
%   2) continue simulation until the last trajectory  hits a hyperplane.
%      Record the time value.
%
%    The simulation of each point uses the following expression:
%
%   "x(T) = e^{A*T}*x(0) + inv(A)*(e^{A*T} - I)*b"
%
% See Also:
%   stretch_func_lin,step_response,psim_lin,fs_lin_map,linearcon,transform,
%   clean_up

timing = 0;
init_T = T;
max_counter = 5;
status=[];%approx_param.max_bissection;
%eAT 	 = expm(A*T);
%displacement = step_response(A,Ainv,b,T);

% Transfrom sample points by eAT
crossing = 0;
bissection_counter = 0;

status  = check_crossing(X0,inv);
if strcmp(status,'outside') | strcmp(status,'partially')
   crossing = 1;
   bissection_counter = max_counter;
   fprintf(1,'initial set has 1 or more vertices outside (or in the border) of the invariant\n')
end
while (~crossing) | (bissection_counter <= max_counter)
	eAT 	 = expm(A*T);
	displacement = step_response(A,Ainv,b,T);
   Xt = transform(X0,eAT,displacement);
   % Check if any point cross a hyperplane
   status = check_crossing(Xt,inv);
   if strcmp(status,'inside')
   	X0 = Xt;   
      crossing = 0;
      timing = timing + T;
   else
      crossing = 1;
      T = T/2;
      bissection_counter = bissection_counter + 1;
   end
end
Telapsed = timing;
Xsim = X0;
T = init_T;
all_crossing = 0;
bissection_counter = 0;
time_stamp = 0;
while (~all_crossing) | (bissection_counter <= max_counter)
	eAT 	 = expm(A*T);
	displacement = step_response(A,Ainv,b,T);
   Xt = transform(X0,eAT,displacement);
   % Check if all point cross a hyperplane
   status = check_crossing(Xt,inv);
   if strcmp(status,'outside')
      all_crossing = 1;
      bissection_counter = bissection_counter + 1;
      if (bissection_counter > max_counter)
         time_stamp = time_stamp + T;
      end
      T = T/2;
   else
      X0 = Xt;
      time_stamp = time_stamp + T;
      all_crossing = 0;
   end
end
Tstamp = time_stamp;

return

% -----------------------------------------------------------------------------

function status = check_crossing(Xt,inv)

% Check whether any point of Vt cross the boundary of the invariant INV.
%
% Xt               : Region to be tested (linearcon object)
% inv              : Invariant.
% 
% Returns:
%
% status				: An string informing if the whole set is "inside","outside" or "partially".
%						  status returns 'error' whether Xt or inv is empty.

if isempty(Xt) | isempty(inv)
   status = 'error';
   fprintf(1,'Check_crossing routine: invariant or region is empty \n')
else
   if ~isfeasible(Xt,inv)
   	status = 'outside';
	elseif isempty(minus(Xt,Xt&inv))
      status = 'inside';
   else     
      status = 'partially';
   end
end     
return

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区欧美一区| 久久99久久99小草精品免视看| 亚洲成人精品在线观看| 久久成人免费网| 在线一区二区三区| 久久免费午夜影院| 偷偷要91色婷婷| 91麻豆免费看| 久久久精品国产免费观看同学| 一区二区三区精密机械公司| 国模娜娜一区二区三区| 欧美一区二区三区色| 亚洲欧美激情小说另类| 国模少妇一区二区三区| 在线电影国产精品| 亚洲美女屁股眼交3| 国产成人精品三级麻豆| 精品国产亚洲一区二区三区在线观看| 亚洲免费在线观看视频| 国产91丝袜在线18| 精品精品欲导航| 秋霞国产午夜精品免费视频| 在线亚洲一区观看| 亚洲激情一二三区| 91久久免费观看| 自拍偷拍国产精品| 99精品国产一区二区三区不卡| 国产视频一区不卡| 国产九色sp调教91| www国产成人免费观看视频 深夜成人网| 午夜精品影院在线观看| 欧美最新大片在线看| 亚洲激情图片小说视频| 91行情网站电视在线观看高清版| 亚洲手机成人高清视频| 色综合天天狠狠| 国产精品国产自产拍高清av| 国产高清无密码一区二区三区| 久久久久久久久久电影| 国产精品自拍av| 国产日韩一级二级三级| 国产成人一级电影| 国产精品白丝在线| 91蝌蚪porny成人天涯| 亚洲一区二区三区影院| 欧美日韩激情一区二区| 奇米色777欧美一区二区| 日韩视频免费直播| 激情综合网天天干| 中文字幕乱码日本亚洲一区二区| 粉嫩欧美一区二区三区高清影视| 国产视频一区在线观看| 色呦呦日韩精品| 亚洲成av人片一区二区| 欧美成人aa大片| 国产成人av电影在线| 亚洲少妇最新在线视频| 欧美日韩在线不卡| 精品一区二区三区香蕉蜜桃| 精品免费日韩av| 97se亚洲国产综合自在线不卡| 亚洲欧美激情插 | 欧美一区二区网站| 精品一区二区在线看| 亚洲欧洲精品成人久久奇米网| 91成人免费电影| 久久99精品一区二区三区 | 337p亚洲精品色噜噜噜| 国产伦精品一区二区三区在线观看| 欧美—级在线免费片| 日本高清免费不卡视频| 激情久久久久久久久久久久久久久久| 国产精品国产三级国产aⅴ中文| 在线看日本不卡| 国内成+人亚洲+欧美+综合在线| 亚洲同性gay激情无套| 日韩欧美国产1| 91浏览器入口在线观看| 国产乱人伦偷精品视频免下载| 亚洲黄色av一区| 久久网站热最新地址| 欧美一级艳片视频免费观看| 高清视频一区二区| 免费在线观看一区| 樱桃视频在线观看一区| 久久久久免费观看| 在线播放国产精品二区一二区四区 | 国产欧美精品国产国产专区| 精品视频全国免费看| 国产99久久久国产精品| 免费欧美日韩国产三级电影| 亚洲欧美日韩国产手机在线| 久久日一线二线三线suv| 欧美日韩五月天| 日本精品裸体写真集在线观看 | 日本大胆欧美人术艺术动态| 亚洲乱码国产乱码精品精的特点| 26uuu国产一区二区三区| 欧美精品久久一区| 欧美综合一区二区三区| 成人av集中营| 国产白丝网站精品污在线入口| 日韩精品一二区| 午夜视频在线观看一区二区| 亚洲人成网站在线| 综合在线观看色| 久久奇米777| 欧美成人在线直播| 91精品国产综合久久久久久久| 在线看一区二区| 精品视频在线视频| 欧美性生活大片视频| 国产女主播在线一区二区| 精品日韩欧美在线| 日韩一区二区三区四区五区六区| 欧美精品粉嫩高潮一区二区| 欧洲精品视频在线观看| 日本韩国精品一区二区在线观看| 91亚洲男人天堂| 91免费看`日韩一区二区| 91免费小视频| 在线观看三级视频欧美| 欧美日韩一级片网站| 精品视频在线免费| 555www色欧美视频| 日韩精品一区二区三区中文精品| 欧美一区二区三区啪啪| 日韩欧美在线1卡| 欧美成人在线直播| 国产欧美日韩另类视频免费观看| 久久综合狠狠综合| 国产欧美精品一区aⅴ影院| 国产精品美女久久久久久久久久久| 久久久久国产精品麻豆| 国产欧美一区二区精品仙草咪| 久久香蕉国产线看观看99| 国产三级精品三级| 亚洲精品国产a久久久久久| 午夜精品久久久久久久 | 美女一区二区在线观看| 激情综合色播激情啊| 成人丝袜18视频在线观看| 色网站国产精品| 欧美一级理论片| 欧美激情一区二区三区在线| 亚洲人成人一区二区在线观看| 亚洲国产成人精品视频| 久久国产日韩欧美精品| 成人午夜免费视频| 欧美少妇bbb| 久久久一区二区三区捆绑**| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产成人免费在线观看不卡| 99久久婷婷国产综合精品| 欧美色涩在线第一页| 亚洲精品一区二区三区精华液| 亚洲国产精品精华液2区45| 亚洲国产综合视频在线观看| 蓝色福利精品导航| 91蜜桃网址入口| 4438亚洲最大| 一区二区中文字幕在线| 男女男精品网站| 在线观看视频91| 国产欧美日韩另类一区| 日本成人在线电影网| 97久久久精品综合88久久| 日韩欧美国产麻豆| 一区视频在线播放| 国内外成人在线| 日韩亚洲欧美在线| 国产精品视频线看| 激情成人午夜视频| 欧美日韩国产片| 亚洲欧美电影院| 国产激情一区二区三区| 欧美一区二区视频在线观看| 国产真实乱对白精彩久久| 欧美日韩美少妇| 中文字幕一区视频| 韩国v欧美v亚洲v日本v| 中文字幕不卡的av| 国产成人自拍网| 欧美变态口味重另类| 欧美高清激情brazzers| 亚洲蜜臀av乱码久久精品蜜桃| 精品免费国产二区三区| 亚洲网友自拍偷拍| 欧美这里有精品| 亚洲一区二区三区四区的| 日本一区二区免费在线观看视频| 亚洲女同一区二区| 97精品电影院| 国产中文一区二区三区| 亚洲午夜久久久久久久久电影网| 国产精品影视天天线| 欧美大胆人体bbbb| 老司机精品视频导航| 日韩天堂在线观看| 寂寞少妇一区二区三区|