<FDM_CONFIG NAME="F-104" VERSION="1.60">
  <!--                                                                                 - -

  File:      f104.xml
  Author:    Erik Hofman
  CVS Version: $Id: f104.xml,v 1.1 2002/11/23 16:06:30 tony Exp $

  Function: Models an F-104G "Starfighter"
  Status:   Early production

  Sources:
    Jan Roskam,  Airplane Flight Dynamics and Automatic Flight Controls Part I
    Verlinden, Lock-On No. 1,  F-104 G/J Starfighter.
    Dryden Technical Reports Server documents:
      H-636:  Flight-determained acceleration and climb performance of an
              F-104G airplane for use in an optimum-flight-path computer
              program.
      H-666:  Flight measurements of buffet characteristics of the F-104
              airplane for selected wing-flap deflections.
      H-723:  Modeling of airplane performance from flight-test results
              and validation with an F-104G airplane.
      H-1999: Dynamic ground effects flight test of an F-15 aircraft.

  NOTE: The aileron deflection is gear deflection dependent:
 	               max aileron deflection
      Gear extended:   +/- 20.0 degrees
      Gear retracted:  +/-  9.5 degrees
 -->

  <METRICS>

   AC_WINGAREA  196.1
   AC_WINGSPAN   21.94
   AC_CHORD       9.55
   AC_HTAILAREA  48.2
   AC_HTAILARM   16.3
   AC_VTAILAREA  43.7
   AC_LV         16.3
   AC_IXX      3600
   AC_IYY     59000
   AC_IZZ     60000
   AC_IXZ         0
   AC_EMPTYWT 16300
   AC_CGLOC     245.5   0.0   0.0
   AC_AERORP    273.0   0.0 -11.5
   AC_EYEPTLOC  467.3   0.0  29.1 
   AC_POINTMASS 230.0 467.3   0.0   9.4

  </METRICS>

  <UNDERCARRIAGE>

   AC_GEAR NOSE       404.0    0.0 -56.9  2500  800 0.5 0.8 0.02 STEERABLE NOSE 20 RETRACT
   AC_GEAR LEFT_MAIN  221.3  -99.0 -56.9  5400 1000 0.5 0.8 0.02 FIXED     LEFT  0 RETRACT
   AC_GEAR RIGHT_MAIN 221.3   99.0 -56.9  5400 1000 0.5 0.8 0.02 FIXED     RIGHT 0 RETRACT

   AC_GEAR VF         181.4    0.0 -42.9  5000 1000 0.2 0.2 0.2  FIXED     NONE  0 FIXED
   AC_GEAR VT          20.0    0.0  95.4 10000 1000 0.2 0.2 0.2  FIXED     NONE  0 FIXED
   AC_GEAR WT_LEFT    192.8 -128.9   0.0 10000 1000 0.2 0.2 0.2  FIXED     NONE  0 FIXED
   AC_GEAR WT_RIGHT   192.8  128.9   0.0 10000 1000 0.2 0.2 0.2  FIXED     NONE  0 FIXED
   AC_GEAR RADOME     610.4    0.0  -5.7 10000 1000 0.2 0.2 0.2  FIXED     NONE  0 FIXED

  </UNDERCARRIAGE>

  <PROPULSION>

   <AC_ENGINE FILE="low_bypass_turbofan">
    XLOC      0.0
    YLOC      0.0
    ZLOC      0.0
    PITCH     0.0
    YAW       0.0
    FEED      0
    FEED      1
   </AC_ENGINE>

   <AC_THRUSTER FILE="direct">
    XLOC      0.0
    YLOC      0.0
    ZLOC      0.0
    PITCH     0.0
    YAW       0.0
   </AC_THRUSTER>

   <AC_TANK TYPE="FUEL" NUMBER="1">
    XLOC      192.8
    YLOC      -71.8
    ZLOC        0.0
    RADIUS     78.8
    CAPACITY 3486.0
    CONTENTS 3486.0
   </AC_TANK>

   <AC_TANK TYPE="FUEL" NUMBER="2">
    XLOC      192.8
    YLOC       71.8
    ZLOC        0.0
    RADIUS     78.8
    CAPACITY 3486.0
    CONTENTS 3486.0
   </AC_TANK>
  </PROPULSION>

  <FLIGHT_CONTROL NAME="F-104 Direct">
   <COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER">
     INPUT      fcs/elevator-cmd-norm
     INPUT      fcs/pitch-trim-cmd-norm
     CLIPTO    -1 1
   </COMPONENT>
   <COMPONENT NAME="Elevator Control" TYPE="AEROSURFACE_SCALE">
     INPUT      fcs/pitch-trim-sum
     MIN      -17.0
     MAX        5.0
     OUTPUT     fcs/elevator-pos-rad
     GAIN        0.01745
    </COMPONENT>
    <COMPONENT NAME="Roll Trim Sum" TYPE="SUMMER">
     INPUT      fcs/aileron-cmd-norm
     INPUT      fcs/roll-trim-cmd-norm
     CLIPTO    -1 1
    </COMPONENT>
    <COMPONENT NAME="Left Aileron Control" TYPE="AEROSURFACE_SCALE">
     INPUT      fcs/roll-trim-sum
     MIN        -9.5
     MAX         9.5
     GAIN        0.01745
     OUTPUT     fcs/left-aileron-pos-rad
    </COMPONENT>
    <COMPONENT NAME="Right Aileron Control" TYPE="AEROSURFACE_SCALE">
     INPUT      fcs/roll-trim-sum
     MIN        -9.5
     MAX         9.5
     INVERT
     GAIN        0.01745
     OUTPUT     fcs/right-aileron-pos-rad
    </COMPONENT>
    <COMPONENT NAME="Yaw Trim Sum" TYPE="SUMMER">
     INPUT      fcs/rudder-cmd-norm
     INPUT      fcs/yaw-trim-cmd-norm
     CLIPTO    -1 1
    </COMPONENT>
    <COMPONENT NAME="Rudder Control" TYPE="AEROSURFACE_SCALE">
     INPUT      fcs/yaw-trim-sum
     MIN       -20
     MAX        20
     GAIN        0.01745
     OUTPUT     fcs/rudder-pos-rad
    </COMPONENT>
    <COMPONENT NAME="Flaps Control" TYPE="KINEMAT">
     INPUT        fcs/flap-cmd-norm
     DETENTS      3
                  0    0
                  7    1
                  13   1
     OUTPUT      fcs/flap-pos-deg
    </COMPONENT>
    <COMPONENT NAME="Gear Control" TYPE="KINEMAT">
     INPUT        gear/gear-cmd-norm
     DETENTS      2
                  0    0
                  1    5
     OUTPUT       gear/gear-pos-norm
    </COMPONENT>

  </FLIGHT_CONTROL>

  <AERODYNAMICS>

   AC_ALPHALIMITS -0.087 0.349

   <AXIS NAME="LIFT">

    <GROUP NAME="CLb">
      Basic_lift
      <FACTOR NAME="kCLge" TYPE="VECTOR">
         Change_in_lift_due_to_ground_effect
         13
         aero/h_b-mac-ft
         none
         0.0   1.229
         0.1   1.124
         0.15  1.116
         0.2   1.124
         0.3   1.105
         0.4   1.041
         0.5   1.034
         0.6   1.019
         0.7   1.008
         0.8   1.003
         0.9   1.001
         1.0   1.000
         1.1   1.000
      </FACTOR>
      <!--
           This data is obtained from CL(alpha) due to Mach for alpha=0.
        -->
      <COEFFICIENT NAME="CLo" TYPE="VECTOR">
        Lift_at_zero_alpha
        10
        velocities/mach-norm
        aero/qbar-psf | metrics/Sw-sqft
        0.40  0.010
        0.60  0.010
        0.80  0.010
        0.90  0.010
        1.00 -0.010
        1.20 -0.020
        1.40  0.040
        1.60  0.032
        1.80  0.020
        2.00  0.010
      </COEFFICIENT>
      <!--
           This data is generated by subtractong CLo from CL(alpha) due to Mach
           and correlating the result.
        -->
      <COEFFICIENT NAME="CLalpha" TYPE="VECTOR">
        Lift_due_to_alpha
        10
        velocities/mach-norm
        aero/qbar-psf | metrics/Sw-sqft | aero/alpha-rad | velocities/mach-norm
        0.40  7.1154
        0.60  4.8432
        0.80  4.2637
        0.90  4.3529
        1.00  4.2055
        1.20  3.1401
        1.40  2.2916
        1.60  1.7603
        1.80  1.3831
        2.00  1.1042
      </COEFFICIENT>
      <!--
           This table is only a close estimate based on CNA, alpha and Mach
           this means that the CA component is omitted at this time.

           This is not as bad as it seems because alpha was below 10 degrees
           which means that for Lift the sin(alpha) is close to zero.
        -->
      <COEFFICIENT NAME="CLDf" TYPE="TABLE">
        Delta_lift_due_to_flap_deflection
        7 3
        velocities/mach-norm
        fcs/flap-pos-deg
        aero/qbar-psf | metrics/Sw-sqft
                0.0	7.0	13.0
        0.65	0.000	0.089	0.400
        0.70	0.000	0.089	0.381
        0.75	0.000	0.099	0.341
        0.80	0.000	0.108	0.352
        0.85	0.000	0.128	0.346
        0.90	0.000	0.138	0.139
        0.95	0.000	0.128	0.290
      </COEFFICIENT>
    </GROUP>

    <COEFFICIENT NAME="CLDe" TYPE="VECTOR">
      Lift_due_to_Elevator_Deflection
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | fcs/elevator-pos-rad
      0.257  0.68
      1.800  0.52
    </COEFFICIENT>

    <COEFFICIENT NAME="CLq" TYPE="VECTOR">
      Lift_due_to_pitch_rate
      2
      aero/qbar-psf | metrics/Sw-sqft | velocities/q-aero-rad_sec | aero/ci2vel
      0.257  2.3
      1.800  1.9
    </COEFFICIENT>

    <COEFFICIENT NAME="CLadot" TYPE="VECTOR">
      Lift_due_to_alpha_rate
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | aero/alphadot-rad_sec | aero/ci2vel
      0.257  0.66
      1.800  0.82
    </COEFFICIENT>

   </AXIS>

   <AXIS NAME="DRAG">

    <!--
         Drag at zero lift from CD as a function of CL
      -->
    <COEFFICIENT NAME="CDo" TYPE="VECTOR">
      Drag_at_zero_lift
      17
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft
      0.000  0.0160
      0.800  0.0160
      0.850  0.0163
      0.880  0.0170
      0.900  0.0170
      0.925  0.0190
      0.950  0.0230
      0.975  0.0310
      1.000  0.0380
      1.050  0.0470
      1.100  0.0500
      1.150  0.0500
      1.200  0.0490
      1.400  0.0468
      1.600  0.0440
      1.800  0.0430
      2.000  0.0422
    </COEFFICIENT>

    <!--
         This table is created from CD as a function of CL minus CDo
      -->
    <COEFFICIENT NAME="CDalpha" TYPE="TABLE">
      Drag_due_to_alpha
      10 9
      aero/alpha-rad
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft
              0.0     0.8     0.9     1.0     1.2     1.4     1.6     1.8     2.0
      -0.070  0.0034  0.0049  0.0059  0.0093  0.0109  0.0040  0.0035  0.0042  0.0041
      -0.035  0.0010  0.0013  0.0015  0.0026  0.0032  0.0010  0.0011  0.0017  0.0018
       0.000  0.0002  0.0002  0.0001  0.0002  0.0006  0.0011  0.0010  0.0008  0.0004
       0.035  0.0024  0.0022  0.0031  0.0036  0.0046  0.0072  0.0059  0.0052  0.0037
       0.070  0.0093  0.0118  0.0165  0.0195  0.0187  0.0243  0.0198  0.0161  0.0133
       0.105  0.0240  0.0332  0.0465  0.0472  0.0425  0.0506  0.0430  0.0345  0.0176
       0.140  0.0465  0.0589  0.0822  0.0860  0.0788  0.0837  0.0722  0.0593  0.0479
       0.175  0.0703  0.0851  0.1361  0.1674  0.1298  0.1257  0.1052  0.0894  0.0741
       0.209  0.1074  0.1205  0.1988  0.3273  0.2195  0.1945  0.1487  0.1220  0.1013
       0.244  0.1679  0.1684  0.2999  0.6122  0.3791  0.3195  0.1529  0.1650  0.1331
    </COEFFICIENT>

    <COEFFICIENT NAME="CDDe" TYPE="VALUE">
      Drag_due_to_Elevator_Deflection
      aero/qbar-psf | metrics/Sw-sqft | fcs/mag-elevator-pos-rad
      0.0
    </COEFFICIENT>

   </AXIS>

   <AXIS NAME="SIDE">

    <COEFFICIENT NAME="CYb" TYPE="VECTOR">
      Side_force_due_to_beta
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | aero/beta-rad
      0.257 -1.180
      1.800 -1.045
    </COEFFICIENT>

    <COEFFICIENT NAME="CYDa" TYPE="VALUE">
      Side_force_due_to_aileron
      aero/qbar-psf | metrics/Sw-sqft | fcs/left-aileron-pos-rad
      0.0
    </COEFFICIENT>

    <COEFFICIENT NAME="CYDr" TYPE="VECTOR">
      Side_force_due_to_rudder
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | fcs/rudder-pos-rad
      0.257  0.329
      1.800  0.087
    </COEFFICIENT>

    <COEFFICIENT NAME="CYp" TYPE="VALUE">
      Side_force_due_to_roll_rate
      aero/qbar-psf | metrics/Sw-sqft | aero/bi2vel | velocities/p-aero-rad_sec
      0.0
    </COEFFICIENT>

    <COEFFICIENT NAME="CYr" TYPE="VALUE">
      Side_force_due_to_yaw_rate
      aero/qbar-psf | metrics/Sw-sqft | aero/bi2vel | velocities/r-aero-rad_sec
      0.0
    </COEFFICIENT>

   </AXIS>

   <AXIS NAME="ROLL">

    <COEFFICIENT NAME="Clb" TYPE="VECTOR">
      Roll_moment_due_to_beta
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/beta-rad
      0.257 -0.175
      1.800 -0.093
    </COEFFICIENT>

    <COEFFICIENT NAME="Clp" TYPE="VECTOR">
      Roll_moment_due_to_roll_rate_(roll_damping)
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/bi2vel | velocities/p-rad_sec
      0.257 -0.285
      1.800 -0.272
    </COEFFICIENT>

    <COEFFICIENT NAME="Clr" TYPE="VECTOR">
      Roll_moment_due_to_yaw_rate
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/bi2vel | velocities/r-rad_sec
      0.257  0.265
      1.800  0.154
    </COEFFICIENT>

    <COEFFICIENT NAME="ClDa" TYPE="VECTOR">
      Roll_moment_due_to_aileron
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | fcs/left-aileron-pos-rad
      0.257  0.0392
      1.800  0.0173
    </COEFFICIENT>

    <COEFFICIENT NAME="ClDr" TYPE="VECTOR">
      Roll_moment_due_to_rudder
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | fcs/rudder-pos-rad
      0.257  0.0448
      1.800  0.0079
    </COEFFICIENT>

   </AXIS>

   <AXIS NAME="PITCH">

    <COEFFICIENT NAME="Cmalpha" TYPE="VECTOR">
      Pitch_moment_due_to_alpha
      2
      aero/alpha-rad
      aero/qbar-psf | metrics/Sw-sqft | metrics/cbarw-ft | aero/alpha-rad
      0.257 -0.644
      1.800 -1.308
    </COEFFICIENT>

    <COEFFICIENT NAME="Cmo" TYPE="VECTOR">
      Pitching_moment_at_zero_alpha
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/cbarw-ft
      0.257  0.030
      1.800 -0.028
    </COEFFICIENT>

    <COEFFICIENT NAME="Cmq" TYPE="VECTOR">
      Pitch_moment_due_to_pitch_rate
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/cbarw-ft | aero/ci2vel | velocities/q-rad_sec
      0.257 -5.84
      1.800 -4.83
    </COEFFICIENT>

    <COEFFICIENT NAME="Cmadot" TYPE="VECTOR">
      Pitch_moment_due_to_alpha_rate
      2
      aero/qbar-psf | metrics/Sw-sqft | metrics/cbarw-ft | aero/ci2vel | aero/alphadot-rad_sec
      0.257 -1.64
      1.800 -2.05
    </COEFFICIENT>

    <COEFFICIENT NAME="CmDe" TYPE="VECTOR">
      Pitch_moment_due_to_elevator_deflection
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/cbarw-ft | fcs/elevator-pos-rad
      0.257 -1.60
      1.800 -1.41
    </COEFFICIENT>

   </AXIS>

   <AXIS NAME="YAW">

    <COEFFICIENT NAME="Cnb" TYPE="VECTOR">
      Yaw_moment_due_to_beta
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/beta-rad
      0.257  0.507
      1.800  0.242
    </COEFFICIENT>

    <COEFFICIENT NAME="Cnp" TYPE="VECTOR">
      Yaw_moment_due_to_roll_rate
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/bi2vel | velocities/p-rad_sec
      0.257 -0.144
      1.800 -0.093
    </COEFFICIENT>

    <COEFFICIENT NAME="Cnr" TYPE="VECTOR">
      Yaw_moment_due_to_yaw_rate
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | aero/bi2vel | velocities/r-rad_sec
      0.257 -0.753
      1.800 -0.649
    </COEFFICIENT>

    <COEFFICIENT NAME="CnDa" TYPE="VECTOR">
      Yaw_moment_due_to_aileron
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | fcs/left-aileron-pos-rad
      0.257  0.0042
      1.800  0.0025
    </COEFFICIENT>

    <COEFFICIENT NAME="CnDr" TYPE="VECTOR">
      Yaw_moment_due_to_rudder
      2
      velocities/mach-norm
      aero/qbar-psf | metrics/Sw-sqft | metrics/bw-ft | fcs/rudder-pos-rad
      0.257 -0.1645
      1.800 -0.0435
    </COEFFICIENT>

   </AXIS>

  </AERODYNAMICS>

  <OUTPUT NAME="JSBout.csv" TYPE="NONE">
   RATE_IN_HZ       10
   SIMULATION       OFF
   ATMOSPHERE       OFF
   MASSPROPS        ON
   AEROSURFACES     ON
   RATES            ON
   VELOCITIES       ON
   FORCES           ON
   MOMENTS          ON
   POSITION         ON
   COEFFICIENTS     ON
   GROUND_REACTIONS ON
   FCS              ON
   PROPULSION       ON
  </OUTPUT>

</FDM_CONFIG>

