function [ret,x0,str,ts,xts]=idle(t,x,u,flag);
%IDLE	is the M-file description of the SIMULINK system named IDLE.
%	The block-diagram can be displayed by typing: IDLE.
%
%	SYS=IDLE(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 IDLE 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 IDLE with a FLAG of zero:
%	[SIZES]=IDLE([],[],[],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',[4,42,788,560])
     open_system(sys)
end;
set_param(sys,'algorithm',     'Linear')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '10')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '0.05')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars',   '')

add_block('built-in/Note',[sys,'/',['Para outro valor da velocidade inicial é preciso',13,'modificar o valor de Ma inicial (o valor inicial',13,'do integrador) e recalcular os valores iniciais ',13,'dos elementos de atraso variável (veja submodelo',13,'TORQUE)',13,'']])
set_param([sys,'/',['Para outro valor da velocidade inicial é preciso',13,'modificar o valor de Ma inicial (o valor inicial',13,'do integrador) e recalcular os valores iniciais ',13,'dos elementos de atraso variável (veja submodelo',13,'TORQUE)',13,'']],...
		'position',[205,1193,210,1198])

add_block('built-in/Note',[sys,'/',['O ajuste dos parâmetros do modelo foi feito',13,'para a velocidade inicial de 100 rad//s e',13,'para o ângulo inicial da borboleta de 0.3 rad']])
set_param([sys,'/',['O ajuste dos parâmetros do modelo foi feito',13,'para a velocidade inicial de 100 rad//s e',13,'para o ângulo inicial da borboleta de 0.3 rad']],...
		'position',[225,1103,230,1108])

add_block('built-in/Note',[sys,'/','Ma=0.003'])
set_param([sys,'/','Ma=0.003'],...
		'position',[155,1155,165,1165])


%     Subsystem  'ENGINE'.

new_system([sys,'/','ENGINE'])
set_param([sys,'/','ENGINE'],'Location',[293,94,734,524])


%     Subsystem  'ENGINE/ENGINE'.

new_system([sys,'/','ENGINE/ENGINE'])
set_param([sys,'/','ENGINE/ENGINE'],'Location',[4,42,792,592])


%     Subsystem  'ENGINE/ENGINE/FUEL'.

new_system([sys,'/','ENGINE/ENGINE/FUEL'])
set_param([sys,'/','ENGINE/ENGINE/FUEL'],'Location',[4,42,788,560])

add_block('built-in/Note',[sys,'/','ENGINE/ENGINE/FUEL/TAUf'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/TAUf'],...
		'position',[400,255,405,260])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/FUEL/Fcn1'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Fcn1'],...
		'Expr','0.05+(1.5*pi*u[1]*u[2])/(u[3]*u[4])',...
		'position',[290,282,530,318])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/FUEL/Mux1'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Mux1'],...
		'position',[220,260,250,340])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/FUEL/OMEGA'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/OMEGA'],...
		'Port','3',...
		'position',[30,300,50,320])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/FUEL/Mux'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Mux'],...
		'inputs','2',...
		'position',[140,35,175,150])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/FUEL/Fcn'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Fcn'],...
		'Expr','u[1]/u[2]',...
		'position',[270,84,425,106])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/FUEL/BETA'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/BETA'],...
		'Port','2',...
		'position',[25,110,45,130])

add_block('built-in/Inport',[sys,'/',['ENGINE/ENGINE/FUEL/M''ai']])
set_param([sys,'/',['ENGINE/ENGINE/FUEL/M''ai']],...
		'position',[30,55,50,75])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/FUEL/MAX'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/MAX'],...
		'Port','4',...
		'position',[80,320,100,340])


%     Subsystem  'ENGINE/ENGINE/FUEL/Subsystem'.

new_system([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],'Location',[73,255,533,530])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/TAUf'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/TAUf'],...
		'Port','2',...
		'position',[35,220,55,240])

add_block('built-in/Inport',[sys,'/',['ENGINE/ENGINE/FUEL/Subsystem/M''fc']])
set_param([sys,'/',['ENGINE/ENGINE/FUEL/Subsystem/M''fc']],...
		'position',[60,80,80,100])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Fcn'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Fcn'],...
		'Expr','1/u',...
		'position',[100,220,140,240])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Product'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Product'],...
		'position',[115,80,165,120])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Product1'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Product1'],...
		'orientation',2,...
		'position',[245,149,290,191])

add_block('built-in/Sum',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Sum'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Sum'],...
		'inputs','+-',...
		'position',[200,92,230,123])

add_block('built-in/Integrator',[sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Integrator'])
set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem/Integrator'],...
		'position',[290,100,310,120])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/FUEL/Subsystem/M''fi']])
set_param([sys,'/',['ENGINE/ENGINE/FUEL/Subsystem/M''fi']],...
		'position',[425,100,445,120])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[60,230;95,230])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[85,90;110,90])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[145,230;165,230;165,160;100,160;110,110])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[170,100;195,100])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[235,110;285,110])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[315,110;420,110])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[350,110;350,160;295,160])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[165,220;320,220;320,180;295,180])
add_line([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],[240,170;190,170;195,115])


%     Finished composite block 'ENGINE/ENGINE/FUEL/Subsystem'.

set_param([sys,'/','ENGINE/ENGINE/FUEL/Subsystem'],...
		'position',[585,82,615,133])

add_block('built-in/Note',[sys,'/',['ENGINE/ENGINE/FUEL/M''fc']])
set_param([sys,'/',['ENGINE/ENGINE/FUEL/M''fc']],...
		'position',[485,70,490,75])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/FUEL/M''fi']])
set_param([sys,'/',['ENGINE/ENGINE/FUEL/M''fi']],...
		'position',[705,100,725,120])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[535,300;570,300;580,120])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[255,300;285,300])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[430,95;580,95])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[180,95;265,95])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[50,120;135,120])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[50,120;105,120;105,290;215,290])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[55,65;135,65])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[620,110;700,110])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[55,310;215,310])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[105,330;215,330])
add_line([sys,'/','ENGINE/ENGINE/FUEL'],[470,95;470,230;200,230;200,270;215,270])


%     Finished composite block 'ENGINE/ENGINE/FUEL'.

set_param([sys,'/','ENGINE/ENGINE/FUEL'],...
		'position',[270,25,325,195])


%     Subsystem  'ENGINE/ENGINE/TORQUE'.

new_system([sys,'/','ENGINE/ENGINE/TORQUE'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE'],'Location',[4,42,792,592])

add_block('built-in/Variable Transport Delay',[sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay']],...
		'Maximum delay:','10',...
		'Initial Input','100',...
		'Maximum points:','6000',...
		'position',[465,47,505,78])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/del_Tit'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/del_Tit'],...
		'Expr','5.48/u[1]',...
		'position',[280,162,360,188])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/TORQUE/Mux'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Mux'],...
		'inputs','5',...
		'position',[935,163,985,367])

add_block('built-in/Variable Transport Delay',[sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay1']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay1']],...
		'Maximum delay:','10',...
		'Initial Input','0.014',...
		'Maximum points:','6000',...
		'position',[670,302,710,333])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/SI'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/SI'],...
		'Expr','(cos(u[1] - u[2]))^2.875',...
		'position',[410,384,630,416])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/TORQUE/Mux2'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Mux2'],...
		'inputs','2',...
		'position',[265,325,310,425])

add_block('built-in/Variable Transport Delay',[sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay3']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay3']],...
		'Maximum delay:','10',...
		'Initial Input','1',...
		'Maximum points:','6000',...
		'position',[755,437,795,468])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/del_Tst'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/del_Tst'],...
		'Expr','1.3/u[1]',...
		'position',[410,444,520,466])


%     Subsystem  'ENGINE/ENGINE/TORQUE/Subsystem'.

new_system([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],'Location',[4,447,409,662])

add_block('built-in/Switch',[sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Switch'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Switch'],...
		'Threshold','0.5',...
		'position',[265,65,295,95])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Constant1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Constant1'],...
		'Value','100',...
		'position',[25,59,100,81])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Constant'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/Constant'],...
		'Value','0',...
		'position',[120,160,140,180])

add_block('built-in/Relational Operator',[sys,'/',['ENGINE/ENGINE/TORQUE/Subsystem/Relational',13,'Operator']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Subsystem/Relational',13,'Operator']],...
		'orientation',3,...
		'Operator','==',...
		'position',[155,130,190,150])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/in_1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/in_1'],...
		'position',[200,185,220,205])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/out_1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem/out_1'],...
		'position',[340,70,360,90])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[225,195;225,90;260,90])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[225,165;180,155])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[175,125;175,115;105,115;105,80;260,80])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[105,70;260,70])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[145,170;165,170;165,155])
add_line([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],[300,80;335,80])


%     Finished composite block 'ENGINE/ENGINE/TORQUE/Subsystem'.

set_param([sys,'/','ENGINE/ENGINE/TORQUE/Subsystem'],...
		'orientation',3,...
		'position',[225,520,255,570])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/TORQUE/Mux1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Mux1'],...
		'inputs','2',...
		'position',[220,197,255,273])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/AFI'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/AFI'],...
		'Expr','cos(0.12886464*( u[1]/u[2] - 13.5))',...
		'position',[280,215,555,245])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/Ti'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Ti'],...
		'orientation',2,...
		'Expr','u[3]*u[4]*u[2]*u[5]/u[1]',...
		'position',[775,571,985,599])

add_block('built-in/Sum',[sys,'/','ENGINE/ENGINE/TORQUE/Sum'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Sum'],...
		'orientation',2,...
		'inputs','+-+',...
		'position',[625,574,655,616])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/Tf'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Tf'],...
		'Expr','0.1056*u[1] + 15.1',...
		'position',[410,650,570,670])

add_block('built-in/Inport',[sys,'/',['ENGINE/ENGINE/TORQUE/M''ao']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/M''ao']],...
		'position',[170,205,190,225])

add_block('built-in/Inport',[sys,'/',['ENGINE/ENGINE/TORQUE/M''fi']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/M''fi']],...
		'Port','2',...
		'position',[170,245,190,265])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/SA'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/SA'],...
		'Port','4',...
		'position',[215,340,235,360])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/MTB'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/MTB'],...
		'Port','5',...
		'position',[215,390,235,410])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/momento_inercia'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/momento_inercia'],...
		'orientation',2,...
		'Port','6',...
		'position',[540,610,560,630])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/TORQUE/Mux3'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Mux3'],...
		'orientation',2,...
		'inputs','2',...
		'position',[475,580,510,615])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/TORQUE/Outport'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Outport'],...
		'Port','2',...
		'position',[400,515,420,535])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/TORQUE/aceleracao'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/aceleracao'],...
		'orientation',2,...
		'Expr','u[1]/u[2]',...
		'position',[385,589,460,611])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/TORQUE/OMEGA'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/OMEGA'],...
		'orientation',3,...
		'position',[275,475,295,495])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/TORQUE/Outport1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Outport1'],...
		'Port','3',...
		'position',[795,615,815,635])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/torq_externo'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/torq_externo'],...
		'Port','7',...
		'position',[70,635,90,655])

add_block('built-in/Integrator',[sys,'/','ENGINE/ENGINE/TORQUE/Integrator'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Integrator'],...
		'orientation',2,...
		'Initial','100',...
		'position',[265,590,285,610])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE/Ct'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Ct'],...
		'Port','3',...
		'position',[855,255,875,275])

add_block('built-in/Variable Transport Delay',[sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay2']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Variable',13,'Transport Delay2']],...
		'Maximum delay:','10',...
		'Initial Input','0.5',...
		'Maximum points:','6000',...
		'position',[665,172,705,203])

add_block('built-in/Relational Operator',[sys,'/',['ENGINE/ENGINE/TORQUE/Relational',13,'Operator']])
set_param([sys,'/',['ENGINE/ENGINE/TORQUE/Relational',13,'Operator']],...
		'Operator','<',...
		'position',[745,181,780,219])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/TORQUE/Constant'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Constant'],...
		'Value','0',...
		'position',[670,245,690,265])

add_block('built-in/Switch',[sys,'/','ENGINE/ENGINE/TORQUE/Switch'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Switch'],...
		'Threshold','0.5',...
		'position',[840,184,870,216])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/TORQUE/Constant1'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE/Constant1'],...
		'Value','0',...
		'position',[780,85,800,105])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[770,585;660,580])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[365,175;415,175;415,70;460,70])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[415,135;600,135;600,325;665,325])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[600,195;660,195])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[800,455;895,455;895,345;930,345])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[240,515;240,470;130,435;130,65;375,65;460,55])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[193,455;405,455])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[175,449;175,660;405,660])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[130,135;275,175])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[260,235;275,230])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[315,375;405,400])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[195,215;215,215])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[205,215;205,310;665,310])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[560,230;645,230;645,180;660,180])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[635,400;750,445])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[525,455;570,455;570,450;655,460;750,460])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[990,265;1010,265;1010,585;990,585])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[575,660;675,660;675,595;660,595])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[470,600;465,600])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[195,255;215,255])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[880,265;930,265])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[240,350;260,350])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[240,400;260,400])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[240,515;285,500])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[535,620;515,605])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[95,645;160,645;160,690;720,690;720,610;660,610])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[620,595;575,595;575,590;515,590])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[260,600;240,600;240,575])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[380,600;290,600])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[365,600;365,525;395,525])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[755,584;755,625;790,625])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[695,255;725,255;725,210;740,210])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[785,200;835,200])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[805,95;820,95;820,190;835,190])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[875,200;905,200;905,225;930,225])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[510,65;905,65;905,185;930,185])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[715,320;760,320;760,305;930,305])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[710,190;740,190])
add_line([sys,'/','ENGINE/ENGINE/TORQUE'],[720,190;720,140;800,140;800,210;835,210])


%     Finished composite block 'ENGINE/ENGINE/TORQUE'.

set_param([sys,'/','ENGINE/ENGINE/TORQUE'],...
		'position',[600,90,660,420])

add_block('built-in/Note',[sys,'/',['ENGINE/ENGINE/M''fi_']])
set_param([sys,'/',['ENGINE/ENGINE/M''fi_']],...
		'position',[360,85,365,90])


%     Subsystem  'ENGINE/ENGINE/AIR'.

new_system([sys,'/','ENGINE/ENGINE/AIR'])
set_param([sys,'/','ENGINE/ENGINE/AIR'],'Location',[4,42,792,592])


%     Subsystem  'ENGINE/ENGINE/AIR/air_3'.

new_system([sys,'/','ENGINE/ENGINE/AIR/air_3'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3'],'Location',[4,42,792,592])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/AIR/air_3/NUvol'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/NUvol'],...
		'Expr','(24.5*u[2] - 31000)*u[1]*u[1]+(-0.167*u[2]+222)*u[1]+(0.00081*u[2]+0.352)',...
		'position',[195,152,730,218])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/AIR/air_3/C1'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/C1'],...
		'Expr','u[2]/u[1]',...
		'position',[385,274,495,296])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_3/Vm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Vm'],...
		'Port','3',...
		'position',[25,355,45,375])

add_block('built-in/Gain',[sys,'/','ENGINE/ENGINE/AIR/air_3/Gain'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Gain'],...
		'Gain','4*pi',...
		'position',[75,353,155,387])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/AIR/air_3/Mux3'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Mux3'],...
		'inputs','2',...
		'position',[260,371,290,404])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_3/Ve'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Ve'],...
		'Port','4',...
		'position',[35,425,55,445])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_3/Ma'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Ma'],...
		'position',[25,140,45,160])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/AIR/air_3/Mux2'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Mux2'],...
		'inputs','2',...
		'position',[135,137,175,208])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/AIR/air_3/M''ao']])
set_param([sys,'/',['ENGINE/ENGINE/AIR/air_3/M''ao']],...
		'position',[855,235,875,255])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/AIR/air_3/Product4'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/Product4'],...
		'inputs','4',...
		'position',[780,208,810,282])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_3/OMEGA'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_3/OMEGA'],...
		'Port','2',...
		'position',[25,200,45,220])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[50,210;130,190])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[50,150;130,155])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[180,175;190,185])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[160,370;255,380])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[295,390;380,285])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[735,185;745,185;745,215;775,215])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[500,285;565,285;565,255;775,255])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[815,245;850,245])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[50,365;70,370])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[60,435;255,395])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[115,191;115,235;775,235])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_3'],[95,153;95,85;920,85;920,330;730,330;730,275;775,275])


%     Finished composite block 'ENGINE/ENGINE/AIR/air_3'.

set_param([sys,'/','ENGINE/ENGINE/AIR/air_3'],...
		'position',[665,130,705,345])


%     Subsystem  'ENGINE/ENGINE/AIR/air_2'.

new_system([sys,'/','ENGINE/ENGINE/AIR/air_2'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2'],'Location',[5,337,845,692])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/AIR/air_2/Product2'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Product2'],...
		'position',[335,243,365,287])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/AIR/air_2/Product3'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Product3'],...
		'inputs','3',...
		'position',[375,133,405,217])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/AIR/air_2/Mux1'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Mux1'],...
		'inputs','2',...
		'position',[460,171,490,204])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/AIR/air_2/Pm_'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Pm_'],...
		'Expr','u[1]/u[2]',...
		'position',[540,174,670,196])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/AIR/air_2/Pm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Pm'],...
		'position',[700,175,720,195])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_2/Ma'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Ma'],...
		'position',[160,65,180,85])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_2/R'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/R'],...
		'Port','2',...
		'position',[165,120,185,140])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_2/Tm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Tm'],...
		'Port','3',...
		'position',[165,180,185,200])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_2/Vm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Vm'],...
		'Port','5',...
		'position',[155,295,175,315])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_2/Mair'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_2/Mair'],...
		'Port','4',...
		'position',[165,235,185,255])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[410,175;424,175;424,180;455,180])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[495,190;535,185])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[370,265;439,265;455,195])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[185,75;370,145])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[190,130;370,175])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[675,185;695,185])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[190,190;370,205])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[190,245;330,255])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_2'],[180,305;330,275])


%     Finished composite block 'ENGINE/ENGINE/AIR/air_2'.

set_param([sys,'/','ENGINE/ENGINE/AIR/air_2'],...
		'position',[130,73,170,337])

add_block('built-in/Integrator',[sys,'/','ENGINE/ENGINE/AIR/Integrator'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Integrator'],...
		'Initial','0.0047',...
		'position',[525,480,545,500])

add_block('built-in/Sum',[sys,'/','ENGINE/ENGINE/AIR/Sum'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Sum'],...
		'inputs','-+',...
		'position',[405,459,440,521])


%     Subsystem  'ENGINE/ENGINE/AIR/air_1'.

new_system([sys,'/','ENGINE/ENGINE/AIR/air_1'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1'],'Location',[165,52,948,632])

add_block('built-in/Mux',[sys,'/','ENGINE/ENGINE/AIR/air_1/Mux'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Mux'],...
		'inputs','2',...
		'position',[205,414,240,501])

add_block('built-in/Switch',[sys,'/','ENGINE/ENGINE/AIR/air_1/Switch'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Switch'],...
		'Threshold','0.5',...
		'position',[540,271,565,349])

add_block('built-in/Product',[sys,'/','ENGINE/ENGINE/AIR/air_1/Product'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Product'],...
		'inputs','3',...
		'position',[575,80,605,150])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/AIR/air_1/Fcn_'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Fcn_'],...
		'Expr','1-cos(1.14459*u[1] - 0.0185)',...
		'position',[270,184,500,216])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/AIR/air_1/Constant'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Constant'],...
		'position',[430,325,450,345])

add_block('built-in/Fcn',[sys,'/','ENGINE/ENGINE/AIR/air_1/Fcn'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Fcn'],...
		'Expr','1-exp(9*(u[2]/u[1] - 1))',...
		'position',[300,417,465,443])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/AIR/air_1/M''ai']])
set_param([sys,'/',['ENGINE/ENGINE/AIR/air_1/M''ai']],...
		'position',[695,105,715,125])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_1/ALFA'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/ALFA'],...
		'Port','2',...
		'position',[15,185,35,205])

add_block('built-in/Note',[sys,'/','ENGINE/ENGINE/AIR/air_1/PRI'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/PRI'],...
		'position',[549,395,554,400])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_1/Pm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Pm'],...
		'Port','4',...
		'position',[25,470,45,490])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_1/Patm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/Patm'],...
		'Port','3',...
		'position',[20,420,40,440])

add_block('built-in/Relational Operator',[sys,'/',['ENGINE/ENGINE/AIR/air_1/Relational',13,'Operator']])
set_param([sys,'/',['ENGINE/ENGINE/AIR/air_1/Relational',13,'Operator']],...
		'Operator','<',...
		'position',[315,293,345,317])

add_block('built-in/Constant',[sys,'/','ENGINE/ENGINE/AIR/air_1/79.46graus'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/79.46graus'],...
		'Value','1.3868',...
		'position',[210,334,270,356])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/air_1/MAX'])
set_param([sys,'/','ENGINE/ENGINE/AIR/air_1/MAX'],...
		'position',[15,80,35,100])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[570,310;595,305;585,250;534,245;534,115;570,115])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[505,200;504,285;535,285])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[455,335;535,335])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[350,305;535,310])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[275,345;310,310])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[245,460;295,430])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[470,430;610,430;610,230;549,225;549,140;570,140])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[40,90;570,90])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[610,115;690,115])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[50,480;200,480])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[45,430;115,430;115,435;200,435])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[40,195;145,195;145,200;265,200])
add_line([sys,'/','ENGINE/ENGINE/AIR/air_1'],[220,200;220,300;310,300])


%     Finished composite block 'ENGINE/ENGINE/AIR/air_1'.

set_param([sys,'/','ENGINE/ENGINE/AIR/air_1'],...
		'position',[210,386,265,624])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/R'])
set_param([sys,'/','ENGINE/ENGINE/AIR/R'],...
		'position',[15,125,35,145])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/AIR/M''ai']])
set_param([sys,'/',['ENGINE/ENGINE/AIR/M''ai']],...
		'Port','4',...
		'position',[320,535,340,555])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/OMEGA'])
set_param([sys,'/','ENGINE/ENGINE/AIR/OMEGA'],...
		'Port','3',...
		'position',[430,200,450,220])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/Tm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Tm'],...
		'Port','2',...
		'position',[15,190,35,210])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/AIR/out_1'])
set_param([sys,'/','ENGINE/ENGINE/AIR/out_1'],...
		'position',[220,155,240,175])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/AIR/M''ao']])
set_param([sys,'/',['ENGINE/ENGINE/AIR/M''ao']],...
		'Port','2',...
		'position',[740,190,760,210])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/AIR/Ma'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Ma'],...
		'Port','3',...
		'position',[690,480,710,500])

add_block('built-in/Note',[sys,'/','ENGINE/ENGINE/AIR/Pm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Pm'],...
		'position',[255,210,260,215])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/Mair'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Mair'],...
		'Port','4',...
		'position',[15,245,35,265])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/Vm'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Vm'],...
		'Port','5',...
		'position',[15,295,35,315])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/Ve'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Ve'],...
		'Port','6',...
		'position',[445,310,465,330])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/MAX_'])
set_param([sys,'/','ENGINE/ENGINE/AIR/MAX_'],...
		'Port','7',...
		'position',[25,405,45,425])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/ALFA_'])
set_param([sys,'/','ENGINE/ENGINE/AIR/ALFA_'],...
		'Port','8',...
		'position',[20,460,40,480])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/AIR/Patm_'])
set_param([sys,'/','ENGINE/ENGINE/AIR/Patm_'],...
		'Port','9',...
		'position',[20,520,40,540])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[550,490;570,490;565,155;660,155])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[585,155;585,50;90,50;90,105;125,105])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[175,205;215,165])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[175,205;285,205;285,670;170,670;170,595;205,595])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[710,240;730,240;730,415;380,415;380,475;400,475])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[445,490;520,490])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[270,505;400,505])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[40,135;105,155;125,155])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[40,200;40,200;105,205;125,205])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[455,210;660,210])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[710,240;735,200])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[40,255;125,255])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[550,490;685,490])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[270,505;315,545])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[40,305;125,305])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[95,305;95,370;365,370;365,265;660,265])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[470,320;660,320])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[50,415;205,415])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[45,470;120,470;120,475;205,475])
add_line([sys,'/','ENGINE/ENGINE/AIR'],[45,530;120,530;120,535;205,535])


%     Finished composite block 'ENGINE/ENGINE/AIR'.

set_param([sys,'/','ENGINE/ENGINE/AIR'],...
		'position',[250,428,335,902])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/MAX_'])
set_param([sys,'/','ENGINE/ENGINE/MAX_'],...
		'Port','2',...
		'position',[20,160,40,180])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/BETA'])
set_param([sys,'/','ENGINE/ENGINE/BETA'],...
		'position',[20,80,40,100])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/M''fi']])
set_param([sys,'/',['ENGINE/ENGINE/M''fi']],...
		'position',[855,45,875,65])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/MTB'])
set_param([sys,'/','ENGINE/ENGINE/MTB'],...
		'Port','5',...
		'position',[365,290,385,310])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/SA'])
set_param([sys,'/','ENGINE/ENGINE/SA'],...
		'Port','4',...
		'position',[450,245,470,265])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Ie'])
set_param([sys,'/','ENGINE/ENGINE/Ie'],...
		'Port','6',...
		'position',[450,335,470,355])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Tm'])
set_param([sys,'/','ENGINE/ENGINE/Tm'],...
		'Port','8',...
		'position',[15,505,35,525])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Vm'])
set_param([sys,'/','ENGINE/ENGINE/Vm'],...
		'Port','10',...
		'position',[20,655,40,675])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Mair'])
set_param([sys,'/','ENGINE/ENGINE/Mair'],...
		'Port','9',...
		'position',[20,605,40,625])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/R'])
set_param([sys,'/','ENGINE/ENGINE/R'],...
		'Port','7',...
		'position',[15,455,35,475])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/Pm'])
set_param([sys,'/','ENGINE/ENGINE/Pm'],...
		'Port','2',...
		'position',[750,475,770,495])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/M''ao']])
set_param([sys,'/',['ENGINE/ENGINE/M''ao']],...
		'Port','3',...
		'position',[755,575,775,595])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/Ma'])
set_param([sys,'/','ENGINE/ENGINE/Ma'],...
		'Port','4',...
		'position',[740,715,760,735])

add_block('built-in/Outport',[sys,'/',['ENGINE/ENGINE/M''ai']])
set_param([sys,'/',['ENGINE/ENGINE/M''ai']],...
		'Port','5',...
		'position',[745,860,765,880])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/aceleracao'])
set_param([sys,'/','ENGINE/ENGINE/aceleracao'],...
		'Port','6',...
		'position',[815,245,835,265])

add_block('built-in/Note',[sys,'/','ENGINE/ENGINE/OMEGA_'])
set_param([sys,'/','ENGINE/ENGINE/OMEGA_'],...
		'position',[720,110,725,115])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Ve'])
set_param([sys,'/','ENGINE/ENGINE/Ve'],...
		'Port','11',...
		'position',[25,705,45,725])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/ALFA'])
set_param([sys,'/','ENGINE/ENGINE/ALFA'],...
		'Port','12',...
		'position',[70,805,90,825])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Patm'])
set_param([sys,'/','ENGINE/ENGINE/Patm'],...
		'Port','13',...
		'position',[65,855,85,875])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/Ct'])
set_param([sys,'/','ENGINE/ENGINE/Ct'],...
		'Port','3',...
		'position',[380,200,400,220])

add_block('built-in/Inport',[sys,'/','ENGINE/ENGINE/TORQUE_externo'])
set_param([sys,'/','ENGINE/ENGINE/TORQUE_externo'],...
		'Port','14',...
		'position',[355,380,375,400])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/Ti'])
set_param([sys,'/','ENGINE/ENGINE/Ti'],...
		'Port','7',...
		'position',[910,355,930,375])

add_block('built-in/Outport',[sys,'/','ENGINE/ENGINE/OMEGAe'])
set_param([sys,'/','ENGINE/ENGINE/OMEGAe'],...
		'Port','8',...
		'position',[860,125,880,145])
add_line([sys,'/','ENGINE/ENGINE'],[340,605;525,605;525,120;595,120])
add_line([sys,'/','ENGINE/ENGINE'],[330,110;440,110;440,165;595,165])
add_line([sys,'/','ENGINE/ENGINE'],[45,665;245,665])
add_line([sys,'/','ENGINE/ENGINE'],[45,90;265,90])
add_line([sys,'/','ENGINE/ENGINE'],[330,110;495,110;495,55;850,55])
add_line([sys,'/','ENGINE/ENGINE'],[45,170;265,170])
add_line([sys,'/','ENGINE/ENGINE'],[405,210;595,210])
add_line([sys,'/','ENGINE/ENGINE'],[475,255;595,255])
add_line([sys,'/','ENGINE/ENGINE'],[390,300;595,300])
add_line([sys,'/','ENGINE/ENGINE'],[475,345;595,345])
add_line([sys,'/','ENGINE/ENGINE'],[40,465;245,465])
add_line([sys,'/','ENGINE/ENGINE'],[40,515;245,515])
add_line([sys,'/','ENGINE/ENGINE'],[45,615;245,615])
add_line([sys,'/','ENGINE/ENGINE'],[380,390;595,390])
add_line([sys,'/','ENGINE/ENGINE'],[665,365;905,365])
add_line([sys,'/','ENGINE/ENGINE'],[665,145;775,145;775,10;165,10;165,130;265,130])
add_line([sys,'/','ENGINE/ENGINE'],[210,130;210,565;245,565])
add_line([sys,'/','ENGINE/ENGINE'],[340,845;365,845;365,920;140,920;140,50;265,50])
add_line([sys,'/','ENGINE/ENGINE'],[340,485;745,485])
add_line([sys,'/','ENGINE/ENGINE'],[525,585;750,585])
add_line([sys,'/','ENGINE/ENGINE'],[340,725;735,725])
add_line([sys,'/','ENGINE/ENGINE'],[365,870;740,870])
add_line([sys,'/','ENGINE/ENGINE'],[665,255;810,255])
add_line([sys,'/','ENGINE/ENGINE'],[50,715;245,715])
add_line([sys,'/','ENGINE/ENGINE'],[120,170;120,765;245,765])
add_line([sys,'/','ENGINE/ENGINE'],[95,815;245,815])
add_line([sys,'/','ENGINE/ENGINE'],[90,865;245,865])
add_line([sys,'/','ENGINE/ENGINE'],[775,135;855,135])


%     Finished composite block 'ENGINE/ENGINE'.

set_param([sys,'/','ENGINE/ENGINE'],...
		'Drop Shadow',4,...
		'position',[275,14,330,381])

add_block('built-in/Constant',[sys,'/','ENGINE/MAX'])
set_param([sys,'/','ENGINE/MAX'],...
		'Value','0.1843',...
		'position',[160,49,240,71])

add_block('built-in/Constant',[sys,'/','ENGINE/Ct'])
set_param([sys,'/','ENGINE/Ct'],...
		'Value','498636',...
		'position',[40,72,140,98])

add_block('built-in/Constant',[sys,'/','ENGINE/MTB'])
set_param([sys,'/','ENGINE/MTB'],...
		'position',[80,124,125,146])

add_block('built-in/Inport',[sys,'/','ENGINE/in_2'])
set_param([sys,'/','ENGINE/in_2'],...
		'Port','2',...
		'position',[15,300,35,320])

add_block('built-in/Constant',[sys,'/','ENGINE/Vm'])
set_param([sys,'/','ENGINE/Vm'],...
		'Value','0.0038',...
		'position',[155,249,235,271])

add_block('built-in/Constant',[sys,'/','ENGINE/Tm'])
set_param([sys,'/','ENGINE/Tm'],...
		'Value','300',...
		'position',[165,199,240,221])

add_block('built-in/Constant',[sys,'/','ENGINE/Ie'])
set_param([sys,'/','ENGINE/Ie'],...
		'Value','0.1454',...
		'position',[180,147,245,173])

add_block('built-in/Constant',[sys,'/','ENGINE/R'])
set_param([sys,'/','ENGINE/R'],...
		'Value','8314.3',...
		'position',[65,174,150,196])

add_block('built-in/Constant',[sys,'/','ENGINE/Mair'])
set_param([sys,'/','ENGINE/Mair'],...
		'Value','28.84',...
		'position',[70,224,150,246])

add_block('built-in/Constant',[sys,'/','ENGINE/Ve'])
set_param([sys,'/','ENGINE/Ve'],...
		'Value','0.0027',...
		'position',[60,275,145,295])

add_block('built-in/Constant',[sys,'/','ENGINE/Patm'])
set_param([sys,'/','ENGINE/Patm'],...
		'Value','110000',...
		'position',[105,324,200,346])

add_block('built-in/Inport',[sys,'/','ENGINE/in_3'])
set_param([sys,'/','ENGINE/in_3'],...
		'Port','3',...
		'position',[15,350,35,370])

add_block('built-in/Outport',[sys,'/','ENGINE/out_1'])
set_param([sys,'/','ENGINE/out_1'],...
		'position',[360,30,380,50])

add_block('built-in/Outport',[sys,'/','ENGINE/out_2'])
set_param([sys,'/','ENGINE/out_2'],...
		'Port','2',...
		'position',[360,75,380,95])

add_block('built-in/Outport',[sys,'/','ENGINE/out_3'])
set_param([sys,'/','ENGINE/out_3'],...
		'Port','3',...
		'position',[360,120,380,140])

add_block('built-in/Outport',[sys,'/','ENGINE/out_4'])
set_param([sys,'/','ENGINE/out_4'],...
		'Port','4',...
		'position',[360,165,380,185])

add_block('built-in/Outport',[sys,'/','ENGINE/out_5'])
set_param([sys,'/','ENGINE/out_5'],...
		'Port','5',...
		'position',[360,210,380,230])

add_block('built-in/Outport',[sys,'/','ENGINE/out_6'])
set_param([sys,'/','ENGINE/out_6'],...
		'Port','6',...
		'position',[360,255,380,275])

add_block('built-in/Outport',[sys,'/','ENGINE/out_7'])
set_param([sys,'/','ENGINE/out_7'],...
		'Port','7',...
		'position',[365,300,385,320])

add_block('built-in/Outport',[sys,'/','ENGINE/out_8'])
set_param([sys,'/','ENGINE/out_8'],...
		'Port','8',...
		'position',[360,345,380,365])

add_block('built-in/Constant',[sys,'/','ENGINE/BETA'])
set_param([sys,'/','ENGINE/BETA'],...
		'Value','14.7',...
		'position',[65,24,145,46])

add_block('built-in/Inport',[sys,'/','ENGINE/in_1'])
set_param([sys,'/','ENGINE/in_1'],...
		'position',[15,100,35,120])
add_line([sys,'/','ENGINE'],[205,335;270,335])
add_line([sys,'/','ENGINE'],[150,285;270,285])
add_line([sys,'/','ENGINE'],[240,260;270,260])
add_line([sys,'/','ENGINE'],[155,235;270,235])
add_line([sys,'/','ENGINE'],[245,210;270,210])
add_line([sys,'/','ENGINE'],[155,185;270,185])
add_line([sys,'/','ENGINE'],[250,160;270,160])
add_line([sys,'/','ENGINE'],[130,135;270,135])
add_line([sys,'/','ENGINE'],[145,85;270,85])
add_line([sys,'/','ENGINE'],[245,60;270,60])
add_line([sys,'/','ENGINE'],[335,40;355,40])
add_line([sys,'/','ENGINE'],[335,85;355,85])
add_line([sys,'/','ENGINE'],[335,130;355,130])
add_line([sys,'/','ENGINE'],[335,175;355,175])
add_line([sys,'/','ENGINE'],[335,220;355,220])
add_line([sys,'/','ENGINE'],[335,265;355,265])
add_line([sys,'/','ENGINE'],[335,310;360,310])
add_line([sys,'/','ENGINE'],[40,310;270,310])
add_line([sys,'/','ENGINE'],[335,355;355,355])
add_line([sys,'/','ENGINE'],[40,360;270,360])
add_line([sys,'/','ENGINE'],[150,35;270,35])
add_line([sys,'/','ENGINE'],[40,110;270,110])


%     Finished composite block 'ENGINE'.

set_param([sys,'/','ENGINE'],...
		'Drop Shadow',4,...
		'position',[385,13,440,247])


%     Subsystem  'SPARK ADVANCE '.

new_system([sys,'/','SPARK ADVANCE '])
set_param([sys,'/','SPARK ADVANCE '],'Location',[0,59,274,252])

add_block('built-in/Inport',[sys,'/','SPARK ADVANCE /x'])
set_param([sys,'/','SPARK ADVANCE /x'],...
		'position',[65,55,85,75])

add_block('built-in/S-Function',[sys,'/',['SPARK ADVANCE /S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['SPARK ADVANCE /S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunyst',...
		'parameters','ax, color, npts, dt',...
		'position',[130,55,180,75])
add_line([sys,'/','SPARK ADVANCE '],[90,65;125,65])
set_param([sys,'/','SPARK ADVANCE '],...
		'Mask Display','plot(0,0,100,100,[83,76,63,52,42,38,28,16,11,84,11,11,11,90,90,11],[75,58,47,54,72,80,84,74,65,65,65,90,40,40,90,90])',...
		'Mask Type','Storage scope.')
set_param([sys,'/','SPARK ADVANCE '],...
		'Mask Dialogue','Storage scope using MATLAB graph window.\nEnter plotting ranges and line type.|Initial Time Range:|Initial y-min:|Initial y-max:|Storage pts.:|Line type (rgbw-.:xo):')
set_param([sys,'/','SPARK ADVANCE '],...
		'Mask Translate','npts = @4; color = @5; ax = [0, @1, @2, @3]; dt=-1;')
set_param([sys,'/','SPARK ADVANCE '],...
		'Mask Help','This block uses a MATLAB figure window to plot the input signal.  The graph limits are automatically scaled to the min and max values of the signal stored in the scope''s signal buffer.  Line type must be in quotes.  See the M-file sfunyst.m.')
set_param([sys,'/','SPARK ADVANCE '],...
		'Mask Entries','5\/-10\/10\/6000\/''k-/k-./c-./w:/m*/ro/b+''\/')


%     Finished composite block 'SPARK ADVANCE '.

set_param([sys,'/','SPARK ADVANCE '],...
		'position',[490,20,520,60])


%     Subsystem  'REFERENCE  SPEED'.

new_system([sys,'/','REFERENCE  SPEED'])
set_param([sys,'/','REFERENCE  SPEED'],'Location',[0,59,274,252])

add_block('built-in/Inport',[sys,'/','REFERENCE  SPEED/x'])
set_param([sys,'/','REFERENCE  SPEED/x'],...
		'position',[65,55,85,75])

add_block('built-in/S-Function',[sys,'/',['REFERENCE  SPEED/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['REFERENCE  SPEED/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunyst',...
		'parameters','ax, color, npts, dt',...
		'position',[130,55,180,75])
add_line([sys,'/','REFERENCE  SPEED'],[90,65;125,65])
set_param([sys,'/','REFERENCE  SPEED'],...
		'Mask Display','plot(0,0,100,100,[83,76,63,52,42,38,28,16,11,84,11,11,11,90,90,11],[75,58,47,54,72,80,84,74,65,65,65,90,40,40,90,90])',...
		'Mask Type','Storage scope.')
set_param([sys,'/','REFERENCE  SPEED'],...
		'Mask Dialogue','Storage scope using MATLAB graph window.\nEnter plotting ranges and line type.|Initial Time Range:|Initial y-min:|Initial y-max:|Storage pts.:|Line type (rgbw-.:xo):')
set_param([sys,'/','REFERENCE  SPEED'],...
		'Mask Translate','npts = @4; color = @5; ax = [0, @1, @2, @3]; dt=-1;')
set_param([sys,'/','REFERENCE  SPEED'],...
		'Mask Help','This block uses a MATLAB figure window to plot the input signal.  The graph limits are automatically scaled to the min and max values of the signal stored in the scope''s signal buffer.  Line type must be in quotes.  See the M-file sfunyst.m.')
set_param([sys,'/','REFERENCE  SPEED'],...
		'Mask Entries','5\/-10\/10\/6000\/''k-/k-./c-./w:/m*/ro/b+''\/')


%     Finished composite block 'REFERENCE  SPEED'.

set_param([sys,'/','REFERENCE  SPEED'],...
		'position',[245,390,275,430])

add_block('built-in/Step Fcn',[sys,'/','Step Input2'])
set_param([sys,'/','Step Input2'],...
		'Time','2',...
		'After','-50',...
		'position',[50,385,70,405])

add_block('built-in/Constant',[sys,'/','SPEED'])
set_param([sys,'/','SPEED'],...
		'Value','150',...
		'position',[25,444,75,476])

add_block('built-in/Sum',[sys,'/','Sum3'])
set_param([sys,'/','Sum3'],...
		'position',[140,382,165,433])

add_block('built-in/Sum',[sys,'/','Sum1'])
set_param([sys,'/','Sum1'],...
		'inputs','+-',...
		'position',[315,317,340,373])

add_block('built-in/Step Fcn',[sys,'/','Step Input1'])
set_param([sys,'/','Step Input1'],...
		'Time','6.5',...
		'After','15',...
		'position',[130,220,150,240])


%     Subsystem  'External Torque'.

new_system([sys,'/','External Torque'])
set_param([sys,'/','External Torque'],'Location',[0,59,274,252])

add_block('built-in/Inport',[sys,'/','External Torque/x'])
set_param([sys,'/','External Torque/x'],...
		'position',[65,55,85,75])

add_block('built-in/S-Function',[sys,'/',['External Torque/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',['External Torque/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunyst',...
		'parameters','ax, color, npts, dt',...
		'position',[130,55,180,75])
add_line([sys,'/','External Torque'],[90,65;125,65])
set_param([sys,'/','External Torque'],...
		'Mask Display','plot(0,0,100,100,[83,76,63,52,42,38,28,16,11,84,11,11,11,90,90,11],[75,58,47,54,72,80,84,74,65,65,65,90,40,40,90,90])',...
		'Mask Type','Storage scope.')
set_param([sys,'/','External Torque'],...
		'Mask Dialogue','Storage scope using MATLAB graph window.\nEnter plotting ranges and line type.|Initial Time Range:|Initial y-min:|Initial y-max:|Storage pts.:|Line type (rgbw-.:xo):')
set_param([sys,'/','External Torque'],...
		'Mask Translate','npts = @4; color = @5; ax = [0, @1, @2, @3]; dt=-1;')
set_param([sys,'/','External Torque'],...
		'Mask Help','This block uses a MATLAB figure window to plot the input signal.  The graph limits are automatically scaled to the min and max values of the signal stored in the scope''s signal buffer.  Line type must be in quotes.  See the M-file sfunyst.m.')
set_param([sys,'/','External Torque'],...
		'Mask Entries','5\/-10\/10\/6000\/''k-/k-./c-./w:/m*/ro/b+''\/')


%     Finished composite block 'External Torque'.

set_param([sys,'/','External Torque'],...
		'position',[315,135,345,175])

add_block('built-in/Sum',[sys,'/','Sum2'])
set_param([sys,'/','Sum2'],...
		'position',[210,172,235,248])

add_block('built-in/Step Fcn',[sys,'/','Step Input'])
set_param([sys,'/','Step Input'],...
		'Time','4',...
		'After','-10',...
		'position',[140,180,160,200])

add_block('built-in/Constant',[sys,'/','alfa'])
set_param([sys,'/','alfa'],...
		'Value','0.32',...
		'position',[165,119,235,141])

add_block('built-in/Relay',[sys,'/','Relay'])
set_param([sys,'/','Relay'],...
		'Off_output_value','0.2',...
		'position',[225,38,255,62])


%     Subsystem  ' ENGINE  SPEED'.

new_system([sys,'/',' ENGINE  SPEED'])
set_param([sys,'/',' ENGINE  SPEED'],'Location',[0,59,274,252])

add_block('built-in/Inport',[sys,'/',' ENGINE  SPEED/x'])
set_param([sys,'/',' ENGINE  SPEED/x'],...
		'position',[65,55,85,75])

add_block('built-in/S-Function',[sys,'/',[' ENGINE  SPEED/S-function',13,'M-file which plots',13,'lines',13,'']])
set_param([sys,'/',[' ENGINE  SPEED/S-function',13,'M-file which plots',13,'lines',13,'']],...
		'function name','sfunyst',...
		'parameters','ax, color, npts, dt',...
		'position',[130,55,180,75])
add_line([sys,'/',' ENGINE  SPEED'],[90,65;125,65])
set_param([sys,'/',' ENGINE  SPEED'],...
		'Mask Display','plot(0,0,100,100,[83,76,63,52,42,38,28,16,11,84,11,11,11,90,90,11],[75,58,47,54,72,80,84,74,65,65,65,90,40,40,90,90])',...
		'Mask Type','Storage scope.')
set_param([sys,'/',' ENGINE  SPEED'],...
		'Mask Dialogue','Storage scope using MATLAB graph window.\nEnter plotting ranges and line type.|Initial Time Range:|Initial y-min:|Initial y-max:|Storage pts.:|Line type (rgbw-.:xo):')
set_param([sys,'/',' ENGINE  SPEED'],...
		'Mask Translate','npts = @4; color = @5; ax = [0, @1, @2, @3]; dt=-1;')
set_param([sys,'/',' ENGINE  SPEED'],...
		'Mask Help','This block uses a MATLAB figure window to plot the input signal.  The graph limits are automatically scaled to the min and max values of the signal stored in the scope''s signal buffer.  Line type must be in quotes.  See the M-file sfunyst.m.')
set_param([sys,'/',' ENGINE  SPEED'],...
		'Mask Entries','5\/-10\/10\/6000\/''k-/k-./c-./w:/m*/ro/b+''\/')


%     Finished composite block ' ENGINE  SPEED'.

set_param([sys,'/',' ENGINE  SPEED'],...
		'position',[525,215,555,255])
add_line(sys,[240,130;380,130])
add_line(sys,[170,410;200,410;200,330;310,330])
add_line(sys,[345,345;375,345;375,300;75,300;75,50;220,50])
add_line(sys,[240,210;380,210])
add_line(sys,[260,50;380,50])
add_line(sys,[165,190;205,190])
add_line(sys,[155,230;205,230])
add_line(sys,[75,395;135,395])
add_line(sys,[80,460;135,420])
add_line(sys,[445,235;520,235])
add_line(sys,[200,410;240,410])
add_line(sys,[340,50;340,5;460,5;460,40;485,40])
add_line(sys,[265,210;265,155;310,155])
add_line(sys,[480,235;480,395;285,395;285,360;310,360])

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
