#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Aircraft:
#
# ASW 20
#
# File
# asw20-v1-nl-uiuc
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Authors:
#
# Michael Selig
# http://www.uiuc.edu/~m-selig
#
# 2002/05/27   Initial workup
# 2002/11/03   Many more refinements
# 2002/11/08   Refinements before first release
#
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# References:
#
# - Johnson, R.H., "A Flight Test Evaluation of the ASW 20," 
#   Soaring Magazine, May 1978
#
# - aero data from various sources and methods
#
# - Additional models and updates 
#   http://www.aae.uiuc.edu/m-selig/apasim.html
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Notes:
#
# Performace specs:
# - Max L/D 41.7 @ approx 60 kts and 759 lbs w/ flaps at -6 deg
#   (flaps are not yet modeled)
#
# Todo items:
# [] obtain control deflection limits
# [] Flaps are not currently model.  Model flaps -9 deg to 5 deg.  
# [] include water ballast
# [] change moments of inertia w/ water ballast
# [] add in ground effect
# [] add in spoilers
# [] include air sounds
# [] include nonlinear Cn_beta for high side slip
# [] stick to elevator throw is likely nonlinear, unlike what I have now
# [] included Drag due to rudder deflection, aileron deflection, and side slip.  
#    When these are added, slipping on landing will be more realistic.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# various "init" FGFS settings
init use_V_rel_wind_2U    
init use_dyn_on_speed_curve1    
init dyn_on_speed  2    
init dyn_on_speed_zero 1    
init use_Alpha_dot_on_speed 7   # [ft/sec] speed below which Alpha_dot is set to zero    

# downwash terms
init downwashMode 100    
init downwashCoef 0.0114      # [1/ft] see asw20 notes 021026 p 1

# geometry
geometry bw   49.2       # [ft]   [x] see asw20 notes 021011
geometry cbar  2.297     # [ft]   [x] see asw20 notes 021011
geometry Sw  113         # [ft^2] [x] see asw20 notes 021011

# estimates for now
controlSurface de 17 28 # [deg]
controlSurface da 25 25 # [deg]
controlSurface dr 25 25 # [deg]
# Use the dr below when flying with enable-auto-coordination option
# and do not use rudder controls.
# With enable-auto-coordination and these settings the coupling
# dr:da is 4:3
#controlSurface dr 80 80 # [deg]

# mass and moment of inertia data
mass Weight 	728.736    # [slug-ft^2] [x] see asw20 notes 021011
mass I_xx   	950.478	   # [slug-ft^2] [x] see asw20 notes 021011
mass I_yy   	396.277	   # [slug-ft^2] [x] see asw20 notes 021011
mass I_zz   	1295.657   # [slug-ft^2] [x] see asw20 notes 021011
mass I_xz   	0          # [slug-ft^2] [x] see asw20 notes 021011

# Apparent mass terms
mass Mass_appMass_ratio  0.230         # [x] see asw20 notes 021011
mass I_xx_appMass_ratio  0.103         # [x] see asw20 notes 021011
mass I_yy_appMass_ratio  0.014         # [x] see asw20 notes 021011

# simulates tow plane line tension for aero tows
engine simpleSingle  110  # [lb]
# simulates spoilers on throttle
#engine simpleSingle  -100  # [lb]
# for getting up in a hurry (unrealistic of course)
#engine simpleSingle  780  # [lb]

######################
# Longitudinal terms #
######################

# Lift curve 
# wing and fuse CL for +-180 deg
CL CLfa CLfa-01.dat 0 1      #
CL CL_adot  0.347       # [/rad] [x] asw20 notes 021026 p 3 (see spreadsheet)
CL CL_q     4.337       # [/rad] [x] asw20 notes 021026 p 1 (see spreadsheet)
CL CL_de    0.195       # [/rad] [x] asw20 notes 021026 p 1 (see spreadsheet)


# parasite drag polar from +-180 deg for wing and tail
CD CDfa CDfa-01.dat 0 1      #
# base parasite drag coef
CD CDo 0.010                  # [] placeholder ........
CD CD_de  0.0002              # [] placeholder ........

# Induced drag
#CD CDK 0.0149                 # [-] [x] asw20 notes 021026 p 3 (see spreadsheet)
CD CDK 0.0200                  # [-] [x] asw20 notes 021026 p 3 (see spreadsheet)
                               #     [x] includes all CL^2 components (approx), including profile CL^2 drag

# wing/fuse moment curve from +-180 deg
Cm Cmfa   Cmfa-01.dat 0 1       # [-]     [x] Cmarc
Cm Cmfade Cmfade-01.dat  0 1 1  # [-]     [x] see spreadsheet
Cm Cm_q     -24.098             # [/rad]  [x] asw20 notes 021026 p 1 (see spreadsheet)
Cm Cm_adot -1.928               # [/rad]  [x] asw20 notes 021026 p 1 (see spreadsheet)

###########################
# Lateral Direction terms #
###########################

# rudder dr terms
CY CY_dr     0.158      # [/rad] [x] see asw20 notes 021026 p 4  (see spreadsheet)
Cl Cl_dr     0.0065     # [/rad] [x] see asw20 notes 021026 p 4  (see spreadsheet)
Cn Cn_dr    -0.041      # [/rad] [x] see asw20 notes 021026 p 4  (see spreadsheet)

# yaw rate r terms
CY CY_r      0.164      # [/rad] [x] see asw20 notes 021026 p 4  (see spreadsheet)
Cl Cl_r      0.1551     # [/rad] [x] Cmarc result, see asw20 notes 021030 p 3 (see spreadsheet)
                        #        [x] 0.0068 from vert fin, see asw20 notes 021026 p 4  (see spreadsheet)
Cn Cn_r     -0.05389    # [/rad] [x] Cmarc result, see asw20 notes 021030 p 2  (see spreadsheet)
                        #        [x] -.042 from vert fin,  see asw20 notes 021026 p 4  (see spreadsheet)

# beta terms
CY CY_beta  -0.316      # [/rad] [] Cmarc contribution
                        #        [x] -.316 vert fin contribution
Cl Cl_beta  -0.0693     # [/rad] [x] see asw20 notes 021030 p 4
Cn Cn_beta   0.0775     # [/rad] [x] -.0045 Cmarc contribution, see asw20 notes 021030 p 4
                        #        [x] 0.082 vert fin contribution

# aileron da terms
CY CY_da    -.0456      # [/rad] [] placeholder
Cl Cl_da    -0.214      # [/rad] [] placeholder, see asw20 notes 021026 p 5
Cn Cn_da    -0.017      # [/rad] [] placeholder

# roll rate p terms
#CY CY_p    -0.2        # [/rad]
Cl Cl_p     -0.6843     # [/rad] [x] see asw20 notes 021030 p 1
Cn Cn_p     -0.08591    # [/rad] [x] see asw20 notes 021030 p 1

# nose wheel (must be position 0 if present)
gear Dx_gear     0     3.2      # x-offset from CG [ft]
gear Dy_gear     0     0        # y-offset from CG [ft]
gear Dz_gear     0     2.2      # z-offset from CG [ft]
gear cgear       0   350        # damping [lbs/ft/sec]
gear kgear       0   700        # springiness [lbs/ft]
gear muGear      0     0.01     # rolling coefficient
gear strutLength 0     -.5      # gear travel [ft] (not yet used)

# right gear (must be position 1 if present)
gear Dx_gear     1     0.2      # [ft]
gear Dy_gear     1     0.05     # [ft]
gear Dz_gear     1     2.6      # [ft]
gear cgear       1   350        # [lbs/ft/sec]
gear kgear       1   700        # [lbs/ft]
gear muGear      1     0.01     # rolling coefficient
gear strutLength 1     -.5      # gear travel [ft] (not yet used)

# left gear (must be position 2 if present)
gear Dx_gear     2     0.2      # [ft]
gear Dy_gear     2    -0.05     # [ft]
gear Dz_gear     2     2.6      # [ft]
gear cgear       2   350        # [lbs/ft/sec]
gear kgear       2   700        # [lbs/ft]
gear muGear      2     0.01     # rolling coefficient
gear strutLength 2     -.5      # gear travel [ft] (not yet used)


# right wing
gear Dx_gear     3     0        # [ft]
gear Dy_gear     3    26        # [ft]
gear Dz_gear     3    -1.7      # [ft]
gear cgear       3   150        # [lbs/ft/sec]
gear kgear       3   300        # [lbs/ft]
gear muGear      3     0.01     # rolling coefficient
gear strutLength 3     -.5      # gear travel [ft] (not yet used)

# left wing
gear Dx_gear     4     0        # [ft]
gear Dy_gear     4   -26        # [ft]
gear Dz_gear     4    -1.7      # [ft]
gear cgear       4   150        # [lbs/ft/sec]
gear kgear       4   300        # [lbs/ft]
gear muGear      4     0.02     # rolling coefficient
gear strutLength 4     -.5      # gear travel [ft] (not yet used)

# tail
gear Dx_gear     5   -10        # [ft]
gear Dy_gear     5     0        # [ft]
gear Dz_gear     5    1.3       # [ft]
gear cgear       5   400        # [lbs/ft/sec]
gear kgear       5   800        # [lbs/ft]
gear muGear      5     0.02     # rolling coefficient
gear strutLength 5     -.5      # gear travel [ft] (not yet used)

# ahead
gear Dx_gear     6     5        # [ft]
gear Dy_gear     6     0        # [ft]
gear Dz_gear     6    2.6       # [ft]
gear cgear       6    25        # [lbs/ft/sec]
gear kgear       6    50        # [lbs/ft]
gear muGear      6     0.0      # rolling coefficient
gear strutLength 6     -.5      # gear travel [ft] (not yet used)

# way ahead
gear Dx_gear     7    10        # [ft]
gear Dy_gear     7     0        # [ft]
gear Dz_gear     7    0.3       # [ft]
gear cgear       7    25        # [lbs/ft/sec]
gear kgear       7    50        # [lbs/ft]
gear muGear      7     0.0      # rolling coefficient
gear strutLength 7     -.5      # gear travel [ft] (not yet used)

*

# to get the lift-to-drag ratio
#record V_rel_wind
#record V_ground_speed
#record V_down_rel_ground
#record V_down
#record debug2
*

#record CmfadeI
#record Alpha_deg
*


#record rudder_deg
#record aileron_deg
*

# used to get depp/dalpha
#record Alpha_deg
#record debug2
*

#record Simtime
#record Alpha_deg
#record CL
#record CD

#record Alpha_deg
#record CL
#record CD
#record Cm
# end of file '*'
*


