%
% Invoke this script to create the corresponding model
%

% Create the system (either model or library) and open it

new_system('F16_aero','Model');
load_system('simulink');
open_system('F16_aero');
set_param('F16_aero','Location', [70, 200, 670, 570]);
% pause(0.1); - disabled with R2006b/7.3; causes typeahead buffer overflow

% Execute the setup script to create the data structure
% in the model workspace for clarity

mws = get_param('F16_aero','modelworkspace');
if ~exist('mws')
  error('Unable to open model workspace - aborting');
end
mws.clear;
mws.evalin('F16_aero_data','F16_aero_setup');
clear mws;

% Create the subsystem with proper size to accomodate in/out ports

add_block('built-in/subsystem','F16_aero/F16_aero','Position',[210, 45, 390, 320]);

% Flesh out subsystem with internal blocks

    add_block('built-in/Constant','F16_aero/F16_aero/const_1','ShowName','off','Value','180.','Position',[30,24,90,54]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_1','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[140,20,170,59]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_23','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[230,20,260,59]);
    add_block('built-in/Math','F16_aero/F16_aero/power_22','Operator','pow','Position',[320,20,350,59]);
    add_block('built-in/Gain','F16_aero/F16_aero/minus_21','Gain','-1','Position',[400,24,430,54]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_19','IconShape','rectangular','Inputs','++','Position',[470,20,500,59]);
    add_block('built-in/Product','F16_aero/F16_aero/times_18','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[540,20,570,59]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_17','IconShape','rectangular','Inputs','++','Position',[610,20,640,59]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_54','IconShape','rectangular','Inputs','++','Position',[680,20,710,59]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyForceCoefficient_Z','Position',[750,32,780,46]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_2','ShowName','off','Value','3.14159265','Position',[30,79,90,109]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_4','ShowName','off','Value','25.0','Position',[30,133,90,163]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_4','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[140,129,170,168]);
    add_block('built-in/Product','F16_aero/F16_aero/times_25','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[230,129,260,168]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_6','ShowName','off','Value','20.0','Position',[30,200,90,230]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_6','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[140,196,170,235]);
    add_block('built-in/Product','F16_aero/F16_aero/times_13','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[230,196,260,235]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_10','IconShape','rectangular','Inputs','+++','Position',[320,188,350,242]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_49','IconShape','rectangular','Inputs','++','Position',[540,196,570,235]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyForceCoefficient_Y','Position',[610,208,640,222]);
    add_block('built-in/Product','F16_aero/F16_aero/times_42','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,270,350,309]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_41','IconShape','rectangular','Inputs','+++','Position',[540,262,570,316]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_56','IconShape','rectangular','Inputs','++','Position',[610,270,640,309]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyMomentCoefficient_Roll','Position',[680,282,710,296]);
    add_block('built-in/Product','F16_aero/F16_aero/times_45','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,344,350,383]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_44','IconShape','rectangular','Inputs','+++','Position',[540,336,570,390]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_63','IconShape','rectangular','Inputs','++','Position',[610,344,640,383]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyMomentCoefficient_Yaw','Position',[680,356,710,370]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_8','ShowName','off','Value','30.0','Position',[30,414,90,444]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_8','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[140,410,170,449]);
    add_block('built-in/Product','F16_aero/F16_aero/times_15','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[230,410,260,449]);
    add_block('built-in/Product','F16_aero/F16_aero/times_43','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,469,350,508]);
    add_block('built-in/Product','F16_aero/F16_aero/times_46','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,528,350,567]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_11','ShowName','off','Value','-0.02','Position',[30,591,90,621]);
    add_block('built-in/Product','F16_aero/F16_aero/times_11','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[140,587,170,626]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_13','ShowName','off','Value','0.021','Position',[30,646,90,676]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_15','ShowName','off','Value','0.086','Position',[30,696,90,726]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_19','ShowName','off','Value','1.','Position',[30,746,90,776]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_23','ShowName','off','Value','2','Position',[30,796,90,826]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_25','ShowName','off','Value','-0.19','Position',[30,846,90,876]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_27','ShowName','off','Value','2','Position',[30,900,90,930]);
    add_block('built-in/Product','F16_aero/F16_aero/times_27','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[230,896,260,935]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_29','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[320,896,350,935]);
    add_block('built-in/Product','F16_aero/F16_aero/times_50','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,896,500,935]);
    add_block('built-in/Product','F16_aero/F16_aero/times_57','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,955,500,994]);
    add_block('built-in/Product','F16_aero/F16_aero/times_64','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,1014,500,1053]);
    add_block('built-in/Product','F16_aero/F16_aero/divide_31','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[320,1073,350,1112]);
    add_block('built-in/Product','F16_aero/F16_aero/times_30','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[400,1073,430,1112]);
    add_block('built-in/Product','F16_aero/F16_aero/times_48','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,1073,500,1112]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_47','IconShape','rectangular','Inputs','++','Position',[540,1073,570,1112]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyForceCoefficient_X','Position',[610,1085,640,1099]);
    add_block('built-in/Product','F16_aero/F16_aero/times_55','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,1132,500,1171]);
    add_block('built-in/Product','F16_aero/F16_aero/times_62','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[470,1191,500,1230]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_61','IconShape','rectangular','Inputs','++','Position',[540,1191,570,1230]);
    add_block('built-in/Outport','F16_aero/F16_aero/aeroBodyMomentCoefficient_Pitch','Position',[610,1203,640,1217]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_35','ShowName','off','Value','0','Position',[30,1262,90,1292]);
    add_block('built-in/RelationalOperator','F16_aero/F16_aero/lt_35','Position',[140,1258,170,1297],'Operator','<');
    add_block('built-in/Switch','F16_aero/F16_aero/switch_33','Threshold','0.5','Position',[470,1250,500,1304]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_39','ShowName','off','Value','0','Position',[30,1336,90,1366]);
    add_block('built-in/RelationalOperator','F16_aero/F16_aero/lt_39','Position',[140,1332,170,1371],'Operator','<');
    add_block('built-in/Switch','F16_aero/F16_aero/switch_37','Threshold','0.5','Position',[470,1324,500,1378]);
    add_block('built-in/Inport','F16_aero/F16_aero/trueAirspeed','Position',[45,1414,75,1428]);
    add_block('built-in/Saturate','F16_aero/F16_aero/trueAirspeed_unlim_limiter','ShowName','off','LowerLimit','0.1','UpperLimit','Inf','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[140,1398,170,1428]);
    add_block('built-in/Inport','F16_aero/F16_aero/angleOfAttack','Position',[45,1475,75,1489]);
    add_block('built-in/PreLookup','F16_aero/F16_aero/ALPHA1','FontSize',10,'Position',[130,1448,180,1500],'BreakpointsData','F16_aero_data.ALPHA1_pts','BeginIndexSearchUsingPreviousIndexResult','on','ExtrapMethod','Linear','DiagnosticForOutOfRangeInput','None');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CX_fn','FontSize',10,'Position',[220,1449,270,1499],'NumberOfTableDimensions','2','Table','F16_aero_data.CX_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CZ0_fn','FontSize',10,'Position',[220,1520,270,1570],'NumberOfTableDimensions','1','Table','F16_aero_data.CZ0_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cm0_fn','FontSize',10,'Position',[220,1590,270,1640],'NumberOfTableDimensions','2','Table','F16_aero_data.Cm0_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cl0_fn','FontSize',10,'Position',[310,1660,360,1710],'NumberOfTableDimensions','2','Table','F16_aero_data.Cl0_table_def','ExtrapMethod','clip');
    add_block('built-in/Gain','F16_aero/F16_aero/minus_34','Gain','-1','Position',[400,1730,430,1760]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cn0_fn','FontSize',10,'Position',[310,1780,360,1830],'NumberOfTableDimensions','2','Table','F16_aero_data.Cn0_table_def','ExtrapMethod','clip');
    add_block('built-in/Gain','F16_aero/F16_aero/minus_38','Gain','-1','Position',[400,1850,430,1880]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CXq_fn','FontSize',10,'Position',[220,1900,270,1950],'NumberOfTableDimensions','1','Table','F16_aero_data.CXq_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CYr_fn','FontSize',10,'Position',[220,1970,270,2020],'NumberOfTableDimensions','1','Table','F16_aero_data.CYr_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_53','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,1976,350,2015]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_51','IconShape','rectangular','Inputs','++','Position',[400,1976,430,2015]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CYp_fn','FontSize',10,'Position',[220,2040,270,2090],'NumberOfTableDimensions','1','Table','F16_aero_data.CYp_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_52','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,2046,350,2085]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/CZq_fn','FontSize',10,'Position',[220,2110,270,2160],'NumberOfTableDimensions','1','Table','F16_aero_data.CZq_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Clr_fn','FontSize',10,'Position',[220,2180,270,2230],'NumberOfTableDimensions','1','Table','F16_aero_data.Clr_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_60','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,2186,350,2225]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_58','IconShape','rectangular','Inputs','++','Position',[400,2186,430,2225]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Clp_fn','FontSize',10,'Position',[220,2250,270,2300],'NumberOfTableDimensions','1','Table','F16_aero_data.Clp_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_59','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,2256,350,2295]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cmq_fn','FontSize',10,'Position',[220,2320,270,2370],'NumberOfTableDimensions','1','Table','F16_aero_data.Cmq_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cnr_fn','FontSize',10,'Position',[220,2390,270,2440],'NumberOfTableDimensions','1','Table','F16_aero_data.Cnr_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_67','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,2396,350,2435]);
    add_block('built-in/Sum','F16_aero/F16_aero/plus_65','IconShape','rectangular','Inputs','++','Position',[400,2396,430,2435]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/Cnp_fn','FontSize',10,'Position',[220,2460,270,2510],'NumberOfTableDimensions','1','Table','F16_aero_data.Cnp_table_def','ExtrapMethod','clip');
    add_block('built-in/Product','F16_aero/F16_aero/times_66','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[320,2466,350,2505]);
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/dlda_fn','FontSize',10,'Position',[220,2530,270,2580],'NumberOfTableDimensions','2','Table','F16_aero_data.dlda_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/dldr_fn','FontSize',10,'Position',[220,2600,270,2650],'NumberOfTableDimensions','2','Table','F16_aero_data.dldr_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/dnda_fn','FontSize',10,'Position',[220,2670,270,2720],'NumberOfTableDimensions','2','Table','F16_aero_data.dnda_table_def','ExtrapMethod','clip');
    add_block('built-in/Interpolation_n-D','F16_aero/F16_aero/dndr_fn','FontSize',10,'Position',[220,2740,270,2790],'NumberOfTableDimensions','2','Table','F16_aero_data.dndr_table_def','ExtrapMethod','clip');
    add_block('built-in/Inport','F16_aero/F16_aero/angleOfSideslip','Position',[45,2837,75,2851]);
    add_block('built-in/PreLookup','F16_aero/F16_aero/BETA2','FontSize',10,'Position',[130,2810,180,2862],'BreakpointsData','F16_aero_data.BETA2_pts','BeginIndexSearchUsingPreviousIndexResult','on','ExtrapMethod','Linear','DiagnosticForOutOfRangeInput','None');
    add_block('built-in/Abs','F16_aero/F16_aero/abs_32','Position',[140,2893,170,2923]);
    add_block('built-in/PreLookup','F16_aero/F16_aero/BETA1','FontSize',10,'Position',[220,2882,270,2934],'BreakpointsData','F16_aero_data.BETA1_pts','BeginIndexSearchUsingPreviousIndexResult','on','ExtrapMethod','Linear','DiagnosticForOutOfRangeInput','None');
    add_block('built-in/Inport','F16_aero/F16_aero/bodyAngularRate_Roll','Position',[45,2962,75,2976]);
    add_block('built-in/Inport','F16_aero/F16_aero/bodyAngularRate_Pitch','Position',[45,2996,75,3010]);
    add_block('built-in/Inport','F16_aero/F16_aero/bodyAngularRate_Yaw','Position',[45,3030,75,3044]);
    add_block('built-in/Inport','F16_aero/F16_aero/elevatorDeflection','Position',[45,3083,75,3097]);
    add_block('built-in/PreLookup','F16_aero/F16_aero/DE1','FontSize',10,'Position',[130,3056,180,3108],'BreakpointsData','F16_aero_data.DE1_pts','BeginIndexSearchUsingPreviousIndexResult','on','ExtrapMethod','Linear','DiagnosticForOutOfRangeInput','None');
    add_block('built-in/Inport','F16_aero/F16_aero/aileronDeflection','Position',[45,3136,75,3150]);
    add_block('built-in/Inport','F16_aero/F16_aero/rudderDeflection','Position',[45,3170,75,3184]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_99','ShowName','off','Value','11.32','Position',[30,3196,90,3226]);
    add_block('built-in/Outport','F16_aero/F16_aero/referenceWingChord','Position',[140,3246,170,3260]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_101','ShowName','off','Value','30.','Position',[30,3280,90,3310]);
    add_block('built-in/Outport','F16_aero/F16_aero/referenceWingSpan','Position',[140,3330,170,3344]);
    add_block('built-in/Constant','F16_aero/F16_aero/const_103','ShowName','off','Value','300.','Position',[30,3364,90,3394]);
    add_block('built-in/Outport','F16_aero/F16_aero/referenceWingArea','Position',[140,3372,170,3386]);
    h=add_line('F16_aero/F16_aero','trueAirspeed/1','trueAirspeed_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','trueAirspeed_unlim');
    h=add_line('F16_aero/F16_aero','angleOfAttack/1','ALPHA1/1','autorouting','on');
    set_param(h,'Name','angleOfAttack');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','BETA2/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','times_11/2','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','divide_23/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','abs_32/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','lt_35/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','angleOfSideslip/1','lt_39/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Roll/1','times_52/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Roll');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Roll/1','times_59/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Roll');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Roll/1','times_66/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Roll');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Pitch/1','divide_31/1','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Pitch');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Yaw/1','times_53/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Yaw');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Yaw/1','times_60/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Yaw');
    h=add_line('F16_aero/F16_aero','bodyAngularRate_Yaw/1','times_67/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Yaw');
    h=add_line('F16_aero/F16_aero','elevatorDeflection/1','DE1/1','autorouting','on');
    set_param(h,'Name','elevatorDeflection');
    h=add_line('F16_aero/F16_aero','elevatorDeflection/1','divide_4/1','autorouting','on');
    set_param(h,'Name','elevatorDeflection');
    h=add_line('F16_aero/F16_aero','aileronDeflection/1','divide_6/1','autorouting','on');
    set_param(h,'Name','aileronDeflection');
    h=add_line('F16_aero/F16_aero','rudderDeflection/1','divide_8/1','autorouting','on');
    set_param(h,'Name','rudderDeflection');
    h=add_line('F16_aero/F16_aero','divide_1/1','divide_23/2','autorouting','on');
    set_param(h,'Name','rtd');
    h=add_line('F16_aero/F16_aero','const_1/1','divide_1/1','autorouting','on');
    set_param(h,'Name','const_1');
    h=add_line('F16_aero/F16_aero','const_2/1','divide_1/2','autorouting','on');
    set_param(h,'Name','const_2');
    h=add_line('F16_aero/F16_aero','const_99/1','times_30/1','autorouting','on');
    set_param(h,'Name','referenceWingChord');
    h=add_line('F16_aero/F16_aero','const_99/1','referenceWingChord/1','autorouting','on');
    set_param(h,'Name','referenceWingChord');
    h=add_line('F16_aero/F16_aero','const_101/1','divide_29/1','autorouting','on');
    set_param(h,'Name','referenceWingSpan');
    h=add_line('F16_aero/F16_aero','const_101/1','referenceWingSpan/1','autorouting','on');
    set_param(h,'Name','referenceWingSpan');
    h=add_line('F16_aero/F16_aero','const_103/1','referenceWingArea/1','autorouting','on');
    set_param(h,'Name','referenceWingArea');
    h=add_line('F16_aero/F16_aero','divide_4/1','times_25/2','autorouting','on');
    set_param(h,'Name','del');
    h=add_line('F16_aero/F16_aero','const_4/1','divide_4/2','autorouting','on');
    set_param(h,'Name','const_4');
    h=add_line('F16_aero/F16_aero','divide_6/1','times_13/2','autorouting','on');
    set_param(h,'Name','dail');
    h=add_line('F16_aero/F16_aero','divide_6/1','times_42/2','autorouting','on');
    set_param(h,'Name','dail');
    h=add_line('F16_aero/F16_aero','divide_6/1','times_45/2','autorouting','on');
    set_param(h,'Name','dail');
    h=add_line('F16_aero/F16_aero','const_6/1','divide_6/2','autorouting','on');
    set_param(h,'Name','const_6');
    h=add_line('F16_aero/F16_aero','divide_8/1','times_15/2','autorouting','on');
    set_param(h,'Name','drdr');
    h=add_line('F16_aero/F16_aero','divide_8/1','times_43/2','autorouting','on');
    set_param(h,'Name','drdr');
    h=add_line('F16_aero/F16_aero','divide_8/1','times_46/2','autorouting','on');
    set_param(h,'Name','drdr');
    h=add_line('F16_aero/F16_aero','const_8/1','divide_8/2','autorouting','on');
    set_param(h,'Name','const_8');
    h=add_line('F16_aero/F16_aero','CX_fn/1','plus_47/1','autorouting','on');
    set_param(h,'Name','CX0');
    h=add_line('F16_aero/F16_aero','plus_10/1','plus_49/1','autorouting','on');
    set_param(h,'Name','CY0');
    h=add_line('F16_aero/F16_aero','times_11/1','plus_10/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_11/1','times_11/1','autorouting','on');
    set_param(h,'Name','const_11');
    h=add_line('F16_aero/F16_aero','times_13/1','plus_10/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_13/1','times_13/1','autorouting','on');
    set_param(h,'Name','const_13');
    h=add_line('F16_aero/F16_aero','times_15/1','plus_10/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_15/1','times_15/1','autorouting','on');
    set_param(h,'Name','const_15');
    h=add_line('F16_aero/F16_aero','CZ0_fn/1','times_18/1','autorouting','on');
    set_param(h,'Name','CZ0');
    h=add_line('F16_aero/F16_aero','plus_17/1','plus_54/1','autorouting','on');
    set_param(h,'Name','CZ1');
    h=add_line('F16_aero/F16_aero','times_18/1','plus_17/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_19/1','times_18/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_19/1','plus_19/1','autorouting','on');
    set_param(h,'Name','const_19');
    h=add_line('F16_aero/F16_aero','minus_21/1','plus_19/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','power_22/1','minus_21/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','divide_23/1','power_22/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_23/1','power_22/2','autorouting','on');
    set_param(h,'Name','const_23');
    h=add_line('F16_aero/F16_aero','times_25/1','plus_17/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_25/1','times_25/1','autorouting','on');
    set_param(h,'Name','const_25');
    h=add_line('F16_aero/F16_aero','times_27/1','divide_29/2','autorouting','on');
    set_param(h,'Name','tvt');
    h=add_line('F16_aero/F16_aero','times_27/1','divide_31/2','autorouting','on');
    set_param(h,'Name','tvt');
    h=add_line('F16_aero/F16_aero','const_27/1','times_27/1','autorouting','on');
    set_param(h,'Name','const_27');
    h=add_line('F16_aero/F16_aero','divide_29/1','times_50/1','autorouting','on');
    set_param(h,'Name','b2v');
    h=add_line('F16_aero/F16_aero','divide_29/1','times_57/1','autorouting','on');
    set_param(h,'Name','b2v');
    h=add_line('F16_aero/F16_aero','divide_29/1','times_64/1','autorouting','on');
    set_param(h,'Name','b2v');
    h=add_line('F16_aero/F16_aero','times_30/1','times_48/1','autorouting','on');
    set_param(h,'Name','cq2v');
    h=add_line('F16_aero/F16_aero','times_30/1','times_55/1','autorouting','on');
    set_param(h,'Name','cq2v');
    h=add_line('F16_aero/F16_aero','times_30/1','times_62/1','autorouting','on');
    set_param(h,'Name','cq2v');
    h=add_line('F16_aero/F16_aero','divide_31/1','times_30/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','abs_32/1','BETA1/1','autorouting','on');
    set_param(h,'Name','absbeta');
    h=add_line('F16_aero/F16_aero','Cl0_fn/1','switch_33/3','autorouting','on');
    set_param(h,'Name','absCl0');
    h=add_line('F16_aero/F16_aero','Cl0_fn/1','minus_34/1','autorouting','on');
    set_param(h,'Name','absCl0');
    h=add_line('F16_aero/F16_aero','Cn0_fn/1','switch_37/3','autorouting','on');
    set_param(h,'Name','absCn0');
    h=add_line('F16_aero/F16_aero','Cn0_fn/1','minus_38/1','autorouting','on');
    set_param(h,'Name','absCn0');
    h=add_line('F16_aero/F16_aero','switch_33/1','plus_41/1','autorouting','on');
    set_param(h,'Name','Cl0');
    h=add_line('F16_aero/F16_aero','minus_34/1','switch_33/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','lt_35/1','switch_33/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_35/1','lt_35/2','autorouting','on');
    set_param(h,'Name','const_35');
    h=add_line('F16_aero/F16_aero','Cm0_fn/1','plus_61/1','autorouting','on');
    set_param(h,'Name','Cm0');
    h=add_line('F16_aero/F16_aero','switch_37/1','plus_44/1','autorouting','on');
    set_param(h,'Name','Cn0');
    h=add_line('F16_aero/F16_aero','minus_38/1','switch_37/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','lt_39/1','switch_37/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','const_39/1','lt_39/2','autorouting','on');
    set_param(h,'Name','const_39');
    h=add_line('F16_aero/F16_aero','CXq_fn/1','times_48/2','autorouting','on');
    set_param(h,'Name','CXq');
    h=add_line('F16_aero/F16_aero','CYr_fn/1','times_53/1','autorouting','on');
    set_param(h,'Name','CYr');
    h=add_line('F16_aero/F16_aero','CYp_fn/1','times_52/1','autorouting','on');
    set_param(h,'Name','CYp');
    h=add_line('F16_aero/F16_aero','CZq_fn/1','times_55/2','autorouting','on');
    set_param(h,'Name','CZq');
    h=add_line('F16_aero/F16_aero','Clr_fn/1','times_60/1','autorouting','on');
    set_param(h,'Name','Clr');
    h=add_line('F16_aero/F16_aero','Clp_fn/1','times_59/1','autorouting','on');
    set_param(h,'Name','Clp');
    h=add_line('F16_aero/F16_aero','Cmq_fn/1','times_62/2','autorouting','on');
    set_param(h,'Name','Cmq');
    h=add_line('F16_aero/F16_aero','Cnr_fn/1','times_67/1','autorouting','on');
    set_param(h,'Name','Cnr');
    h=add_line('F16_aero/F16_aero','Cnp_fn/1','times_66/1','autorouting','on');
    set_param(h,'Name','Cnp');
    h=add_line('F16_aero/F16_aero','dlda_fn/1','times_42/1','autorouting','on');
    set_param(h,'Name','ClDA');
    h=add_line('F16_aero/F16_aero','dldr_fn/1','times_43/1','autorouting','on');
    set_param(h,'Name','ClDR');
    h=add_line('F16_aero/F16_aero','dnda_fn/1','times_45/1','autorouting','on');
    set_param(h,'Name','CnDA');
    h=add_line('F16_aero/F16_aero','dndr_fn/1','times_46/1','autorouting','on');
    set_param(h,'Name','CnDR');
    h=add_line('F16_aero/F16_aero','plus_41/1','plus_56/1','autorouting','on');
    set_param(h,'Name','Cl1');
    h=add_line('F16_aero/F16_aero','times_42/1','plus_41/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_43/1','plus_41/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_44/1','plus_63/1','autorouting','on');
    set_param(h,'Name','Cn');
    h=add_line('F16_aero/F16_aero','times_45/1','plus_44/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_46/1','plus_44/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_47/1','aeroBodyForceCoefficient_X/1','autorouting','on');
    set_param(h,'Name','aeroBodyForceCoefficient_X');
    h=add_line('F16_aero/F16_aero','times_48/1','plus_47/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_49/1','aeroBodyForceCoefficient_Y/1','autorouting','on');
    set_param(h,'Name','aeroBodyForceCoefficient_Y');
    h=add_line('F16_aero/F16_aero','times_50/1','plus_49/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_51/1','times_50/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_52/1','plus_51/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_53/1','plus_51/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_54/1','aeroBodyForceCoefficient_Z/1','autorouting','on');
    set_param(h,'Name','aeroBodyForceCoefficient_Z');
    h=add_line('F16_aero/F16_aero','times_55/1','plus_54/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_56/1','aeroBodyMomentCoefficient_Roll/1','autorouting','on');
    set_param(h,'Name','aeroBodyMomentCoefficient_Roll');
    h=add_line('F16_aero/F16_aero','times_57/1','plus_56/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_58/1','times_57/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_59/1','plus_58/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_60/1','plus_58/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_61/1','aeroBodyMomentCoefficient_Pitch/1','autorouting','on');
    set_param(h,'Name','aeroBodyMomentCoefficient_Pitch');
    h=add_line('F16_aero/F16_aero','times_62/1','plus_61/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_63/1','aeroBodyMomentCoefficient_Yaw/1','autorouting','on');
    set_param(h,'Name','aeroBodyMomentCoefficient_Yaw');
    h=add_line('F16_aero/F16_aero','times_64/1','plus_63/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','plus_65/1','times_64/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_66/1','plus_65/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','times_67/1','plus_65/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_aero/F16_aero','DE1/1','CX_fn/3','autorouting','on');
    set_param(h,'Name','elevatorDeflection_by_DE1_k');
    h=add_line('F16_aero/F16_aero','DE1/2','CX_fn/4','autorouting','on');
    set_param(h,'Name','elevatorDeflection_by_DE1_f');
    h=add_line('F16_aero/F16_aero','DE1/1','Cm0_fn/3','autorouting','on');
    set_param(h,'Name','elevatorDeflection_by_DE1_k');
    h=add_line('F16_aero/F16_aero','DE1/2','Cm0_fn/4','autorouting','on');
    set_param(h,'Name','elevatorDeflection_by_DE1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CX_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CX_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CZ0_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CZ0_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cm0_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cm0_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cl0_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cl0_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cn0_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cn0_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CXq_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CXq_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CYr_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CYr_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CYp_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CYp_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','CZq_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','CZq_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Clr_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Clr_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Clp_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Clp_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cmq_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cmq_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cnr_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cnr_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','Cnp_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','Cnp_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','dlda_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','dlda_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','dldr_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','dldr_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','dnda_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','dnda_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','ALPHA1/1','dndr_fn/1','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_k');
    h=add_line('F16_aero/F16_aero','ALPHA1/2','dndr_fn/2','autorouting','on');
    set_param(h,'Name','angleOfAttack_by_ALPHA1_f');
    h=add_line('F16_aero/F16_aero','BETA1/1','Cl0_fn/3','autorouting','on');
    set_param(h,'Name','absbeta_by_BETA1_k');
    h=add_line('F16_aero/F16_aero','BETA1/2','Cl0_fn/4','autorouting','on');
    set_param(h,'Name','absbeta_by_BETA1_f');
    h=add_line('F16_aero/F16_aero','BETA1/1','Cn0_fn/3','autorouting','on');
    set_param(h,'Name','absbeta_by_BETA1_k');
    h=add_line('F16_aero/F16_aero','BETA1/2','Cn0_fn/4','autorouting','on');
    set_param(h,'Name','absbeta_by_BETA1_f');
    h=add_line('F16_aero/F16_aero','BETA2/1','dlda_fn/3','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_k');
    h=add_line('F16_aero/F16_aero','BETA2/2','dlda_fn/4','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_f');
    h=add_line('F16_aero/F16_aero','BETA2/1','dldr_fn/3','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_k');
    h=add_line('F16_aero/F16_aero','BETA2/2','dldr_fn/4','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_f');
    h=add_line('F16_aero/F16_aero','BETA2/1','dnda_fn/3','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_k');
    h=add_line('F16_aero/F16_aero','BETA2/2','dnda_fn/4','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_f');
    h=add_line('F16_aero/F16_aero','BETA2/1','dndr_fn/3','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_k');
    h=add_line('F16_aero/F16_aero','BETA2/2','dndr_fn/4','autorouting','on');
    set_param(h,'Name','angleOfSideslip_by_BETA2_f');
    h=add_line('F16_aero/F16_aero','trueAirspeed_unlim_limiter/1','times_27/2','autorouting','on');
    set_param(h,'Name','trueAirspeed');
    
    % Correct output numbers
    
    set_param('F16_aero/F16_aero/referenceWingChord','Port','1');
    set_param('F16_aero/F16_aero/referenceWingSpan','Port','2');
    set_param('F16_aero/F16_aero/referenceWingArea','Port','3');
    set_param('F16_aero/F16_aero/aeroBodyForceCoefficient_X','Port','4');
    set_param('F16_aero/F16_aero/aeroBodyForceCoefficient_Y','Port','5');
    set_param('F16_aero/F16_aero/aeroBodyForceCoefficient_Z','Port','6');
    set_param('F16_aero/F16_aero/aeroBodyMomentCoefficient_Roll','Port','7');
    set_param('F16_aero/F16_aero/aeroBodyMomentCoefficient_Pitch','Port','8');
    set_param('F16_aero/F16_aero/aeroBodyMomentCoefficient_Yaw','Port','9');

% Top-level inports and lines

add_block('built-in/Inport','F16_aero/trueAirspeed','Position',[90, 58, 120, 72]);
add_line('F16_aero','trueAirspeed/1','F16_aero/1');
add_block('built-in/Inport','F16_aero/angleOfAttack','Position',[90, 88, 120, 102]);
add_line('F16_aero','angleOfAttack/1','F16_aero/2');
add_block('built-in/Inport','F16_aero/angleOfSideslip','Position',[90, 118, 120, 132]);
add_line('F16_aero','angleOfSideslip/1','F16_aero/3');
add_block('built-in/Inport','F16_aero/bodyAngularRate_Roll','Position',[90, 148, 120, 162]);
add_line('F16_aero','bodyAngularRate_Roll/1','F16_aero/4');
add_block('built-in/Inport','F16_aero/bodyAngularRate_Pitch','Position',[90, 178, 120, 192]);
add_line('F16_aero','bodyAngularRate_Pitch/1','F16_aero/5');
add_block('built-in/Inport','F16_aero/bodyAngularRate_Yaw','Position',[90, 208, 120, 222]);
add_line('F16_aero','bodyAngularRate_Yaw/1','F16_aero/6');
add_block('built-in/Inport','F16_aero/elevatorDeflection','Position',[90, 238, 120, 252]);
add_line('F16_aero','elevatorDeflection/1','F16_aero/7');
add_block('built-in/Inport','F16_aero/aileronDeflection','Position',[90, 268, 120, 282]);
add_line('F16_aero','aileronDeflection/1','F16_aero/8');
add_block('built-in/Inport','F16_aero/rudderDeflection','Position',[90, 298, 120, 312]);
add_line('F16_aero','rudderDeflection/1','F16_aero/9');

% Top-level outports and lines

add_block('built-in/Outport','F16_aero/referenceWingChord','Position',[480, 58, 510, 72]);
add_line('F16_aero','F16_aero/1','referenceWingChord/1');
add_block('built-in/Outport','F16_aero/referenceWingSpan','Position',[480, 88, 510, 102]);
add_line('F16_aero','F16_aero/2','referenceWingSpan/1');
add_block('built-in/Outport','F16_aero/referenceWingArea','Position',[480, 118, 510, 132]);
add_line('F16_aero','F16_aero/3','referenceWingArea/1');
add_block('built-in/Outport','F16_aero/aeroBodyForceCoefficient_X','Position',[480, 148, 510, 162]);
add_line('F16_aero','F16_aero/4','aeroBodyForceCoefficient_X/1');
add_block('built-in/Outport','F16_aero/aeroBodyForceCoefficient_Y','Position',[480, 178, 510, 192]);
add_line('F16_aero','F16_aero/5','aeroBodyForceCoefficient_Y/1');
add_block('built-in/Outport','F16_aero/aeroBodyForceCoefficient_Z','Position',[480, 208, 510, 222]);
add_line('F16_aero','F16_aero/6','aeroBodyForceCoefficient_Z/1');
add_block('built-in/Outport','F16_aero/aeroBodyMomentCoefficient_Roll','Position',[480, 238, 510, 252]);
add_line('F16_aero','F16_aero/7','aeroBodyMomentCoefficient_Roll/1');
add_block('built-in/Outport','F16_aero/aeroBodyMomentCoefficient_Pitch','Position',[480, 268, 510, 282]);
add_line('F16_aero','F16_aero/8','aeroBodyMomentCoefficient_Pitch/1');
add_block('built-in/Outport','F16_aero/aeroBodyMomentCoefficient_Yaw','Position',[480, 298, 510, 312]);
add_line('F16_aero','F16_aero/9','aeroBodyMomentCoefficient_Yaw/1');

% Add annotation

add_block('built-in/Note','F16_aero/Auto-generated by DAVE2SL version 0.9.6 (2013-07-29)','Position',[300, 22]);

clear h;  % remove handle used for naming lines

% Pause so window can be drawn prior to verification

% pause(0.5); - disabled with R2006b/7.3; causes typeahead buffer overflow
if exist('F16_aero_verify') == 2
  if F16_aero_verify
    save_system('F16_aero','F16_aero');
    fprintf('\n"F16_aero" model verified and saved.\n')
  else
    fprintf('\n"F16_aero" model NOT VERIFIED; model has NOT been saved.\n')
  end
else
  save_system('F16_aero','F16_aero');
  fprintf('\n"F16_aero" model saved.\n')
end

% F16_aero model-building script was auto-generated 
% by DAVE2SL version 0.9.6 (2013-07-29)
% on Tue Oct 22 14:36:32 2013.
