⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colas_pi.m

📁 国外经典书籍MULTIVARIABLE FEEDBACK CONTROL-多变量反馈控制 的源码
💻 M
字号:
function [ret,x0,str,ts,xts]=colas_PI(t,x,u,flag);%COLAS_PI	is the M-file description of the SIMULINK system named COLAS_PI.%	The block-diagram can be displayed by typing: COLAS_PI.%%	SYS=COLAS_PI(T,X,U,FLAG) returns depending on FLAG certain%	system values given time point, T, current state vector, X,%	and input vector, U.%	FLAG is used to indicate the type of output to be returned in SYS.%%	Setting FLAG=1 causes COLAS_PI to return state derivatives, FLAG=2%	discrete states, FLAG=3 system outputs and FLAG=4 next sample%	time. For more information and other options see SFUNC.%%	Calling COLAS_PI with a FLAG of zero:%	[SIZES]=COLAS_PI([],[],[],0),  returns a vector, SIZES, which%	contains the sizes of the state vector and other parameters.%		SIZES(1) number of states%		SIZES(2) number of discrete states%		SIZES(3) number of outputs%		SIZES(4) number of inputs%		SIZES(5) number of roots (currently unsupported)%		SIZES(6) direct feedthrough flag%		SIZES(7) number of sample times%%	For the definition of other parameters in SIZES, see SFUNC.%	See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.% Note: This M-file is only used for saving graphical information;%       after the model is loaded into memory an internal model%       representation is used.% the system will take on the name of this mfile:sys = mfilename;new_system(sys)simver(1.3)if (0 == (nargin + nargout))     set_param(sys,'Location',[59,72,853,623])     open_system(sys)end;set_param(sys,'algorithm',     'Gear')set_param(sys,'Start time',    '0.0')set_param(sys,'Stop time',     '200')set_param(sys,'Min step size', '0.01')set_param(sys,'Max step size', '5')set_param(sys,'Relative error','1e-6')set_param(sys,'Return vars',   '')set_param(sys,'AssignWideVectorLines','on');add_block('built-in/Clock',[sys,'/','Clock'])set_param([sys,'/','Clock'],...		'position',[85,10,105,30])add_block('built-in/To Workspace',[sys,'/','time'])set_param([sys,'/','time'],...		'mat-name','t',...		'position',[485,12,535,28])add_block('built-in/Constant',[sys,'/','F'])set_param([sys,'/','F'],...		'orientation',1,...		'position',[170,65,200,85])add_block('built-in/Constant',[sys,'/','zF'])set_param([sys,'/','zF'],...		'orientation',1,...		'Value','0.5',...		'position',[116,65,144,85])add_block('built-in/Demux',[sys,'/','Demux'])set_param([sys,'/','Demux'],...		'outputs','[1,1,1,1,41]',...		'position',[380,116,435,184])add_block('built-in/To Workspace',[sys,'/','Comp.'])set_param([sys,'/','Comp.'],...		'mat-name','Comp',...		'buffer','1200',...		'position',[495,237,545,253])add_block('built-in/To Workspace',[sys,'/','x_B'])set_param([sys,'/','x_B'],...		'mat-name','y2',...		'buffer','1200',...		'position',[495,142,545,158])add_block('built-in/To Workspace',[sys,'/','M_D'])set_param([sys,'/','M_D'],...		'mat-name','y3',...		'buffer','1200',...		'position',[495,172,545,188])add_block('built-in/To Workspace',[sys,'/','M_B'])set_param([sys,'/','M_B'],...		'mat-name','y4',...		'buffer','1200',...		'position',[495,202,545,218])add_block('built-in/Constant',[sys,'/','rMD'])set_param([sys,'/','rMD'],...		'orientation',2,...		'Value','0.5',...		'position',[490,300,550,320])add_block('built-in/Gain',[sys,'/','Gain'])set_param([sys,'/','Gain'],...		'orientation',2,...		'Gain','-10',...		'position',[330,290,360,320])add_block('built-in/Sum',[sys,'/','Sum'])set_param([sys,'/','Sum'],...		'orientation',2,...		'inputs','-+',...		'position',[400,295,420,315])add_block('built-in/Constant',[sys,'/','rMB'])set_param([sys,'/','rMB'],...		'orientation',2,...		'Value','0.5',...		'position',[490,350,550,370])add_block('built-in/Gain',[sys,'/','Gain1'])set_param([sys,'/','Gain1'],...		'orientation',2,...		'Gain','-10',...		'position',[335,340,365,370])add_block('built-in/S-Function',[sys,'/',['Distillation',13,'column',13,'(nonlinear)',13,'',13,'LV configuration']])set_param([sys,'/',['Distillation',13,'column',13,'(nonlinear)',13,'',13,'LV configuration']],...		'function name','colas',...		'position',[285,117,355,183])add_block('built-in/Mux',[sys,'/','Mux'])set_param([sys,'/','Mux'],...		'inputs','7',...		'position',[225,116,265,184])add_block('built-in/Constant',[sys,'/','qF'])set_param([sys,'/','qF'],...		'orientation',1,...		'position',[220,65,250,85])add_block('built-in/Sum',[sys,'/','Sum1'])set_param([sys,'/','Sum1'],...		'orientation',2,...		'inputs','-+',...		'position',[405,345,425,365])add_block('built-in/Transfer Fcn',[sys,'/',' CyD'])set_param([sys,'/',' CyD'],...		'orientation',2,...		'Numerator','[3.76 1]',...		'Denominator','[3.76 0]',...		'position',[340,411,390,449])add_block('built-in/Sum',[sys,'/','Sum2'])set_param([sys,'/','Sum2'],...		'orientation',2,...		'inputs','-+',...		'position',[415,420,435,440])add_block('built-in/To Workspace',[sys,'/','Delta L'])set_param([sys,'/','Delta L'],...		'mat-name','u1',...		'buffer','1200',...		'position',[500,477,550,493])add_block('built-in/To Workspace',[sys,'/','Delta V'])set_param([sys,'/','Delta V'],...		'mat-name','u2',...		'buffer','1200',...		'position',[505,517,555,533])add_block('built-in/Sum',[sys,'/','Sum4'])set_param([sys,'/','Sum4'],...		'position',[95,110,115,130])add_block('built-in/Sum',[sys,'/','Sum5'])set_param([sys,'/','Sum5'],...		'orientation',3,...		'position',[100,200,120,220])add_block('built-in/Sum',[sys,'/','Sum3'])set_param([sys,'/','Sum3'],...		'orientation',2,...		'inputs','-+',...		'position',[415,385,435,405])add_block('built-in/Gain',[sys,'/','KpyD'])set_param([sys,'/','KpyD'],...		'orientation',2,...		'Gain','26.1',...		'position',[250,414,295,446])add_block('built-in/Transfer Fcn',[sys,'/','CxB'])set_param([sys,'/','CxB'],...		'orientation',2,...		'Numerator','[3.31 1]',...		'Denominator','[3.31 0]',...		'position',[280,377,335,413])add_block('built-in/Gain',[sys,'/','KpxB'])set_param([sys,'/','KpxB'],...		'orientation',2,...		'Gain','-37.5',...		'position',[215,378,265,412])add_block('built-in/To Workspace',[sys,'/','y_D'])set_param([sys,'/','y_D'],...		'mat-name','y1',...		'buffer','1200',...		'position',[495,92,545,108])add_block('built-in/Transport Delay',[sys,'/',['Transport',13,'Delay']])set_param([sys,'/',['Transport',13,'Delay']],...		'orientation',1,...		'Delay Time','1',...		'Initial Input','0.01',...		'position',[550,265,590,295])%     Subsystem  'Graph1'.new_system([sys,'/','Graph1'])set_param([sys,'/','Graph1'],'Location',[0,59,274,252])add_block('built-in/Inport',[sys,'/','Graph1/x'])set_param([sys,'/','Graph1/x'],...		'position',[65,55,85,75])add_block('built-in/S-Function',[sys,'/',['Graph1/S-function',13,'M-file which plots',13,'lines',13,'']])set_param([sys,'/',['Graph1/S-function',13,'M-file which plots',13,'lines',13,'']],...		'function name','sfuny',...		'parameters','ax, color,dt',...		'position',[130,55,180,75])add_line([sys,'/','Graph1'],[90,65;125,65])set_param([sys,'/','Graph1'],...		'Mask Display','plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,90,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60,48,46,56,75,81,84])',...		'Mask Type','Graph scope.')set_param([sys,'/','Graph1'],...		'Mask Dialogue','Graph scope using MATLAB graph window.\nEnter plotting ranges and line type.|Time range:|y-min:|y-max:|Line type (rgbw-:*). Seperate each plot by ''/'':')set_param([sys,'/','Graph1'],...		'Mask Translate','color = @4; ax = [0, @1, @2, @3]; dt = -1;')set_param([sys,'/','Graph1'],...		'Mask Help','This block plots to the MATLAB graph window and can be used as an improved version of the Scope block. Look at the m-file sfuny.m to see how it works. This block can take scalar or vector input signal.')set_param([sys,'/','Graph1'],...		'Mask Entries','20\/0\/0.02\/''y-/g--/c-./w:/m*/ro/b+''\/')%     Finished composite block 'Graph1'.set_param([sys,'/','Graph1'],...		'position',[685,116,715,154])%     Subsystem  'Graph'.new_system([sys,'/','Graph'])set_param([sys,'/','Graph'],'Location',[0,59,274,252])add_block('built-in/Inport',[sys,'/','Graph/x'])set_param([sys,'/','Graph/x'],...		'position',[65,55,85,75])add_block('built-in/S-Function',[sys,'/',['Graph/S-function',13,'M-file which plots',13,'lines',13,'']])set_param([sys,'/',['Graph/S-function',13,'M-file which plots',13,'lines',13,'']],...		'function name','sfuny',...		'parameters','ax, color,dt',...		'position',[130,55,180,75])add_line([sys,'/','Graph'],[90,65;125,65])set_param([sys,'/','Graph'],...		'Mask Display','plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,90,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60,48,46,56,75,81,84])',...		'Mask Type','Graph scope.')set_param([sys,'/','Graph'],...		'Mask Dialogue','Graph scope using MATLAB graph window.\nEnter plotting ranges and line type.|Time range:|y-min:|y-max:|Line type (rgbw-:*). Seperate each plot by ''/'':')set_param([sys,'/','Graph'],...		'Mask Translate','color = @4; ax = [0, @1, @2, @3]; dt = -1;')set_param([sys,'/','Graph'],...		'Mask Help','This block plots to the MATLAB graph window and can be used as an improved version of the Scope block. Look at the m-file sfuny.m to see how it works. This block can take scalar or vector input signal.')set_param([sys,'/','Graph'],...		'Mask Entries','20\/0.985\/1\/''y-/g--/c-./w:/m*/ro/b+''\/')%     Finished composite block 'Graph'.set_param([sys,'/','Graph'],...		'position',[685,56,715,94])add_block('built-in/Transport Delay',[sys,'/',['Transport',13,'Delay1']])set_param([sys,'/',['Transport',13,'Delay1']],...		'orientation',1,...		'Delay Time','1',...		'Initial Input','0.99',...		'position',[610,220,650,250])add_block('built-in/Constant',[sys,'/','xBs'])set_param([sys,'/','xBs'],...		'orientation',2,...		'Value','0.01',...		'position',[690,390,730,410])add_block('built-in/Constant',[sys,'/','yDs'])set_param([sys,'/','yDs'],...		'orientation',2,...		'Value','0.99',...		'position',[690,424,730,446])add_block('built-in/Constant',[sys,'/','V0'])set_param([sys,'/','V0'],...		'Value','3.20629',...		'position',[0,240,60,260])add_block('built-in/Constant',[sys,'/','L0'])set_param([sys,'/','L0'],...		'Value','2.70629',...		'position',[0,103,55,127])add_line(sys,[440,120;480,120;490,100])add_line(sys,[440,150;460,150;460,180;490,180])add_line(sys,[440,165;450,165;450,210;490,210])add_line(sys,[440,180;439,180;439,245;490,245])add_line(sys,[185,90;185,100;165,100;165,160;220,160])add_line(sys,[130,90;130,100;155,100;155,170;220,170])add_line(sys,[110,20;480,20])add_line(sys,[360,150;375,150])add_line(sys,[440,135;475,135;475,150;490,150])add_line(sys,[270,150;280,150])add_line(sys,[395,305;365,305])add_line(sys,[485,310;425,310])add_line(sys,[325,305;175,305;175,140;220,140])add_line(sys,[440,150;460,150;460,300;425,300])add_line(sys,[440,165;450,165;450,350;430,350])add_line(sys,[485,360;430,360])add_line(sys,[400,355;370,355])add_line(sys,[330,355;185,355;185,150;220,150])add_line(sys,[235,90;235,104;200,104;200,180;220,180])add_line(sys,[410,430;395,430])add_line(sys,[440,120;460,120;460,75;680,75])add_line(sys,[120,120;220,120])add_line(sys,[60,115;90,115])add_line(sys,[65,250;105,250;105,225])add_line(sys,[110,195;110,180;125,180;125,130;220,130])add_line(sys,[410,395;340,395])add_line(sys,[275,395;270,395])add_line(sys,[335,430;300,430])add_line(sys,[245,430;80,430;90,125])add_line(sys,[210,395;115,395;115,225])add_line(sys,[245,430;235,430;235,485;495,485])add_line(sys,[210,395;200,395;200,525;500,525])add_line(sys,[440,135;680,135])add_line(sys,[570,300;570,385;470,385;470,390;440,390])add_line(sys,[440,135;570,135;570,260])add_line(sys,[440,120;630,120;630,215])add_line(sys,[630,255;630,420;470,420;470,425;440,425])add_line(sys,[685,400;440,400])add_line(sys,[685,435;440,435])drawnow% Return any arguments.if (nargin | nargout)	% Must use feval here to access system in memory	if (nargin > 3)		if (flag == 0)			eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])		else			eval(['ret =', sys,'(t,x,u,flag);'])		end	else		[ret,x0,str,ts,xts] = feval(sys);	endelse	drawnow % Flash up the model and execute load callbackend

⌨️ 快捷键说明

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