function [ret,x0,str,ts,xts]=engine3(t,x,u,flag);
%ENGINE3	is the M-file description of the SIMULINK system named ENGINE3.
%	The block-diagram can be displayed by typing: ENGINE3.
%
%	SYS=ENGINE3(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 ENGINE3 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 ENGINE3 with a FLAG of zero:
%	[SIZES]=ENGINE3([],[],[],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',[255,65,995,524])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-45')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '5')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '0.010')
set_param(sys,'Relative error','1e-6')
set_param(sys,'Return vars',   '')

add_block('built-in/Scope',[sys,'/','Pman'])
set_param([sys,'/','Pman'],...
		'Vgain','120.000000',...
		'Hgain','5.000000',...
		'Vmax','240.000000',...
		'Hmax','10.000000',...
		'Window',[8,509,245,760])
open_system([sys,'/','Pman'])
set_param([sys,'/','Pman'],...
		'position',[140,367,160,393])


%     Subsystem  ['Intake',13,'Manifold'].

new_system([sys,'/',['Intake',13,'Manifold']])
set_param([sys,'/',['Intake',13,'Manifold']],'Location',[257,72,979,389])

add_block('built-in/Sum',[sys,'/',['Intake',13,'Manifold/Sum']])
set_param([sys,'/',['Intake',13,'Manifold/Sum']],...
		'inputs','-+',...
		'position',[285,150,305,170])

add_block('built-in/Mux',[sys,'/',['Intake',13,'Manifold/Mux']])
set_param([sys,'/',['Intake',13,'Manifold/Mux']],...
		'orientation',2,...
		'inputs','2',...
		'position',[140,45,170,80])

add_block('built-in/Inport',[sys,'/',['Intake',13,'Manifold/mdot_ai']])
set_param([sys,'/',['Intake',13,'Manifold/mdot_ai']],...
		'position',[75,155,95,175])

add_block('built-in/Scope',[sys,'/',['Intake',13,'Manifold/Air Flow',13,'Rates']])
set_param([sys,'/',['Intake',13,'Manifold/Air Flow',13,'Rates']],...
		'orientation',2,...
		'Vgain','0.240000',...
		'Hgain','5.000000',...
		'Vmax','0.480000',...
		'Hmax','10.000000',...
		'Window',[248,433,482,684])
set_param([sys,'/',['Intake',13,'Manifold/Air Flow',13,'Rates']],...
		'position',[95,52,115,78])


%     Subsystem  ['Intake',13,'Manifold/Speed density'].

new_system([sys,'/',['Intake',13,'Manifold/Speed density']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density']],'Location',[172,246,830,550])

add_block('built-in/Inport',[sys,'/',['Intake',13,'Manifold/Speed density/ma']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/ma']],...
		'position',[75,120,95,140])

add_block('built-in/Product',[sys,'/',['Intake',13,'Manifold/Speed density/Product']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/Product']],...
		'inputs','4',...
		'position',[470,115,495,245])

add_block('built-in/Constant',[sys,'/',['Intake',13,'Manifold/Speed density/C1']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/C1']],...
		'Value','.112',...
		'position',[390,125,435,145])

add_block('built-in/Outport',[sys,'/',['Intake',13,'Manifold/Speed density/mdot_ao']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/mdot_ao']],...
		'position',[585,170,605,190])

add_block('built-in/Mux',[sys,'/',['Intake',13,'Manifold/Speed density/Mux']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/Mux']],...
		'inputs','2',...
		'position',[245,119,280,166])

add_block('built-in/Inport',[sys,'/',['Intake',13,'Manifold/Speed density/EngSpeed']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/EngSpeed']],...
		'Port','2',...
		'position',[155,145,175,165])

add_block('built-in/Fcn',[sys,'/',['Intake',13,'Manifold/Speed density/voleff']])
set_param([sys,'/',['Intake',13,'Manifold/Speed density/voleff']],...
		'Expr','(24.5*u[2]-(3.1e4))*u[1]*u[1]+(-0.167*u[2]+222)*u[1]+((8.1e-4)*u[2]+0.352)',...
		'position',[305,135,335,155])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[285,145;300,145])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[180,155;240,155])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[340,145;350,165;465,165])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[440,135;465,135])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[100,130;240,130])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[500,180;580,180])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[120,130;120,225;465,225])
add_line([sys,'/',['Intake',13,'Manifold/Speed density']],[215,155;215,195;465,195])


%     Finished composite block ['Intake',13,'Manifold/Speed density'].

set_param([sys,'/',['Intake',13,'Manifold/Speed density']],...
		'position',[545,133,580,242])

add_block('built-in/Inport',[sys,'/',['Intake',13,'Manifold/EngSpeed']])
set_param([sys,'/',['Intake',13,'Manifold/EngSpeed']],...
		'Port','2',...
		'position',[75,205,95,225])

add_block('built-in/Outport',[sys,'/',['Intake',13,'Manifold/mdot_ao']])
set_param([sys,'/',['Intake',13,'Manifold/mdot_ao']],...
		'position',[665,180,685,200])

add_block('built-in/Integrator',[sys,'/',['Intake',13,'Manifold/Manifold',13,'Filling']])
set_param([sys,'/',['Intake',13,'Manifold/Manifold',13,'Filling']],...
		'Initial','0.000552',...
		'position',[390,147,420,173])

add_block('built-in/Note',[sys,'/',['Intake',13,'Manifold/mdot_a']])
set_param([sys,'/',['Intake',13,'Manifold/mdot_a']],...
		'position',[345,130,350,135])

add_block('built-in/Outport',[sys,'/',['Intake',13,'Manifold/Pm']])
set_param([sys,'/',['Intake',13,'Manifold/Pm']],...
		'Port','2',...
		'position',[575,75,595,95])

add_block('built-in/Gain',[sys,'/',['Intake',13,'Manifold/ma2Pm']])
set_param([sys,'/',['Intake',13,'Manifold/ma2Pm']],...
		'Gain','31200',...
		'position',[505,72,535,98])

add_block('built-in/Note',[sys,'/',['Intake',13,'Manifold/ma']])
set_param([sys,'/',['Intake',13,'Manifold/ma']],...
		'position',[440,135,445,140])
add_line([sys,'/',['Intake',13,'Manifold']],[585,190;630,190;630,55;245,55;245,155;280,155])
add_line([sys,'/',['Intake',13,'Manifold']],[425,160;540,160])
add_line([sys,'/',['Intake',13,'Manifold']],[310,160;385,160])
add_line([sys,'/',['Intake',13,'Manifold']],[100,165;280,165])
add_line([sys,'/',['Intake',13,'Manifold']],[100,215;540,215])
add_line([sys,'/',['Intake',13,'Manifold']],[540,85;570,85])
add_line([sys,'/',['Intake',13,'Manifold']],[135,65;120,65])
add_line([sys,'/',['Intake',13,'Manifold']],[215,165;215,70;175,70])
add_line([sys,'/',['Intake',13,'Manifold']],[245,55;175,55])
add_line([sys,'/',['Intake',13,'Manifold']],[630,190;660,190])
add_line([sys,'/',['Intake',13,'Manifold']],[480,160;480,85;500,85])


%     Finished composite block ['Intake',13,'Manifold'].

set_param([sys,'/',['Intake',13,'Manifold']],...
		'position',[270,236,300,294])

add_block('built-in/Note',[sys,'/','mdot_ao'])
set_param([sys,'/','mdot_ao'],...
		'position',[340,220,345,225])

add_block('built-in/Note',[sys,'/','mdot_ai'])
set_param([sys,'/','mdot_ai'],...
		'position',[235,220,240,225])


%     Subsystem  ['Throttle',13,'Body'].

new_system([sys,'/',['Throttle',13,'Body']])
set_param([sys,'/',['Throttle',13,'Body']],'Location',[149,352,666,647])

add_block('built-in/Fcn',[sys,'/',['Throttle',13,'Body/TC']])
set_param([sys,'/',['Throttle',13,'Body/TC']],...
		'Expr','1.-cos(3.1415*(1.14459*u[1]-1.06)/180.)',...
		'position',[170,55,210,75])

add_block('built-in/Inport',[sys,'/',['Throttle',13,'Body/alpha']])
set_param([sys,'/',['Throttle',13,'Body/alpha']],...
		'position',[50,55,70,75])

add_block('built-in/Saturation',[sys,'/',['Throttle',13,'Body/Throttle',13,'limit']])
set_param([sys,'/',['Throttle',13,'Body/Throttle',13,'limit']],...
		'Lower Limit','0',...
		'Upper Limit','79.46',...
		'position',[115,55,140,75])

add_block('built-in/Outport',[sys,'/',['Throttle',13,'Body/mdot ai']])
set_param([sys,'/',['Throttle',13,'Body/mdot ai']],...
		'position',[445,60,465,80])

add_block('built-in/Gain',[sys,'/',['Throttle',13,'Body/MAX']])
set_param([sys,'/',['Throttle',13,'Body/MAX']],...
		'Gain','.1843',...
		'position',[235,39,310,91])

add_block('built-in/Fcn',[sys,'/',['Throttle',13,'Body/PRI']])
set_param([sys,'/',['Throttle',13,'Body/PRI']],...
		'Expr','1.-exp(9*(u[1]-1))',...
		'position',[285,155,325,175])


%     Subsystem  ['Throttle',13,'Body/divide'].

new_system([sys,'/',['Throttle',13,'Body/divide']])
set_param([sys,'/',['Throttle',13,'Body/divide']],'Location',[562,187,811,349])

add_block('built-in/Fcn',[sys,'/',['Throttle',13,'Body/divide/u1//u2']])
set_param([sys,'/',['Throttle',13,'Body/divide/u1//u2']],...
		'Expr','u[1]/u[2]',...
		'position',[120,60,160,80])

add_block('built-in/Mux',[sys,'/',['Throttle',13,'Body/divide/Mux']])
set_param([sys,'/',['Throttle',13,'Body/divide/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Outport',[sys,'/',['Throttle',13,'Body/divide/out_1']])
set_param([sys,'/',['Throttle',13,'Body/divide/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Inport',[sys,'/',['Throttle',13,'Body/divide/u1']])
set_param([sys,'/',['Throttle',13,'Body/divide/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Inport',[sys,'/',['Throttle',13,'Body/divide/u2']])
set_param([sys,'/',['Throttle',13,'Body/divide/u2']],...
		'Port','2',...
		'position',[15,80,35,100])
add_line([sys,'/',['Throttle',13,'Body/divide']],[105,70;115,70])
add_line([sys,'/',['Throttle',13,'Body/divide']],[40,45;65,60])
add_line([sys,'/',['Throttle',13,'Body/divide']],[165,70;195,70])
add_line([sys,'/',['Throttle',13,'Body/divide']],[40,90;65,75])
set_param([sys,'/',['Throttle',13,'Body/divide']],...
		'Mask Display','plot(0,0,100,100,[80,20],[50,50],[48,52,52,48,48],[26,26,20,20,26],[48,52,52,48,48],[80,80,76,76,80])')


%     Finished composite block ['Throttle',13,'Body/divide'].

set_param([sys,'/',['Throttle',13,'Body/divide']],...
		'position',[170,149,195,176])

add_block('built-in/Note',[sys,'/',['Throttle',13,'Body/PR']])
set_param([sys,'/',['Throttle',13,'Body/PR']],...
		'position',[225,140,230,145])

add_block('built-in/Inport',[sys,'/',['Throttle',13,'Body/Pman']])
set_param([sys,'/',['Throttle',13,'Body/Pman']],...
		'Port','3',...
		'position',[50,145,70,165])

add_block('built-in/Inport',[sys,'/',['Throttle',13,'Body/Baro']])
set_param([sys,'/',['Throttle',13,'Body/Baro']],...
		'Port','2',...
		'position',[50,195,70,215])

add_block('built-in/Product',[sys,'/',['Throttle',13,'Body/Product']])
set_param([sys,'/',['Throttle',13,'Body/Product']],...
		'position',[370,60,395,80])
add_line([sys,'/',['Throttle',13,'Body']],[75,65;110,65])
add_line([sys,'/',['Throttle',13,'Body']],[145,65;165,65])
add_line([sys,'/',['Throttle',13,'Body']],[400,70;440,70])
add_line([sys,'/',['Throttle',13,'Body']],[215,65;230,65])
add_line([sys,'/',['Throttle',13,'Body']],[315,65;365,65])
add_line([sys,'/',['Throttle',13,'Body']],[330,165;330,75;365,75])
add_line([sys,'/',['Throttle',13,'Body']],[200,165;280,165])
add_line([sys,'/',['Throttle',13,'Body']],[75,155;165,155])
add_line([sys,'/',['Throttle',13,'Body']],[75,205;130,205;130,170;165,170])
set_param([sys,'/',['Throttle',13,'Body']],...
		'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',13,'Body'].

set_param([sys,'/',['Throttle',13,'Body']],...
		'position',[155,221,200,279])

add_block('built-in/Scope',[sys,'/','Eng Speed'])
set_param([sys,'/','Eng Speed'],...
		'Vgain','900.000000',...
		'Hgain','5.000000',...
		'Vmax','1800.000000',...
		'Hmax','10.000000',...
		'Window',[9,257,244,508])
open_system([sys,'/','Eng Speed'])
set_param([sys,'/','Eng Speed'],...
		'position',[675,257,695,283])


%     Subsystem  ['Throttle',13,'Input'].

new_system([sys,'/',['Throttle',13,'Input']])
set_param([sys,'/',['Throttle',13,'Input']],'Location',[335,473,640,670])

add_block('built-in/Outport',[sys,'/',['Throttle',13,'Input/out_1']])
set_param([sys,'/',['Throttle',13,'Input/out_1']],...
		'position',[240,60,260,80])


%     Subsystem  ['Throttle',13,'Input/Repeating',13,'Sequence'].

new_system([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],'Location',[5,40,315,196])

add_block('built-in/Outport',[sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/out_1']])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/out_1']],...
		'position',[285,60,305,80])

add_block('built-in/Look Up Table',[sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Look-Up Table']])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Look-Up Table']],...
		'Input_Values','t',...
		'Output_Values','y',...
		'position',[210,58,250,82])

add_block('built-in/Fcn',[sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Fcn1']])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Fcn1']],...
		'Expr','rem(u[1],period)',...
		'position',[110,60,150,80])

add_block('built-in/Clock',[sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Clock']])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence/Clock']],...
		'position',[45,60,65,80])
add_line([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],[255,70;280,70])
add_line([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],[70,70;105,70])
add_line([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],[155,70;205,70])
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],...
		'Mask Display','plot([t,t+period,t+2*period],[y,y,y])',...
		'Mask Type','Repeating table')
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],...
		'Mask Dialogue','Repeating table.\nEnter values of time and output for first cycle.|Time values:|Output values:',...
		'Mask Translate','period = max(@1); t = @1; y = @2;')
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],...
		'Mask Help','Repeats cycle given in table. Time values should be monotonically increasing.')
set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],...
		'Mask Entries','[ 0   1   1.05   2   2.1  2.3  2.5  2.7  2.9   3   4  4.05    5.1]\/[10 10   45    45  65   25   65   25   65   45  45  90    90]\/')


%     Finished composite block ['Throttle',13,'Input/Repeating',13,'Sequence'].

set_param([sys,'/',['Throttle',13,'Input/Repeating',13,'Sequence']],...
		'position',[60,50,180,90])
add_line([sys,'/',['Throttle',13,'Input']],[185,70;235,70])
set_param([sys,'/',['Throttle',13,'Input']],...
		'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 ['Throttle',13,'Input'].

set_param([sys,'/',['Throttle',13,'Input']],...
		'position',[35,142,85,188])

add_block('built-in/Scope',[sys,'/','Throttle Angle'])
set_param([sys,'/','Throttle Angle'],...
		'Vgain','100.000000',...
		'Hgain','5.000000',...
		'Vmax','200.000000',...
		'Hmax','10.000000',...
		'Window',[8,6,243,254])
open_system([sys,'/','Throttle Angle'])
set_param([sys,'/','Throttle Angle'],...
		'position',[185,152,205,178])

add_block('built-in/Constant',[sys,'/',['BARO',13,'']])
set_param([sys,'/',['BARO',13,'']],...
		'Value','101.3',...
		'position',[30,240,80,260])


%     Subsystem  ['Fuel',13,'Injection'].

new_system([sys,'/',['Fuel',13,'Injection']])
set_param([sys,'/',['Fuel',13,'Injection']],'Location',[184,386,847,707])


%     Subsystem  ['Fuel',13,'Injection/divide'].

new_system([sys,'/',['Fuel',13,'Injection/divide']])
set_param([sys,'/',['Fuel',13,'Injection/divide']],'Location',[562,187,811,349])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/divide/u2']])
set_param([sys,'/',['Fuel',13,'Injection/divide/u2']],...
		'Port','2',...
		'position',[15,80,35,100])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/divide/u1']])
set_param([sys,'/',['Fuel',13,'Injection/divide/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Outport',[sys,'/',['Fuel',13,'Injection/divide/out_1']])
set_param([sys,'/',['Fuel',13,'Injection/divide/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Mux',[sys,'/',['Fuel',13,'Injection/divide/Mux']])
set_param([sys,'/',['Fuel',13,'Injection/divide/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Fcn',[sys,'/',['Fuel',13,'Injection/divide/u1//u2']])
set_param([sys,'/',['Fuel',13,'Injection/divide/u1//u2']],...
		'Expr','u[1]/u[2]',...
		'position',[120,60,160,80])
add_line([sys,'/',['Fuel',13,'Injection/divide']],[40,90;65,75])
add_line([sys,'/',['Fuel',13,'Injection/divide']],[165,70;195,70])
add_line([sys,'/',['Fuel',13,'Injection/divide']],[40,45;65,60])
add_line([sys,'/',['Fuel',13,'Injection/divide']],[105,70;115,70])
set_param([sys,'/',['Fuel',13,'Injection/divide']],...
		'Mask Display','plot(0,0,100,100,[80,20],[50,50],[48,52,52,48,48],[26,26,20,20,26],[48,52,52,48,48],[80,80,76,76,80])')


%     Finished composite block ['Fuel',13,'Injection/divide'].

set_param([sys,'/',['Fuel',13,'Injection/divide']],...
		'position',[150,97,180,148])


%     Subsystem  ['Fuel',13,'Injection/Tau_f'].

new_system([sys,'/',['Fuel',13,'Injection/Tau_f']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f']],'Location',[355,483,604,645])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/Tau_f/u2']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f/u2']],...
		'Port','2',...
		'position',[15,80,35,100])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/Tau_f/u1']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Outport',[sys,'/',['Fuel',13,'Injection/Tau_f/out_1']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Mux',[sys,'/',['Fuel',13,'Injection/Tau_f/Mux']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Fcn',[sys,'/',['Fuel',13,'Injection/Tau_f/Tau_f']])
set_param([sys,'/',['Fuel',13,'Injection/Tau_f/Tau_f']],...
		'Expr','0.050+1.5*pi*u[1]*14.7/(u[2]*0.1843)',...
		'position',[120,60,160,80])
add_line([sys,'/',['Fuel',13,'Injection/Tau_f']],[40,90;65,75])
add_line([sys,'/',['Fuel',13,'Injection/Tau_f']],[165,70;195,70])
add_line([sys,'/',['Fuel',13,'Injection/Tau_f']],[40,45;65,60])
add_line([sys,'/',['Fuel',13,'Injection/Tau_f']],[105,70;115,70])


%     Finished composite block ['Fuel',13,'Injection/Tau_f'].

set_param([sys,'/',['Fuel',13,'Injection/Tau_f']],...
		'position',[275,112,305,163])

add_block('built-in/Constant',[sys,'/',['Fuel',13,'Injection/beta']])
set_param([sys,'/',['Fuel',13,'Injection/beta']],...
		'Value','14.7',...
		'position',[90,125,125,145])

add_block('built-in/Sum',[sys,'/',['Fuel',13,'Injection/Sum']])
set_param([sys,'/',['Fuel',13,'Injection/Sum']],...
		'inputs','-+',...
		'position',[335,90,355,110])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/mdot_ao']])
set_param([sys,'/',['Fuel',13,'Injection/mdot_ao']],...
		'position',[35,100,55,120])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/EngSpeed']])
set_param([sys,'/',['Fuel',13,'Injection/EngSpeed']],...
		'Port','2',...
		'position',[40,190,60,210])


%     Subsystem  ['Fuel',13,'Injection/divide1'].

new_system([sys,'/',['Fuel',13,'Injection/divide1']])
set_param([sys,'/',['Fuel',13,'Injection/divide1']],'Location',[562,187,811,349])

add_block('built-in/Fcn',[sys,'/',['Fuel',13,'Injection/divide1/u1//u2']])
set_param([sys,'/',['Fuel',13,'Injection/divide1/u1//u2']],...
		'Expr','u[1]/u[2]',...
		'position',[120,60,160,80])

add_block('built-in/Mux',[sys,'/',['Fuel',13,'Injection/divide1/Mux']])
set_param([sys,'/',['Fuel',13,'Injection/divide1/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Outport',[sys,'/',['Fuel',13,'Injection/divide1/out_1']])
set_param([sys,'/',['Fuel',13,'Injection/divide1/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/divide1/u1']])
set_param([sys,'/',['Fuel',13,'Injection/divide1/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Inport',[sys,'/',['Fuel',13,'Injection/divide1/u2']])
set_param([sys,'/',['Fuel',13,'Injection/divide1/u2']],...
		'Port','2',...
		'position',[15,80,35,100])
add_line([sys,'/',['Fuel',13,'Injection/divide1']],[105,70;115,70])
add_line([sys,'/',['Fuel',13,'Injection/divide1']],[40,45;65,60])
add_line([sys,'/',['Fuel',13,'Injection/divide1']],[165,70;195,70])
add_line([sys,'/',['Fuel',13,'Injection/divide1']],[40,90;65,75])
set_param([sys,'/',['Fuel',13,'Injection/divide1']],...
		'Mask Display','plot(0,0,100,100,[80,20],[50,50],[48,52,52,48,48],[26,26,20,20,26],[48,52,52,48,48],[80,80,76,76,80])')


%     Finished composite block ['Fuel',13,'Injection/divide1'].

set_param([sys,'/',['Fuel',13,'Injection/divide1']],...
		'position',[410,87,440,138])

add_block('built-in/Outport',[sys,'/',['Fuel',13,'Injection/mdot_fi']])
set_param([sys,'/',['Fuel',13,'Injection/mdot_fi']],...
		'position',[585,105,605,125])

add_block('built-in/Integrator',[sys,'/',['Fuel',13,'Injection/Integrator']])
set_param([sys,'/',['Fuel',13,'Injection/Integrator']],...
		'Initial','.8e-4',...
		'position',[490,104,515,126])

add_block('built-in/Note',[sys,'/',['Fuel',13,'Injection/mdot_fc']])
set_param([sys,'/',['Fuel',13,'Injection/mdot_fc']],...
		'position',[215,95,220,100])
add_line([sys,'/',['Fuel',13,'Injection']],[185,125;270,125])
add_line([sys,'/',['Fuel',13,'Injection']],[130,135;145,135])
add_line([sys,'/',['Fuel',13,'Injection']],[60,110;145,110])
add_line([sys,'/',['Fuel',13,'Injection']],[65,200;240,200;240,150;270,150])
add_line([sys,'/',['Fuel',13,'Injection']],[520,115;580,115])
add_line([sys,'/',['Fuel',13,'Injection']],[520,115;520,60;305,60;305,95;330,95])
add_line([sys,'/',['Fuel',13,'Injection']],[360,100;405,100])
add_line([sys,'/',['Fuel',13,'Injection']],[310,140;380,140;380,125;405,125])
add_line([sys,'/',['Fuel',13,'Injection']],[445,115;485,115])
add_line([sys,'/',['Fuel',13,'Injection']],[250,125;250,105;330,105])


%     Finished composite block ['Fuel',13,'Injection'].

set_param([sys,'/',['Fuel',13,'Injection']],...
		'position',[395,277,425,328])

add_block('built-in/Note',[sys,'/','mdot fi'])
set_param([sys,'/','mdot fi'],...
		'position',[460,280,465,285])

add_block('built-in/Note',[sys,'/','Pm'])
set_param([sys,'/','Pm'],...
		'position',[320,255,325,260])

add_block('built-in/Note',[sys,'/','alpha'])
set_param([sys,'/','alpha'],...
		'position',[115,140,120,145])


%     Subsystem  ['Torque',13,'Production'].

new_system([sys,'/',['Torque',13,'Production']])
set_param([sys,'/',['Torque',13,'Production']],'Location',[32,249,1000,538])

add_block('built-in/Constant',[sys,'/',['Torque',13,'Production/SA']])
set_param([sys,'/',['Torque',13,'Production/SA']],...
		'Value','30',...
		'position',[355,70,375,90])

add_block('built-in/Scope',[sys,'/',['Torque',13,'Production/Indicated Torque']])
set_param([sys,'/',['Torque',13,'Production/Indicated Torque']],...
		'Vgain','150.000000',...
		'Hgain','5.000000',...
		'Vmax','300.000000',...
		'Hmax','10.000000',...
		'Window',[534,587,765,820],...
		'position',[700,27,720,53])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/Friction',13,'torque']])
set_param([sys,'/',['Torque',13,'Production/Friction',13,'torque']],...
		'orientation',2,...
		'Expr','0.1056*u[1]+15.1',...
		'position',[730,95,770,115])

add_block('built-in/Product',[sys,'/',['Torque',13,'Production/Product1']])
set_param([sys,'/',['Torque',13,'Production/Product1']],...
		'position',[605,175,630,195])


%     Subsystem  ['Torque',13,'Production/Spark delay'].

new_system([sys,'/',['Torque',13,'Production/Spark delay']])
set_param([sys,'/',['Torque',13,'Production/Spark delay']],'Location',[294,173,947,408])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/Spark delay/Spark Input']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Spark Input']],...
		'position',[185,100,205,120])

add_block('built-in/Variable Transport Delay',[sys,'/',['Torque',13,'Production/Spark delay/Variable',13,'Transport Delay']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Variable',13,'Transport Delay']],...
		'Maximum delay:','0.041277',...
		'Initial Input','1.0',...
		'Maximum points:','256',...
		'position',[280,88,325,172])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/Spark delay/Spark delay',13,'time']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Spark delay',13,'time']],...
		'Expr','1.30/u[1]',...
		'position',[170,140,210,160])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/Spark delay/Spark to torque delay = 1.30//(eng speed)']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Spark to torque delay = 1.30//(eng speed)']],...
		'position',[150,15,155,20])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/Spark delay/Max delay:',13,'1.30//(300RPM*2*Pi//60)=0.04128']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Max delay:',13,'1.30//(300RPM*2*Pi//60)=0.04128']],...
		'position',[125,45,130,50])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/Spark delay/SI delayed']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/SI delayed']],...
		'position',[450,120,470,140])

add_block('built-in/Saturation',[sys,'/',['Torque',13,'Production/Spark delay/Saturation']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Saturation']],...
		'Lower Limit','0.65',...
		'Upper Limit','1.0',...
		'position',[360,120,385,140])

add_block('built-in/Scope',[sys,'/',['Torque',13,'Production/Spark delay/Spark delay']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Spark delay']],...
		'Vgain','1.000000',...
		'Hgain','1.000000',...
		'Vmax','2.000000',...
		'Hmax','2.000000',...
		'Window',[-3,326,723,526],...
		'position',[505,47,525,73])

add_block('built-in/Mux',[sys,'/',['Torque',13,'Production/Spark delay/Mux']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Mux']],...
		'inputs','2',...
		'position',[425,40,455,75])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/Spark delay/Delay inaccurate',13,'below 300 RPM ']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/Delay inaccurate',13,'below 300 RPM ']],...
		'position',[75,90,80,95])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/Spark delay/EngSpeed']])
set_param([sys,'/',['Torque',13,'Production/Spark delay/EngSpeed']],...
		'Port','2',...
		'position',[90,140,110,160])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[115,150;165,150])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[210,110;275,110])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[215,150;275,150])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[460,60;500,60])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[250,110;250,50;420,50])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[330,130;355,130])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[390,130;445,130])
add_line([sys,'/',['Torque',13,'Production/Spark delay']],[400,130;400,65;420,65])


%     Finished composite block ['Torque',13,'Production/Spark delay'].

set_param([sys,'/',['Torque',13,'Production/Spark delay']],...
		'position',[515,67,545,118])


%     Subsystem  ['Torque',13,'Production/A//F delay'].

new_system([sys,'/',['Torque',13,'Production/A//F delay']])
set_param([sys,'/',['Torque',13,'Production/A//F delay']],'Location',[101,316,755,565])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/A//F delay/Torque delayed']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Torque delayed']],...
		'position',[520,155,540,175])

add_block('built-in/Scope',[sys,'/',['Torque',13,'Production/A//F delay/A//F delay']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/A//F delay']],...
		'Vgain','200.000000',...
		'Hgain','1.000000',...
		'Vmax','400.000000',...
		'Hmax','2.000000',...
		'Window',[1,192,727,351],...
		'position',[525,82,545,108])

add_block('built-in/Mux',[sys,'/',['Torque',13,'Production/A//F delay/Mux3']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Mux3']],...
		'inputs','2',...
		'position',[450,75,480,110])

add_block('built-in/Saturation',[sys,'/',['Torque',13,'Production/A//F delay/Saturation']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Saturation']],...
		'Lower Limit','0.0',...
		'Upper Limit','919037.0',...
		'position',[370,155,395,175])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/A//F delay/A//F delay',13,'time']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/A//F delay',13,'time']],...
		'Expr','5.48/u[1]',...
		'position',[165,175,205,195])

add_block('built-in/Variable Transport Delay',[sys,'/',['Torque',13,'Production/A//F delay/Variable',13,'Transport Delay']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Variable',13,'Transport Delay']],...
		'Maximum delay:','0.174',...
		'Initial Input','21.735',...
		'Maximum points:','256',...
		'position',[275,123,320,207])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/A//F delay/EngSpeed']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/EngSpeed']],...
		'Port','2',...
		'position',[95,175,115,195])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/A//F delay/Torque Input']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Torque Input']],...
		'position',[180,135,200,155])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/A//F delay/Max delay:',13,'5.48//(300RPM*2*Pi//60)=0.1744']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Max delay:',13,'5.48//(300RPM*2*Pi//60)=0.1744']],...
		'position',[125,40,130,45])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/A//F delay/Intake to torque delay = 5.48//(eng speed)']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Intake to torque delay = 5.48//(eng speed)']],...
		'position',[150,15,155,20])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/A//F delay/Delay inaccurate',13,'below 300 RPM ']])
set_param([sys,'/',['Torque',13,'Production/A//F delay/Delay inaccurate',13,'below 300 RPM ']],...
		'position',[75,90,80,95])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[205,145;270,145])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[245,145;245,85;445,85])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[485,95;520,95])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[210,185;270,185])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[120,185;160,185])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[325,165;365,165])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[400,165;515,165])
add_line([sys,'/',['Torque',13,'Production/A//F delay']],[415,165;415,100;445,100])


%     Finished composite block ['Torque',13,'Production/A//F delay'].

set_param([sys,'/',['Torque',13,'Production/A//F delay']],...
		'position',[420,162,450,213])


%     Subsystem  ['Torque',13,'Production/SI'].

new_system([sys,'/',['Torque',13,'Production/SI']])
set_param([sys,'/',['Torque',13,'Production/SI']],'Location',[110,164,549,334])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/SI/SI']])
set_param([sys,'/',['Torque',13,'Production/SI/SI']],...
		'position',[350,40,370,60])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/SI/SI',13,'function']])
set_param([sys,'/',['Torque',13,'Production/SI/SI',13,'function']],...
		'Expr','pow(cos(u[1]*pi/180.),2.875)',...
		'position',[255,40,295,60])

add_block('built-in/Saturation',[sys,'/',['Torque',13,'Production/SI/SA limits']])
set_param([sys,'/',['Torque',13,'Production/SI/SA limits']],...
		'Lower Limit','-30',...
		'Upper Limit','30',...
		'position',[185,40,210,60])

add_block('built-in/Constant',[sys,'/',['Torque',13,'Production/SI/MBT']])
set_param([sys,'/',['Torque',13,'Production/SI/MBT']],...
		'Value','30',...
		'position',[35,105,55,125])

add_block('built-in/Sum',[sys,'/',['Torque',13,'Production/SI/Sum']])
set_param([sys,'/',['Torque',13,'Production/SI/Sum']],...
		'inputs','+-',...
		'position',[95,40,115,60])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/SI/SA']])
set_param([sys,'/',['Torque',13,'Production/SI/SA']],...
		'position',[30,35,50,55])
add_line([sys,'/',['Torque',13,'Production/SI']],[300,50;345,50])
add_line([sys,'/',['Torque',13,'Production/SI']],[215,50;250,50])
add_line([sys,'/',['Torque',13,'Production/SI']],[55,45;90,45])
add_line([sys,'/',['Torque',13,'Production/SI']],[60,115;70,115;70,55;90,55])
add_line([sys,'/',['Torque',13,'Production/SI']],[120,50;180,50])


%     Finished composite block ['Torque',13,'Production/SI'].

set_param([sys,'/',['Torque',13,'Production/SI']],...
		'position',[425,55,455,105])

add_block('built-in/Product',[sys,'/',['Torque',13,'Production/Product']])
set_param([sys,'/',['Torque',13,'Production/Product']],...
		'position',[265,165,290,185])

add_block('built-in/Gain',[sys,'/',['Torque',13,'Production/Ct']])
set_param([sys,'/',['Torque',13,'Production/Ct']],...
		'Gain','498636',...
		'position',[210,170,230,190])

add_block('built-in/Sum',[sys,'/',['Torque',13,'Production/Net torque']])
set_param([sys,'/',['Torque',13,'Production/Net torque']],...
		'inputs','-+-',...
		'position',[685,144,705,226])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/Load torque']])
set_param([sys,'/',['Torque',13,'Production/Load torque']],...
		'Port','3',...
		'position',[605,215,625,235])

add_block('built-in/Gain',[sys,'/',['Torque',13,'Production/1//Je']])
set_param([sys,'/',['Torque',13,'Production/1//Je']],...
		'Gain','6.87758',...
		'position',[730,175,750,195])

add_block('built-in/Integrator',[sys,'/',['Torque',13,'Production/Integrator']])
set_param([sys,'/',['Torque',13,'Production/Integrator']],...
		'Initial','52.37',...
		'position',[785,172,810,198])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/EngSpeed']])
set_param([sys,'/',['Torque',13,'Production/EngSpeed']],...
		'position',[875,175,895,195])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/mdot_ao']])
set_param([sys,'/',['Torque',13,'Production/mdot_ao']],...
		'position',[25,25,45,45])


%     Subsystem  ['Torque',13,'Production/AFI'].

new_system([sys,'/',['Torque',13,'Production/AFI']])
set_param([sys,'/',['Torque',13,'Production/AFI']],'Location',[109,191,376,353])

add_block('built-in/Saturation',[sys,'/',['Torque',13,'Production/AFI/A//F limits']])
set_param([sys,'/',['Torque',13,'Production/AFI/A//F limits']],...
		'Lower Limit','10.0',...
		'Upper Limit','17.0',...
		'position',[75,50,100,70])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/AFI/out_1']])
set_param([sys,'/',['Torque',13,'Production/AFI/out_1']],...
		'position',[200,50,220,70])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/AFI/in_1']])
set_param([sys,'/',['Torque',13,'Production/AFI/in_1']],...
		'position',[15,50,35,70])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/AFI/AFI']])
set_param([sys,'/',['Torque',13,'Production/AFI/AFI']],...
		'Expr','cos(7.3834*(u[1]-13.5)*pi/180.)',...
		'position',[130,50,170,70])
add_line([sys,'/',['Torque',13,'Production/AFI']],[105,60;125,60])
add_line([sys,'/',['Torque',13,'Production/AFI']],[40,60;70,60])
add_line([sys,'/',['Torque',13,'Production/AFI']],[175,60;195,60])


%     Finished composite block ['Torque',13,'Production/AFI'].

set_param([sys,'/',['Torque',13,'Production/AFI']],...
		'position',[210,95,240,145])


%     Subsystem  ['Torque',13,'Production/divide'].

new_system([sys,'/',['Torque',13,'Production/divide']])
set_param([sys,'/',['Torque',13,'Production/divide']],'Location',[562,187,811,349])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/divide/u1//u2']])
set_param([sys,'/',['Torque',13,'Production/divide/u1//u2']],...
		'Expr','u[1]/u[2]',...
		'position',[120,60,160,80])

add_block('built-in/Mux',[sys,'/',['Torque',13,'Production/divide/Mux']])
set_param([sys,'/',['Torque',13,'Production/divide/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/divide/out_1']])
set_param([sys,'/',['Torque',13,'Production/divide/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/divide/u1']])
set_param([sys,'/',['Torque',13,'Production/divide/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/divide/u2']])
set_param([sys,'/',['Torque',13,'Production/divide/u2']],...
		'Port','2',...
		'position',[15,80,35,100])
add_line([sys,'/',['Torque',13,'Production/divide']],[105,70;115,70])
add_line([sys,'/',['Torque',13,'Production/divide']],[40,45;65,60])
add_line([sys,'/',['Torque',13,'Production/divide']],[165,70;195,70])
add_line([sys,'/',['Torque',13,'Production/divide']],[40,90;65,75])
set_param([sys,'/',['Torque',13,'Production/divide']],...
		'Mask Display','plot(0,0,100,100,[80,20],[50,50],[48,52,52,48,48],[26,26,20,20,26],[48,52,52,48,48],[80,80,76,76,80])')


%     Finished composite block ['Torque',13,'Production/divide'].

set_param([sys,'/',['Torque',13,'Production/divide']],...
		'position',[150,24,175,66])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/mdot_fo']])
set_param([sys,'/',['Torque',13,'Production/mdot_fo']],...
		'Port','2',...
		'position',[100,45,120,65])

add_block('built-in/Scope',[sys,'/',['Torque',13,'Production/A//F ratio']])
set_param([sys,'/',['Torque',13,'Production/A//F ratio']],...
		'Vgain','30.000000',...
		'Hgain','5.000000',...
		'Vmax','60.000000',...
		'Hmax','10.000000',...
		'Window',[290,590,525,821],...
		'position',[220,32,240,58])

add_block('built-in/Note',[sys,'/',['Torque',13,'Production/EngLoad']])
set_param([sys,'/',['Torque',13,'Production/EngLoad']],...
		'position',[165,150,170,155])


%     Subsystem  ['Torque',13,'Production/divide1'].

new_system([sys,'/',['Torque',13,'Production/divide1']])
set_param([sys,'/',['Torque',13,'Production/divide1']],'Location',[562,187,811,349])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/divide1/u2']])
set_param([sys,'/',['Torque',13,'Production/divide1/u2']],...
		'Port','2',...
		'position',[15,80,35,100])

add_block('built-in/Inport',[sys,'/',['Torque',13,'Production/divide1/u1']])
set_param([sys,'/',['Torque',13,'Production/divide1/u1']],...
		'position',[15,35,35,55])

add_block('built-in/Outport',[sys,'/',['Torque',13,'Production/divide1/out_1']])
set_param([sys,'/',['Torque',13,'Production/divide1/out_1']],...
		'position',[200,60,220,80])

add_block('built-in/Mux',[sys,'/',['Torque',13,'Production/divide1/Mux']])
set_param([sys,'/',['Torque',13,'Production/divide1/Mux']],...
		'inputs','2',...
		'position',[70,50,100,85])

add_block('built-in/Fcn',[sys,'/',['Torque',13,'Production/divide1/u1//u2']])
set_param([sys,'/',['Torque',13,'Production/divide1/u1//u2']],...
		'Expr','u[1]/u[2]',...
		'position',[120,60,160,80])
add_line([sys,'/',['Torque',13,'Production/divide1']],[40,90;65,75])
add_line([sys,'/',['Torque',13,'Production/divide1']],[165,70;195,70])
add_line([sys,'/',['Torque',13,'Production/divide1']],[40,45;65,60])
add_line([sys,'/',['Torque',13,'Production/divide1']],[105,70;115,70])
set_param([sys,'/',['Torque',13,'Production/divide1']],...
		'Mask Display','plot(0,0,100,100,[80,20],[50,50],[48,52,52,48,48],[26,26,20,20,26],[48,52,52,48,48],[80,80,76,76,80])')


%     Finished composite block ['Torque',13,'Production/divide1'].

set_param([sys,'/',['Torque',13,'Production/divide1']],...
		'position',[100,159,125,201])
add_line([sys,'/',['Torque',13,'Production']],[725,105;655,105;655,160;680,160])
add_line([sys,'/',['Torque',13,'Production']],[710,185;725,185])
add_line([sys,'/',['Torque',13,'Production']],[755,185;780,185])
add_line([sys,'/',['Torque',13,'Production']],[815,185;870,185])
add_line([sys,'/',['Torque',13,'Production']],[50,35;145,35])
add_line([sys,'/',['Torque',13,'Production']],[125,55;145,55])
add_line([sys,'/',['Torque',13,'Production']],[180,45;215,45])
add_line([sys,'/',['Torque',13,'Production']],[235,180;260,180])
add_line([sys,'/',['Torque',13,'Production']],[245,120;250,120;260,170])
add_line([sys,'/',['Torque',13,'Production']],[635,185;680,185])
add_line([sys,'/',['Torque',13,'Production']],[380,80;420,80])
add_line([sys,'/',['Torque',13,'Production']],[635,185;635,40;695,40])
add_line([sys,'/',['Torque',13,'Production']],[295,175;415,175])
add_line([sys,'/',['Torque',13,'Production']],[455,190;600,190])
add_line([sys,'/',['Torque',13,'Production']],[460,80;510,80])
add_line([sys,'/',['Torque',13,'Production']],[550,95;580,95;580,180;600,180])
add_line([sys,'/',['Torque',13,'Production']],[830,185;830,260;480,260;480,105;510,105])
add_line([sys,'/',['Torque',13,'Production']],[830,185;830,105;775,105])
add_line([sys,'/',['Torque',13,'Production']],[630,225;680,210])
add_line([sys,'/',['Torque',13,'Production']],[480,260;70,260;70,190;95,190])
add_line([sys,'/',['Torque',13,'Production']],[385,260;385,200;415,200])
add_line([sys,'/',['Torque',13,'Production']],[190,45;190,120;205,120])
add_line([sys,'/',['Torque',13,'Production']],[130,180;205,180])
add_line([sys,'/',['Torque',13,'Production']],[70,35;70,170;95,170])


%     Finished composite block ['Torque',13,'Production'].

set_param([sys,'/',['Torque',13,'Production']],...
		'position',[560,242,590,298])


%     Subsystem  'Load torque'.

new_system([sys,'/','Load torque'])
set_param([sys,'/','Load torque'],'Location',[335,229,720,434])

add_block('built-in/Note',[sys,'/','Load torque/Ta'])
set_param([sys,'/','Load torque/Ta'],...
		'position',[160,35,165,40])

add_block('built-in/Constant',[sys,'/','Load torque/Accessory torque'])
set_param([sys,'/','Load torque/Accessory torque'],...
		'Value','0.0',...
		'position',[90,50,140,70])

add_block('built-in/Note',[sys,'/','Load torque/Tp'])
set_param([sys,'/','Load torque/Tp'],...
		'position',[160,100,165,105])

add_block('built-in/Sum',[sys,'/','Load torque/Sum'])
set_param([sys,'/','Load torque/Sum'],...
		'position',[215,80,235,115])

add_block('built-in/Constant',[sys,'/',['Load torque/Torque converter',13,'pump torque']])
set_param([sys,'/',['Load torque/Torque converter',13,'pump torque']],...
		'Value','0.0',...
		'position',[90,115,140,135])

add_block('built-in/Outport',[sys,'/','Load torque/Load torque'])
set_param([sys,'/','Load torque/Load torque'],...
		'position',[285,90,305,110])
add_line([sys,'/','Load torque'],[145,125;190,125;210,105])
add_line([sys,'/','Load torque'],[145,60;190,60;210,90])
add_line([sys,'/','Load torque'],[240,100;280,100])


%     Finished composite block 'Load torque'.

set_param([sys,'/','Load torque'],...
		'position',[475,325,505,375])

add_block('built-in/Note',[sys,'/',['Three State Engine Model',13,'from "Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement, and Control',13,' Dec. 1989, Vol. 111',13,'by Profs. Dan Cho and J. Karl Hedrick']])
set_param([sys,'/',['Three State Engine Model',13,'from "Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement, and Control',13,' Dec. 1989, Vol. 111',13,'by Profs. Dan Cho and J. Karl Hedrick']],...
		'Font Weight','bold')
set_param([sys,'/',['Three State Engine Model',13,'from "Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement, and Control',13,' Dec. 1989, Vol. 111',13,'by Profs. Dan Cho and J. Karl Hedrick']],...
		'position',[470,10,475,15])


%     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/more info1'.

new_system([sys,'/','double-click for more info/more info1'])
set_param([sys,'/','double-click for more info/more info1'],'Location',[70,279,627,614])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/For more information please double-click',13,'the blocks below:',13,'']])
set_param([sys,'/',['double-click for more info/more info1/For more information please double-click',13,'the blocks below:',13,'']],...
		'Font Name','Arial',...
		'position',[260,25,265,30])


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

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

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info3/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 info1/more info3/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 info1/more info3/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 info1/more info3/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])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info3/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 info1/more info3/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 info1/more info3/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 info1/more info3/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 info1/more info3/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])
set_param([sys,'/','double-click for more info/more info1/more info3'],...
		'Mask Display','Additional literature\nby Robert Weeks')


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

set_param([sys,'/','double-click for more info/more info1/more info3'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[170,210,350,251])


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

new_system([sys,'/','double-click for more info/more info1/more info2'])
set_param([sys,'/','double-click for more info/more info1/more info2'],'Location',[295,96,816,437])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info2/The SIMULINK engine model was developed from the following',13,'paper by:']])
set_param([sys,'/',['double-click for more info/more info1/more info2/The SIMULINK engine model was developed from the following',13,'paper by:']],...
		'position',[250,10,255,15])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info2/Prof. Dan Cho (now at Seoul National University) and',13,'Prof. J. Karl Hedrick (University of California at Berkeley):']])
set_param([sys,'/',['double-click for more info/more info1/more info2/Prof. Dan Cho (now at Seoul National University) and',13,'Prof. J. Karl Hedrick (University of California at Berkeley):']],...
		'Font Weight','bold')
set_param([sys,'/',['double-click for more info/more info1/more info2/Prof. Dan Cho (now at Seoul National University) and',13,'Prof. J. Karl Hedrick (University of California at Berkeley):']],...
		'position',[250,60,255,65])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info2/"Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement and Control',13,'Vol. 111, Dec. 1989.']])
set_param([sys,'/',['double-click for more info/more info1/more info2/"Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement and Control',13,'Vol. 111, Dec. 1989.']],...
		'Font Weight','bold')
set_param([sys,'/',['double-click for more info/more info1/more info2/"Automotive Powertrain Modeling for Control"',13,'Transactions of the ASME',13,'Journal of Dynamic Systems, Measurement and Control',13,'Vol. 111, Dec. 1989.']],...
		'position',[250,115,255,120])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info2/All but one of the engine specific parameters embedded in the',13,'model came directly from the ASME paper above.  The constant',13,'"ma2pm" was not defined in the paper.']])
set_param([sys,'/',['double-click for more info/more info1/more info2/All but one of the engine specific parameters embedded in the',13,'model came directly from the ASME paper above.  The constant',13,'"ma2pm" was not defined in the paper.']],...
		'position',[260,195,265,200])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info2/A value of 31200 kPa//kg was used for ma2pm to calculate the',13,'intake manifold pressure from the mass of air in the manifold.']])
set_param([sys,'/',['double-click for more info/more info1/more info2/A value of 31200 kPa//kg was used for ma2pm to calculate the',13,'intake manifold pressure from the mass of air in the manifold.']],...
		'position',[260,265,265,270])
set_param([sys,'/','double-click for more info/more info1/more info2'],...
		'Mask Display','Literature used to\ndevelop model')


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

set_param([sys,'/','double-click for more info/more info1/more info2'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[170,150,350,191])


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

new_system([sys,'/','double-click for more info/more info1/more info1'])
set_param([sys,'/','double-click for more info/more info1/more info1'],'Location',[303,79,860,422])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info1/As of 9//28//95 there is no additional printed documentation',13,'written specifically for this SIMULINK model.']])
set_param([sys,'/',['double-click for more info/more info1/more info1/As of 9//28//95 there is no additional printed documentation',13,'written specifically for this SIMULINK model.']],...
		'Font Name','Arial',...
		'position',[250,25,255,30])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info1/Please see the ASME paper by Cho and Hedrick for a',13,'description of state equations and parameter values used',13,'in the SIMULINK model.']])
set_param([sys,'/',['double-click for more info/more info1/more info1/Please see the ASME paper by Cho and Hedrick for a',13,'description of state equations and parameter values used',13,'in the SIMULINK model.']],...
		'position',[250,70,255,75])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info1/The purpose of this SIMULINK model is to show some of the',13,'benefits of supplementing a conventional technical research',13,'paper with an actual example model.']])
set_param([sys,'/',['double-click for more info/more info1/more info1/The purpose of this SIMULINK model is to show some of the',13,'benefits of supplementing a conventional technical research',13,'paper with an actual example model.']],...
		'position',[260,140,265,145])

add_block('built-in/Note',[sys,'/',['double-click for more info/more info1/more info1/The model is not intended to show object oriented programming',13,'practices.  For examples of more modular and generic SIMULINK',13,'models, please refer to the "Additional literature by Robert Weeks"',13,'block below.']])
set_param([sys,'/',['double-click for more info/more info1/more info1/The model is not intended to show object oriented programming',13,'practices.  For examples of more modular and generic SIMULINK',13,'models, please refer to the "Additional literature by Robert Weeks"',13,'block below.']],...
		'position',[265,210,270,215])
set_param([sys,'/','double-click for more info/more info1/more info1'],...
		'Mask Display','Documentation for\nSIMULINK model')


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

set_param([sys,'/','double-click for more info/more info1/more info1'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[170,95,350,136])
set_param([sys,'/','double-click for more info/more info1'],...
		'Mask Display','Additional\nLiterature')


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

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


%     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,...
		'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])
set_param([sys,'/','double-click for more info'],...
		'Mask Display','SIMULINK model:\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',[388,125,540,186])
add_line(sys,[85,250;150,250])
add_line(sys,[305,280;325,280;325,345;105,345;105,270;150,270])
add_line(sys,[305,250;555,250])
add_line(sys,[595,270;630,270;630,420;220,420;220,280;265,280])
add_line(sys,[340,420;340,315;390,315])
add_line(sys,[430,305;500,305;500,270;555,270])
add_line(sys,[340,250;340,290;390,290])
add_line(sys,[90,165;180,165])
add_line(sys,[135,165;135,230;150,230])
add_line(sys,[510,350;520,350;520,290;555,290])
add_line(sys,[630,270;670,270])
add_line(sys,[205,250;265,250])
add_line(sys,[105,345;105,380;135,380])

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
