function [ret,x0,str,ts,xts]=f14(t,x,u,flag);
%F14	is the M-file description of the SIMULINK system named F14.
%	The block-diagram can be displayed by typing: F14.
%
%	SYS=F14(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 F14 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 F14 with a FLAG of zero:
%	[SIZES]=F14([],[],[],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.
%	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',[16,72,698,519])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-45')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '10000')
set_param(sys,'Min step size', '0.001')
set_param(sys,'Max step size', '1')
set_param(sys,'Relative error','1e-4')
set_param(sys,'Return vars',   '')
set_param(sys,'Load callback','f14dat');

add_block('built-in/Scope',[sys,'/',['Angle of ',13,'Attack']])
set_param([sys,'/',['Angle of ',13,'Attack']],...
		'Vgain','2.000000',...
		'Hgain','40.000000',...
		'Vmax','4.000000',...
		'Hmax','80.000000',...
		'Window',[365,565,636,707],...
		'position',[605,150,630,180])

add_block('built-in/Scope',[sys,'/',['Pilot G force',13,'Scope']])
set_param([sys,'/',['Pilot G force',13,'Scope']],...
		'Vgain','20.000000',...
		'Hgain','60.000000',...
		'Vmax','40.000000',...
		'Hmax','120.000000',...
		'Window',[533,477,772,611])
open_system([sys,'/',['Pilot G force',13,'Scope']])
set_param([sys,'/',['Pilot G force',13,'Scope']],...
		'position',[605,35,630,65])

add_block('built-in/Outport',[sys,'/','alpha (rad)'])
set_param([sys,'/','alpha (rad)'],...
		'position',[610,220,630,240])

add_block('built-in/Gain',[sys,'/','Gain5'])
set_param([sys,'/','Gain5'],...
		'hide name',0,...
		'Gain','1/Uo',...
		'position',[510,207,560,253])


%     Subsystem  ['Nz pilot',13,'calculation'].

new_system([sys,'/',['Nz pilot',13,'calculation']])
set_param([sys,'/',['Nz pilot',13,'calculation']],'Location',[0,56,459,330])

add_block('built-in/Gain',[sys,'/',['Nz pilot',13,'calculation/Gain1']])
set_param([sys,'/',['Nz pilot',13,'calculation/Gain1']],...
		'Gain','22.8',...
		'position',[190,102,240,148])

add_block('built-in/Gain',[sys,'/',['Nz pilot',13,'calculation/Gain2']])
set_param([sys,'/',['Nz pilot',13,'calculation/Gain2']],...
		'Gain','1/g',...
		'position',[320,102,370,148])

add_block('built-in/Inport',[sys,'/',['Nz pilot',13,'calculation/q']])
set_param([sys,'/',['Nz pilot',13,'calculation/q']],...
		'Port','2',...
		'position',[25,115,45,135])

add_block('built-in/Inport',[sys,'/',['Nz pilot',13,'calculation/w']])
set_param([sys,'/',['Nz pilot',13,'calculation/w']],...
		'position',[25,35,45,55])

add_block('built-in/Derivative',[sys,'/',['Nz pilot',13,'calculation/Derivative']])
set_param([sys,'/',['Nz pilot',13,'calculation/Derivative']],...
		'position',[125,32,165,58])

add_block('built-in/Sum',[sys,'/',['Nz pilot',13,'calculation/Sum1']])
set_param([sys,'/',['Nz pilot',13,'calculation/Sum1']],...
		'inputs','-++',...
		'position',[270,95,290,155])

add_block('built-in/Outport',[sys,'/',['Nz pilot',13,'calculation/Pilot',13,'g force (g)']])
set_param([sys,'/',['Nz pilot',13,'calculation/Pilot',13,'g force (g)']],...
		'position',[400,115,420,135])

add_block('built-in/Derivative',[sys,'/',['Nz pilot',13,'calculation/Derivative1']])
set_param([sys,'/',['Nz pilot',13,'calculation/Derivative1']],...
		'position',[125,112,165,138])

add_block('built-in/Product',[sys,'/',['Nz pilot',13,'calculation/Product']])
set_param([sys,'/',['Nz pilot',13,'calculation/Product']],...
		'position',[145,167,170,198])

add_block('built-in/Note',[sys,'/',['Nz pilot',13,'calculation/Nz pilot calculation']])
set_param([sys,'/',['Nz pilot',13,'calculation/Nz pilot calculation']],...
		'position',[284,195,289,200])

add_block('built-in/Constant',[sys,'/',['Nz pilot',13,'calculation/Constant']])
set_param([sys,'/',['Nz pilot',13,'calculation/Constant']],...
		'Value','Uo',...
		'position',[75,207,100,233])

add_block('built-in/Note',[sys,'/',['Nz pilot',13,'calculation/Nz = (dq//dt*22.8 + q*Uo - dw//dt)//g']])
set_param([sys,'/',['Nz pilot',13,'calculation/Nz = (dq//dt*22.8 + q*Uo - dw//dt)//g']],...
		'position',[283,220,288,225])
add_line([sys,'/',['Nz pilot',13,'calculation']],[50,125;85,125;85,175;140,175])
add_line([sys,'/',['Nz pilot',13,'calculation']],[85,125;120,125])
add_line([sys,'/',['Nz pilot',13,'calculation']],[105,220;115,220;115,190;140,190])
add_line([sys,'/',['Nz pilot',13,'calculation']],[375,125;395,125])
add_line([sys,'/',['Nz pilot',13,'calculation']],[295,125;315,125])
add_line([sys,'/',['Nz pilot',13,'calculation']],[170,45;240,45;240,105;265,105])
add_line([sys,'/',['Nz pilot',13,'calculation']],[50,45;120,45])
add_line([sys,'/',['Nz pilot',13,'calculation']],[170,125;185,125])
add_line([sys,'/',['Nz pilot',13,'calculation']],[245,125;265,125])
add_line([sys,'/',['Nz pilot',13,'calculation']],[175,185;240,185;240,145;265,145])


%     Finished composite block ['Nz pilot',13,'calculation'].

set_param([sys,'/',['Nz pilot',13,'calculation']],...
		'position',[515,20,550,75])


%     Subsystem  ['Aircraft',13,'Dynamics',13,'Model'].

new_system([sys,'/',['Aircraft',13,'Dynamics',13,'Model']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],'Location',[15,61,577,448])

add_block('built-in/Gain',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain6']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain6']],...
		'Gain','Md',...
		'position',[125,330,160,370])

add_block('built-in/Gain',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain5']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain5']],...
		'Gain','Zd',...
		'position',[120,15,155,55])

add_block('built-in/Transfer Fcn',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Transfer Fcn.1']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Transfer Fcn.1']],...
		'Denominator','[1,-Mq]',...
		'position',[360,250,420,300])

add_block('built-in/Sum',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Sum2']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Sum2']],...
		'inputs','+-+',...
		'position',[260,251,280,299])

add_block('built-in/Sum',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Sum1']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Sum1']],...
		'inputs','+-+',...
		'position',[270,76,290,124])

add_block('built-in/Outport',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Pitch Rate',13,'q (rad//sec)']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Pitch Rate',13,'q (rad//sec)']],...
		'Port','2',...
		'position',[510,266,530,284])

add_block('built-in/Outport',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Vertical Velocity',13,'w (ft//sec)']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Vertical Velocity',13,'w (ft//sec)']],...
		'position',[510,91,530,109])

add_block('built-in/Inport',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Vertical Gust',13,'wGust (ft//sec)']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Vertical Gust',13,'wGust (ft//sec)']],...
		'Port','2',...
		'position',[145,88,170,112])

add_block('built-in/Transfer Fcn',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Transfer Fcn.2']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Transfer Fcn.2']],...
		'Denominator','[1,-Zw]',...
		'position',[360,76,420,124])

add_block('built-in/Gain',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain4']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain4']],...
		'orientation',2,...
		'Gain','Mw',...
		'position',[300,203,340,247])

add_block('built-in/Gain',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain3']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Gain3']],...
		'orientation',2,...
		'Gain','Uo',...
		'position',[300,145,340,185])

add_block('built-in/Inport',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Elevator',13,'Deflection',13,'d (deg)']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Elevator',13,'Deflection',13,'d (deg)']],...
		'position',[25,23,50,47])

add_block('built-in/Inport',[sys,'/',['Aircraft',13,'Dynamics',13,'Model/Rotary Gust',13,'qGust (rad//sec)']])
set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model/Rotary Gust',13,'qGust (rad//sec)']],...
		'Port','3',...
		'position',[145,263,170,287])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[425,100;505,100])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[460,100;460,160;425,225;345,225])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[425,275;505,275])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[460,275;460,225;432,165;345,165])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[165,350;220,350;220,290;255,290])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[160,35;220,35;220,85;265,85])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[295,165;220,165;220,115;265,115])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[175,275;255,275])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[285,275;355,275])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[295,100;355,100])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[295,225;220,225;220,260;255,260])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[175,100;265,100])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[55,35;115,35])
add_line([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],[80,35;80,350;120,350])


%     Finished composite block ['Aircraft',13,'Dynamics',13,'Model'].

set_param([sys,'/',['Aircraft',13,'Dynamics',13,'Model']],...
		'position',[405,160,435,210])

add_block('built-in/Gain',[sys,'/','Gain'])
set_param([sys,'/','Gain'],...
		'hide name',0,...
		'Gain','Zw',...
		'position',[260,166,300,204])

add_block('built-in/Sum',[sys,'/','Sum'])
set_param([sys,'/','Sum'],...
		'hide name',0,...
		'position',[345,225,365,265])

add_block('built-in/Gain',[sys,'/','Gain2'])
set_param([sys,'/','Gain2'],...
		'hide name',0,...
		'Gain','Mw',...
		'position',[260,213,300,257])

add_block('built-in/Gain',[sys,'/','Gain1'])
set_param([sys,'/','Gain1'],...
		'hide name',0,...
		'Gain','Mq',...
		'position',[260,265,300,305])


%     Subsystem  ['Dryden Wind',13,'Gust Models'].

new_system([sys,'/',['Dryden Wind',13,'Gust Models']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models']],'Location',[79,145,531,383])

add_block('built-in/Transfer Fcn',[sys,'/',['Dryden Wind',13,'Gust Models/W-gust model']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/W-gust model']],...
		'Numerator','Swg/sqrt(a^3)*[sqrt(3)*a,1]',...
		'Denominator','[1 (2/a) 1/a^2]',...
		'position',[115,17,335,73])

add_block('built-in/Outport',[sys,'/',['Dryden Wind',13,'Gust Models/Qg']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Qg']],...
		'Port','2',...
		'position',[380,160,400,180])

add_block('built-in/Outport',[sys,'/',['Dryden Wind',13,'Gust Models/Wg']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Wg']],...
		'position',[380,35,400,55])

add_block('built-in/Transfer Fcn',[sys,'/',['Dryden Wind',13,'Gust Models/Q-gust model']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Q-gust model']],...
		'Numerator','pi/(4*b)*[1 0]',...
		'Denominator','[1 pi*Vto/(4*b)]',...
		'position',[155,145,295,195])


%     Subsystem  ['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise'].

new_system([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],'Location',[0,0,262,236])

add_block('built-in/Outport',[sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/out_1']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/out_1']],...
		'position',[235,70,255,90])

add_block('built-in/White Noise',[sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/White Noise']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/White Noise']],...
		'Seed','seed',...
		'position',[55,70,75,90])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/Zero Order Hold']])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise/Zero Order Hold']],...
		'Numerator','[sqrt(Cov)]',...
		'Denominator','[sqrt(Ts)]',...
		'Sample time','Ts',...
		'position',[140,61,205,99])
add_line([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],[210,80;230,80])
add_line([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],[80,80;135,80])
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'Mask Display','plot(t(:),r2(:))',...
		'Mask Type','Continuous White Noise.')
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'Mask Dialogue','White noise for continuous (s-domain) systems.\nBand-limited using zero-order-hold.|Noise Variance:|Sample Time:|Seed')
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'Mask Translate','Cov = @1; Ts = @2; seed = @3; r = rand(1,12); r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];')
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'Mask Help','Implemented using white noise into Zero Order Hold block. For faster simulation set sample time to highest value possible but in accordance with the fastest dynamics of system.')
set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'Mask Entries','1\/0.1\/23341\/')


%     Finished composite block ['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise'].

set_param([sys,'/',['Dryden Wind',13,'Gust Models/Band Limited',13,'White Noise']],...
		'position',[35,25,70,65])
add_line([sys,'/',['Dryden Wind',13,'Gust Models']],[75,45;110,45])
add_line([sys,'/',['Dryden Wind',13,'Gust Models']],[340,45;375,45])
add_line([sys,'/',['Dryden Wind',13,'Gust Models']],[300,170;375,170])
add_line([sys,'/',['Dryden Wind',13,'Gust Models']],[340,45;350,45;350,120;100,120;100,170;150,170])


%     Finished composite block ['Dryden Wind',13,'Gust Models'].

set_param([sys,'/',['Dryden Wind',13,'Gust Models']],...
		'position',[140,222,170,273])

add_block('built-in/Note',[sys,'/','wGust'])
set_param([sys,'/','wGust'],...
		'position',[196,215,201,220])

add_block('built-in/Note',[sys,'/','qGust'])
set_param([sys,'/','qGust'],...
		'position',[195,240,200,245])

add_block('built-in/Sum',[sys,'/','Sum1'])
set_param([sys,'/','Sum1'],...
		'hide name',0,...
		'position',[90,20,110,60])

add_block('built-in/Inport',[sys,'/','u'])
set_param([sys,'/','u'],...
		'position',[30,75,50,95])


%     Subsystem  'Controller'.

new_system([sys,'/','Controller'])
set_param([sys,'/','Controller'],'Location',[0,0,591,471])

add_block('built-in/Gain',[sys,'/','Controller/Gain'])
set_param([sys,'/','Controller/Gain'],...
		'Gain','Kf',...
		'position',[305,15,345,55])

add_block('built-in/Transfer Fcn',[sys,'/',['Controller/Stick',13,'Prefilter']])
set_param([sys,'/',['Controller/Stick',13,'Prefilter']],...
		'Denominator','[Ts,1]',...
		'position',[80,70,150,120])

add_block('built-in/Sum',[sys,'/','Controller/Sum'])
set_param([sys,'/','Controller/Sum'],...
		'inputs','2',...
		'position',[430,75,455,115])

add_block('built-in/Inport',[sys,'/',['Controller/Stick',13,'Input (in)']])
set_param([sys,'/',['Controller/Stick',13,'Input (in)']],...
		'position',[15,82,40,108])

add_block('built-in/Outport',[sys,'/',['Controller/Elevator',13,'Command (deg)']])
set_param([sys,'/',['Controller/Elevator',13,'Command (deg)']],...
		'position',[510,82,535,108])

add_block('built-in/Sum',[sys,'/','Controller/Sum2'])
set_param([sys,'/','Controller/Sum2'],...
		'inputs','+-',...
		'position',[210,85,235,125])

add_block('built-in/Transfer Fcn',[sys,'/',['Controller/Proportional',13,'plus integral',13,'compensator']])
set_param([sys,'/',['Controller/Proportional',13,'plus integral',13,'compensator']],...
		'Numerator','[Ki]',...
		'Denominator','[1,0]',...
		'position',[285,80,355,130])

add_block('built-in/Sum',[sys,'/','Controller/Sum1'])
set_param([sys,'/','Controller/Sum1'],...
		'orientation',3,...
		'inputs','2',...
		'position',[152,190,188,210])

add_block('built-in/Gain',[sys,'/','Controller/Gain2'])
set_param([sys,'/','Controller/Gain2'],...
		'orientation',2,...
		'Gain','Kq',...
		'position',[215,325,255,365])

add_block('built-in/Inport',[sys,'/','Controller/q (rad//sec)'])
set_param([sys,'/','Controller/q (rad//sec)'],...
		'orientation',2,...
		'Port','3',...
		'position',[425,332,450,358])

add_block('built-in/Transfer Fcn',[sys,'/',['Controller/Pitch Rate',13,'Lead Filter']])
set_param([sys,'/',['Controller/Pitch Rate',13,'Lead Filter']],...
		'orientation',2,...
		'Numerator','[1,W1]',...
		'Denominator','[1,W2]',...
		'position',[290,320,360,370])

add_block('built-in/Gain',[sys,'/','Controller/Gain3'])
set_param([sys,'/','Controller/Gain3'],...
		'orientation',2,...
		'Gain','Ka',...
		'position',[215,235,255,275])

add_block('built-in/Inport',[sys,'/','Controller/alpha (rad)'])
set_param([sys,'/','Controller/alpha (rad)'],...
		'orientation',2,...
		'Port','2',...
		'position',[425,242,450,268])

add_block('built-in/Note',[sys,'/','Controller/Controller'])
set_param([sys,'/','Controller/Controller'],...
		'position',[65,315,70,320])

add_block('built-in/Transfer Fcn',[sys,'/',['Controller/Alpha-sensor',13,'Low-pass Filter']])
set_param([sys,'/',['Controller/Alpha-sensor',13,'Low-pass Filter']],...
		'orientation',2,...
		'Denominator','[Tal,1]',...
		'position',[285,230,360,280])
add_line([sys,'/','Controller'],[240,105;280,105])
add_line([sys,'/','Controller'],[255,105;255,35;300,35])
add_line([sys,'/','Controller'],[210,345;160,345;160,215])
add_line([sys,'/','Controller'],[210,255;180,255;180,215])
add_line([sys,'/','Controller'],[350,35;385,35;385,85;425,85])
add_line([sys,'/','Controller'],[360,105;425,105])
add_line([sys,'/','Controller'],[155,95;205,95])
add_line([sys,'/','Controller'],[170,185;170,115;205,115])
add_line([sys,'/','Controller'],[45,95;75,95])
add_line([sys,'/','Controller'],[460,95;505,95])
add_line([sys,'/','Controller'],[285,345;260,345])
add_line([sys,'/','Controller'],[420,345;365,345])
add_line([sys,'/','Controller'],[280,255;260,255])
add_line([sys,'/','Controller'],[420,255;365,255])


%     Finished composite block 'Controller'.

set_param([sys,'/','Controller'],...
		'position',[145,85,175,135])

add_block('built-in/Signal Generator',[sys,'/','Pilot'])
set_param([sys,'/','Pilot'],...
		'Peak','1.000000',...
		'Peak Range','1.000000',...
		'Freq','0.500000',...
		'Freq Range','1.000000',...
		'Wave','Sqr',...
		'Units','Rads',...
		'position',[15,13,60,47])

add_block('built-in/Note',[sys,'/','q'])
set_param([sys,'/','q'],...
		'position',[455,205,460,210])

add_block('built-in/Note',[sys,'/','w'])
set_param([sys,'/','w'],...
		'position',[500,155,505,160])

add_block('built-in/Scope',[sys,'/','Stick Input'])
set_param([sys,'/','Stick Input'],...
		'Vgain','1.500000',...
		'Hgain','20.000000',...
		'Vmax','2.000000',...
		'Hmax','40.000000',...
		'Window',[100,100,380,320],...
		'position',[165,25,190,55])

add_block('built-in/Note',[sys,'/',['To start and stop the simulation, use the "Start//Stop"',13,'selection in the "Simulation" pull-down menu']])
set_param([sys,'/',['To start and stop the simulation, use the "Start//Stop"',13,'selection in the "Simulation" pull-down menu']],...
		'position',[189,405,194,410])

add_block('built-in/Note',[sys,'/',['F-14 Flight Control',13,'(Double click on the "?" for more info)']])
set_param([sys,'/',['F-14 Flight Control',13,'(Double click on the "?" for more info)']],...
		'position',[181,360,186,365])


%     Subsystem  'More Info'.

new_system([sys,'/','More Info'])
set_param([sys,'/','More Info'],'Location',[0,0,386,160])

add_block('built-in/Note',[sys,'/',['More Info/This demonstration shows a flight controller',13,'for the longitudinal motion of a Grumman Aerospace F-14.']])
set_param([sys,'/',['More Info/This demonstration shows a flight controller',13,'for the longitudinal motion of a Grumman Aerospace F-14.']],...
		'position',[180,20,185,25])

add_block('built-in/Note',[sys,'/',['More Info/Try experimenting with the values in the gain',13,'blocks and the signal generators.']])
set_param([sys,'/',['More Info/Try experimenting with the values in the gain',13,'blocks and the signal generators.']],...
		'position',[178,85,183,90])
set_param([sys,'/','More Info'],...
		'Mask Display','?')


%     Finished composite block 'More Info'.

set_param([sys,'/','More Info'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[310,365,337,390])


%     Subsystem  'More Info1'.

new_system([sys,'/','More Info1'])
set_param([sys,'/','More Info1'],'Location',[128,280,487,453])

add_block('built-in/Note',[sys,'/',['More Info1/This system models a double pendulum system where',13,'the rest state has both pendulums hanging vertically.']])
set_param([sys,'/',['More Info1/This system models a double pendulum system where',13,'the rest state has both pendulums hanging vertically.']],...
		'position',[168,20,173,25])

add_block('built-in/Note',[sys,'/',['More Info1/Associated with the demo is an animation function that',13,'will automatically open a figure window and display to it.']])
set_param([sys,'/',['More Info1/Associated with the demo is an animation function that',13,'will automatically open a figure window and display to it.']],...
		'position',[174,65,179,70])

add_block('built-in/Note',[sys,'/',['More Info1/Try experimenting with different initial conditions for',13,'alpha and gamma to see the unusal coupling effects.']])
set_param([sys,'/',['More Info1/Try experimenting with different initial conditions for',13,'alpha and gamma to see the unusal coupling effects.']],...
		'position',[175,115,180,120])
set_param([sys,'/','More Info1'],...
		'Mask Display','Double click\nhere for\nSIMULINK Help',...
		'Mask Dialogue','eval(''[cs,cb]=get_param;str=[''''simcad '''' cs];eval(str);'')')


%     Finished composite block 'More Info1'.

set_param([sys,'/','More Info1'],...
		'hide name',0,...
		'Drop Shadow',4,...
		'position',[390,370,492,421])

add_block('built-in/Transfer Fcn',[sys,'/',['Actuator',13,'Model']])
set_param([sys,'/',['Actuator',13,'Model']],...
		'Denominator','[ Ta, 1]',...
		'position',[215,87,275,133])

add_block('built-in/Outport',[sys,'/','Nz Pilot (g)'])
set_param([sys,'/','Nz Pilot (g)'],...
		'Port','2',...
		'position',[605,95,625,115])
add_line(sys,[115,40;125,40;125,95;140,95])
add_line(sys,[125,40;160,40])
add_line(sys,[440,175;490,175;490,230;505,230])
add_line(sys,[565,230;575,230;575,340;75,340;75,110;140,110])
add_line(sys,[575,230;575,165;600,165])
add_line(sys,[440,200;470,200;470,320;105,320;105,125;140,125])
add_line(sys,[370,245;380,245;380,200;400,200])
add_line(sys,[180,110;210,110])
add_line(sys,[305,285;320,285;320,255;340,255])
add_line(sys,[305,235;340,235])
add_line(sys,[175,260;230,260;230,285;255,285])
add_line(sys,[305,185;400,185])
add_line(sys,[280,110;310,110;310,170;400,170])
add_line(sys,[65,30;85,30])
add_line(sys,[55,85;70,85;70,50;85,50])
add_line(sys,[565,230;605,230])
add_line(sys,[175,235;255,235])
add_line(sys,[555,50;600,50])
add_line(sys,[575,50;575,105;600,105])
add_line(sys,[230,235;230,185;255,185])
add_line(sys,[450,175;450,35;510,35])
add_line(sys,[470,200;470,60;510,60])

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
end
