function [ret,x0,str,ts,xts]=msicons(t,x,u,flag);
%MSICONS	is the M-file description of the SIMULINK system named MSICONS.
%	The block-diagram can be displayed by typing: MSICONS.
%
%	SYS=MSICONS(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 MSICONS 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 MSICONS with a FLAG of zero:
%	[SIZES]=MSICONS([],[],[],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',[183,132,846,584])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-45')
set_param(sys,'Start time',    '0')
set_param(sys,'Stop time',     '6')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '0.001')
set_param(sys,'Relative error','1e-8')
set_param(sys,'Return vars',   '')
set_param(sys,'Nonreal-time max step size','0.0010')
set_param(sys,'Nonreal-time relative error','1e-8')
set_param(sys,'Nonreal-time stop time','3.0')
set_param(sys,'Nonreal-time save output history','off')
set_param(sys,'Nonreal-time save scope blocks','off')
set_param(sys,'Real-time algorithm','huen')
set_param(sys,'Real-time step size','0.001')


%     Subsystem  'Controller'.

new_system([sys,'/','Controller'])
set_param([sys,'/','Controller'],'Location',[289,258,605,518])
set_param([sys,'/','Controller'],...
		'Mask Display','plot(0,0,100,100,[13 13 29 29 13 13],[53 45 41 49 53 53],[45 33 33 45 45 45],[37 40 48 45 37 37],[52 16 16],[48 57 53],[16 16 16 52 52 52 84 84 52 52],[42 42 40 32 48 48 56 40 32 32],[],[],[],[],[16 16 46 84 84],[57 57 65 56 56],[],[])')


%     Finished composite block 'Controller'.

set_param([sys,'/','Controller'],...
		'Drop Shadow',4,...
		'position',[385,205,460,265])


%     Subsystem  'Sensors'.

new_system([sys,'/','Sensors'])
set_param([sys,'/','Sensors'],'Location',[495,188,916,440])
set_param([sys,'/','Sensors'],...
		'Mask Display','plot(0,0,100,100,[48 48],[88 76],[48 48],[12 24],[64 32 32 64 64 64],[24 24 76 76 24 24],[20 88],[28 80],[80 88 88 72],[64 80 80 76])')


%     Finished composite block 'Sensors'.

set_param([sys,'/','Sensors'],...
		'Drop Shadow',4,...
		'position',[300,204,335,266])


%     Subsystem  'Engine'.

new_system([sys,'/','Engine'])
set_param([sys,'/','Engine'],'Location',[5,85,479,328])
set_param([sys,'/','Engine'],...
		'Mask Display','plot(0,0,100,100,[8 24 36 48 60 76 56 56 28 28 8 8],[56 72 60 60 72 56 36 16 16 36 56 56],[60 60 76 92 76 76],[72 72 80 64 56 56],[92 92 72 72 56 56],[64 64 44 24 16 16],[36 36 40 44 48 48 44 40 36 36],[36 40 44 44 40 36 32 32 36 36],[24 24 40 52 52 56 56],[72 72 80 68 68 68 68],[36 36 52 52],[60 60 68 68],[56 56 72 72],[36 36 44 44],[],[])')


%     Finished composite block 'Engine'.

set_param([sys,'/','Engine'],...
		'Drop Shadow',4,...
		'position',[175,197,250,273])


%     Subsystem  'Throttle'.

new_system([sys,'/','Throttle'])
set_param([sys,'/','Throttle'],'Location',[30,263,411,493])
set_param([sys,'/','Throttle'],...
		'Mask Display','plot(0,0,100,100,[20,80,80,20,20],[20,20,15,15,20],[20,80,80,20,20],[80,80,85,85,80],[30,70],[30,70],[50,52,50,48,50],[52,50,48,50,52])')


%     Finished composite block 'Throttle'.

set_param([sys,'/','Throttle'],...
		'position',[300,310,340,370])


%     Subsystem  'Turbocharger'.

new_system([sys,'/','Turbocharger'])
set_param([sys,'/','Turbocharger'],'Location',[30,263,411,493])
set_param([sys,'/','Turbocharger'],...
		'Mask Display','plot(0,0,100,100,[20 20 32 32 20 20],[40 60 72 28 40 40],[80 80 68 68 80 80],[40 60 72 28 40 40],[],[],[32 32 68 68],[56 56 56 56],[32 32 68 68],[44 44 44 44],[],[],[],[])')


%     Finished composite block 'Turbocharger'.

set_param([sys,'/','Turbocharger'],...
		'position',[395,320,450,360])


%     Subsystem  ['Ambient',13,'Conditions'].

new_system([sys,'/',['Ambient',13,'Conditions']])
set_param([sys,'/',['Ambient',13,'Conditions']],'Location',[316,278,773,556])
set_param([sys,'/',['Ambient',13,'Conditions']],...
		'Mask Display','plot(0,0,100,100,[100,91,84,77,74,74],[64,65,70,80,90,100],[56,71],[74,82],[67,78],[55,71],[83,87],[42,62],[49,56,63,64,60,53,44,38,35,29,19,15,18],[24,19,22,33,42,48,47,43,53,57,56,47,38],[43,48],[12,29],[35,41],[8,29],[29,35],[15,33],[19,28],[9,35],[17,22],[25,39],[54,69],[93,94])')


%     Finished composite block ['Ambient',13,'Conditions'].

set_param([sys,'/',['Ambient',13,'Conditions']],...
		'Drop Shadow',4,...
		'position',[60,199,115,251])


%     Subsystem  'Pedal position'.

new_system([sys,'/','Pedal position'])
set_param([sys,'/','Pedal position'],'Location',[8,203,347,474])
set_param([sys,'/','Pedal position'],...
		'Mask Display','plot(0,0,100,100,[78,76,71,63,56,41,42,46,50,57,55,64,78],[41,44,43,39,39,30,24,16,11,17,21,26,41],[40,56,39,19],[88,44,35,79],[43,41],[31,36],[56,54],[39,43],[64,67,86,83,64],[10,8,42,44,10])')


%     Finished composite block 'Pedal position'.

set_param([sys,'/','Pedal position'],...
		'Drop Shadow',4,...
		'position',[60,311,120,369])

add_block('built-in/Note',[sys,'/',['courtesy of:',13,'',13,' Robert Weeks',13,'Modular Systems']])
set_param([sys,'/',['courtesy of:',13,'',13,' Robert Weeks',13,'Modular Systems']],...
		'Font Name','Arial',...
		'Font Weight','bold',...
		'position',[185,75,190,80])

add_block('built-in/Note',[sys,'/','Automotive Icons'])
set_param([sys,'/','Automotive Icons'],...
		'Font Name','Arial',...
		'Font Weight','bold',...
		'Font Size',16,...
		'position',[185,30,190,35])


%     Subsystem  'double-click for more info'.

new_system([sys,'/','double-click for more info'])
set_param([sys,'/','double-click for more info'],'Location',[239,115,680,471])


%     Subsystem  'double-click for more info/more info2'.

new_system([sys,'/','double-click for more info/more info2'])
set_param([sys,'/','double-click for more info/more info2'],'Location',[208,246,688,559])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info2/For more information about Modular Systems''',13,'products and consulting services,',13,'please contact:']])
set_param([sys,'/',['double-click for more info/more info2/For more information about Modular Systems''',13,'products and consulting services,',13,'please contact:']],...
		'Font Name','Arial',...
		'position',[235,45,240,50])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info2/Robert W. Weeks',13,'Modular Systems',13,'714 Sheridan Road',13,'Evanston, IL 60202-2502',13,'',13,'Tel: (708) 869-2023 or (500) 442-5500',13,'Fax: (708) 869-3023 or (500) 442-5510',13,'email: bobweeks@ix.netcom.com']])
set_param([sys,'/',['double-click for more info/more info2/Robert W. Weeks',13,'Modular Systems',13,'714 Sheridan Road',13,'Evanston, IL 60202-2502',13,'',13,'Tel: (708) 869-2023 or (500) 442-5500',13,'Fax: (708) 869-3023 or (500) 442-5510',13,'email: bobweeks@ix.netcom.com']],...
		'Font Name','Arial')
set_param([sys,'/',['double-click for more info/more info2/Robert W. Weeks',13,'Modular Systems',13,'714 Sheridan Road',13,'Evanston, IL 60202-2502',13,'',13,'Tel: (708) 869-2023 or (500) 442-5500',13,'Fax: (708) 869-3023 or (500) 442-5510',13,'email: bobweeks@ix.netcom.com']],...
		'Font Weight','bold')
set_param([sys,'/',['double-click for more info/more info2/Robert W. Weeks',13,'Modular Systems',13,'714 Sheridan Road',13,'Evanston, IL 60202-2502',13,'',13,'Tel: (708) 869-2023 or (500) 442-5500',13,'Fax: (708) 869-3023 or (500) 442-5510',13,'email: bobweeks@ix.netcom.com']],...
		'position',[230,110,235,115])
set_param([sys,'/','double-click for more info/more info2'],...
		'Mask Display','How to contact\nModular Systems')


%     Finished composite block 'double-click for more info/more info2'.

set_param([sys,'/','double-click for more info/more info2'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[140,250,270,291])


%     Subsystem  'double-click for more info/Copyright disclaimer'.

new_system([sys,'/','double-click for more info/Copyright disclaimer'])
set_param([sys,'/','double-click for more info/Copyright disclaimer'],'Location',[208,246,732,653])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/Researchers interested in commercializing their automotive',13,'simulation models are encouraged to contact Robert Weeks',13,'at Modular Systems.']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/Researchers interested in commercializing their automotive',13,'simulation models are encouraged to contact Robert Weeks',13,'at Modular Systems.']],...
		'position',[245,270,250,275])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/Permission to incorporate the model, or portions thereof, in',13,'other academic research models is granted if credit is given',13,'in any published research papers and if the models are not ',13,'sold or licensed for commercial use.']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/Permission to incorporate the model, or portions thereof, in',13,'other academic research models is granted if credit is given',13,'in any published research papers and if the models are not ',13,'sold or licensed for commercial use.']],...
		'position',[250,195,255,200])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/Permission is expressly granted for this model to be made',13,'available for file transfer from installations offering unrestricted',13,'anonymous file transfer on the Internet.']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/Permission is expressly granted for this model to be made',13,'available for file transfer from installations offering unrestricted',13,'anonymous file transfer on the Internet.']],...
		'Font Name','Arial')
set_param([sys,'/',['double-click for more info/Copyright disclaimer/Permission is expressly granted for this model to be made',13,'available for file transfer from installations offering unrestricted',13,'anonymous file transfer on the Internet.']],...
		'position',[250,135,255,140])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/This SIMULINK model is (C) Copyright 1994-1995',13,' by Robert W. Weeks.']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/This SIMULINK model is (C) Copyright 1994-1995',13,' by Robert W. Weeks.']],...
		'Font Name','Arial',...
		'Font Weight','bold',...
		'position',[250,10,255,15])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/This model is provided as is without any express or implied',13,'warranty.  ']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/This model is provided as is without any express or implied',13,'warranty.  ']],...
		'position',[245,335,250,340])

add_block('built-in/Note',[sys,'/',['double-click for more info/Copyright disclaimer/It may be freely redistributed in its entirety provided that this',13,'copyright notice is not removed.  It may not be sold for profit',13,'without the written permission of the copyright holder.']])
set_param([sys,'/',['double-click for more info/Copyright disclaimer/It may be freely redistributed in its entirety provided that this',13,'copyright notice is not removed.  It may not be sold for profit',13,'without the written permission of the copyright holder.']],...
		'Font Name','Arial')
set_param([sys,'/',['double-click for more info/Copyright disclaimer/It may be freely redistributed in its entirety provided that this',13,'copyright notice is not removed.  It may not be sold for profit',13,'without the written permission of the copyright holder.']],...
		'position',[250,70,255,75])
set_param([sys,'/','double-click for more info/Copyright disclaimer'],...
		'Mask Display','DISCLAIMER:\nPLEASE READ')


%     Finished composite block 'double-click for more info/Copyright disclaimer'.

set_param([sys,'/','double-click for more info/Copyright disclaimer'],...
		'hide name',0,...
		'Font Weight','bold',...
		'Drop Shadow',4,...
		'position',[140,100,270,141])

add_block('built-in/Note',[sys,'/',['double-click for more info/For more information please double-click',13,'the blocks below:',13,'']])
set_param([sys,'/',['double-click for more info/For more information please double-click',13,'the blocks below:',13,'']],...
		'Font Name','Arial',...
		'position',[215,35,220,40])


%     Subsystem  'double-click for more info/more info'.

new_system([sys,'/','double-click for more info/more info'])
set_param([sys,'/','double-click for more info/more info'],'Location',[410,120,967,400])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info/Copies of the above papers may be obtained by contacting:',13,'SAE, 400 Commonwealth Drive, Warrendale, PA 15096-0001 U.S.A.',13,'Tel:(412) 776-4841 Fax:(412) 776-5760']])
set_param([sys,'/',['double-click for more info/more info/Copies of the above papers may be obtained by contacting:',13,'SAE, 400 Commonwealth Drive, Warrendale, PA 15096-0001 U.S.A.',13,'Tel:(412) 776-4841 Fax:(412) 776-5760']],...
		'position',[275,190,280,195])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Automotive Engine',13,'Modeling for Real-Time Control Using MATLAB // SIMULINK,"',13,'SAE paper no. 950417, 1995.']])
set_param([sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Automotive Engine',13,'Modeling for Real-Time Control Using MATLAB // SIMULINK,"',13,'SAE paper no. 950417, 1995.']],...
		'Font Weight','bold')
set_param([sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Automotive Engine',13,'Modeling for Real-Time Control Using MATLAB // SIMULINK,"',13,'SAE paper no. 950417, 1995.']],...
		'position',[275,110,280,115])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Transient Air Flow',13,'Rate Estimation in a Natural Gas Engine Using a',13,'Nonlinear Observer," SAE paper no. 940759, 1994.']])
set_param([sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Transient Air Flow',13,'Rate Estimation in a Natural Gas Engine Using a',13,'Nonlinear Observer," SAE paper no. 940759, 1994.']],...
		'Font Name','Arial')
set_param([sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Transient Air Flow',13,'Rate Estimation in a Natural Gas Engine Using a',13,'Nonlinear Observer," SAE paper no. 940759, 1994.']],...
		'Font Weight','bold')
set_param([sys,'/',['double-click for more info/more info/Weeks, R.W. and Moskwa, J.J., "Transient Air Flow',13,'Rate Estimation in a Natural Gas Engine Using a',13,'Nonlinear Observer," SAE paper no. 940759, 1994.']],...
		'position',[275,35,280,40])
set_param([sys,'/','double-click for more info/more info'],...
		'Mask Display','Other literature\nby Robert Weeks')


%     Finished composite block 'double-click for more info/more info'.

set_param([sys,'/','double-click for more info/more info'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[140,175,270,216])
set_param([sys,'/','double-click for more info'],...
		'Mask Display','SIMULINK icons:\n(C) Copyright 1994-1995\n by Robert W. Weeks\nModular Systems')


%     Finished composite block 'double-click for more info'.

set_param([sys,'/','double-click for more info'],...
		'Font Name','',...
		'Font Size',8,...
		'Drop Shadow',4,...
		'position',[395,80,547,141])


%     Subsystem  ['double-click to plot',13,'vehicle specific tables'].

new_system([sys,'/',['double-click to plot',13,'vehicle specific tables']])
set_param([sys,'/',['double-click to plot',13,'vehicle specific tables']],'Location',[4,85,278,278])
set_param([sys,'/',['double-click to plot',13,'vehicle specific tables']],...
		'Mask Display','plot(0,0,100,100,[16 28 47 59],[48 61 70 71],[28 40 55 67],[43 55 60 63],[41 54 66 77],[37 46 50 52],[57 69 81 88],[30 37 40 42],[16 16 28 28 41 41 57 57],[48 48 43 43 37 37 30 30],[28 28 40 40 54 54 69 69],[61 61 55 55 46 46 37 37],[47 47 55 55 66 66 81 81],[70 70 60 60 50 50 40 40],[59 59 67 67 77 77 88 88],[71 71 63 63 52 52 42 42],[11 11 55 87],[68 32 12 24],[],[],[],[])')
set_param([sys,'/',['double-click to plot',13,'vehicle specific tables']],...
		'Mask Type','Graph scope.')


%     Finished composite block ['double-click to plot',13,'vehicle specific tables'].

set_param([sys,'/',['double-click to plot',13,'vehicle specific tables']],...
		'Drop Shadow',4,...
		'position',[515,315,590,366])


%     Subsystem  'Ignition System'.

new_system([sys,'/','Ignition System'])
set_param([sys,'/','Ignition System'],'Location',[205,127,607,299])
set_param([sys,'/','Ignition System'],...
		'Mask Display','plot(0,0,100,100,[64 64 44 44 36 36 44 44 48 48 48],[16 16 16 32 32 48 56 68 80 92 92],[56 56 56 48 48 64 64 72 72 64 64 60 60 48 48],[16 16 12 12 8 8 32 32 48 56 68 80 92 92 92],[44 44 64 64],[32 32 32 32],[36 36 72 72],[48 48 48 48],[48 48 60 60],[80 80 80 80],[],[])')


%     Finished composite block 'Ignition System'.

set_param([sys,'/','Ignition System'],...
		'position',[530,206,575,274])


%     Subsystem  'Fuel Injectors'.

new_system([sys,'/','Fuel Injectors'])
set_param([sys,'/','Fuel Injectors'],'Location',[230,85,608,331])
set_param([sys,'/','Fuel Injectors'],...
		'Mask Display','plot(0,0,100,100,[44 60 72 56 36 16 44 64 56 56],[44 28 40 56 36 56 84 64 56 56],[24 24 16 28 36 36],[64 64 72 84 76 76],[72 66 66 88],[12 34 34 28],[66 66 80],[34 34 20])')


%     Finished composite block 'Fuel Injectors'.

set_param([sys,'/','Fuel Injectors'],...
		'Drop Shadow',4,...
		'position',[190,310,240,361])

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);
	end
else
	drawnow % Flash up the model and execute load callback
end
