# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
# Unclassified blue_naval_sam
# Sources:
# http://en.wikipedia.org/wiki/RIM-161_Standard_Missile_3
# http://www.raytheon.com/capabilities/products/stellent/groups/public/documents/content/cms01_055769.pdf
# http://www.globalsecurity.org/space/systems/sm3.htm
# http://www.astronautix.com/lvs/staarder.htm
# http://www.designation-systems.net/dusrm/m-161.html
# http://www.designation-systems.net/dusrm/m-156.html (sm2 body information)
# http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA457566&Location=U2&doc=GetTRDoc.pdf
# http://web.mit.edu/stgs/pdfs/Forden_Preliminary_analysis_USA_193_Shoot_down.pdf
# http://www.janes.com (requires subscription)
# http://www.deagel.com/Anti-Ballistic-Missiles/Standard-SM-3-Block-IB_a001148012.aspx


# Weapon Definition starts here.
# script_debug_writes on

# Signature data is unknown...
infrared_signature BLUE_NAVAL_SAM_INFRARED_SIGNATURE
   constant 1 watts/steradian
end_infrared_signature

optical_signature  BLUE_NAVAL_SAM_OPTICAL_SIGNATURE
   constant 1 m^2
end_optical_signature

radar_signature    BLUE_NAVAL_SAM_RADAR_SIGNATURE
   constant 1 m^2
end_radar_signature

# Weapon effects
weapon_effects BLUE_NAVAL_SAM_LETHALITY WSF_GRADUATED_LETHALITY
   radius_and_pk 3 km 1.0
end_weapon_effects

########### Aero definitions ##################################################
aero                   BLUE_NAVAL_SAM_STAGE_1_AERO WSF_AERO
   reference_area            2.35 ft^2
   # Values estimated from Hoerner's Drag book
   cd_zero_subsonic          0.10
   cd_zero_supersonic        0.25
   mach_begin_cd_rise        0.95
   mach_end_cd_rise          1.30
   mach_max_supersonic       10.00
end_aero
aero                   BLUE_NAVAL_SAM_STAGE_2_AERO WSF_AERO
   reference_area            1.02 ft^2
   # Values estimated from Hoerner's Drag book
   cd_zero_subsonic          0.10
   cd_zero_supersonic        0.25
   mach_begin_cd_rise        0.95
   mach_end_cd_rise          1.30
   mach_max_supersonic       10.00
end_aero
aero                   BLUE_NAVAL_SAM_STAGE_3_AERO WSF_AERO
   reference_area            1.02 ft^2
   # Values estimated from Hoerner's Drag book
   cd_zero_subsonic          0.10
   cd_zero_supersonic        0.25
   mach_begin_cd_rise        0.95
   mach_end_cd_rise          1.30
   mach_max_supersonic       10.00
end_aero
aero                   BLUE_NAVAL_SAM_STAGE_4_AERO WSF_AERO #warhead & sensor
   reference_area            1.02 ft^2
   # Values estimated from Hoerner's Drag book
   cd_zero_subsonic          0.10
   cd_zero_supersonic        0.25
   mach_begin_cd_rise        0.95
   mach_end_cd_rise          1.30
   mach_max_supersonic       10.00
end_aero

########### Mover definitions ##################################################
mover BLUE_NAVAL_SAM_MOVER WSF_GUIDED_MOVER
   #show_status
   integration_timestep      0.001 secs
   update_interval           0.01 secs
# divert thrust taken from unclass blue_lr_sam and doubled
   divert_thrust                        8000 Nt
   divert_fuel_mass                     10 kg
   divert_fuel_flow_rate                1.0 kg/s
   divert_altitude_limits               80 km 1000 km
   # stage info came from janes.com,
   # designation-systems.com
   # astronautix.com
   stage 1 # MK-72 Solid Rocket Booster
       aero                   BLUE_NAVAL_SAM_STAGE_1_AERO
       empty_mass             535 lbs
       total_mass             1540 lbs
       specific_impulse       260 sec
       thrust_duration        6 sec
   end_stage
   stage 2 # MK-104 Solid Rocket Booster
       aero                   BLUE_NAVAL_SAM_STAGE_2_AERO
       pre_ignition_coast_time 1 sec
       total_mass              1100 lbs
       empty_mass              282 lbs
       #fuel_mass              418 lbs
       specific_impulse       260 sec
       thrust_duration        25 sec
       pre_separation_coast_time  30 sec
   end_stage
   stage 3 # MK-136 Solid Rocket
       aero                  BLUE_NAVAL_SAM_STAGE_3_AERO
       total_mass            220 lbs
       empty_mass            187 lbs
      # fuel_mass             125 lbs
       specific_impulse      260 sec
       thrust_duration        15 sec
       pre_separation_coast_time  1 sec
   end_stage
   stage 4 # warhead and seeker (aka kill vehicle )
       aero                  BLUE_NAVAL_SAM_STAGE_4_AERO
       total_mass           70 lbs
       fuel_mass              0 lbs
   end_stage
end_mover

############### BLUE_NAVAL_SAM platform ##########################################
platform_type BLUE_NAVAL_SAM WSF_PLATFORM
   icon Scud_Missile
   infrared_signature BLUE_NAVAL_SAM_INFRARED_SIGNATURE
   optical_signature  BLUE_NAVAL_SAM_OPTICAL_SIGNATURE
   radar_signature    BLUE_NAVAL_SAM_RADAR_SIGNATURE
   weapon_effects     BLUE_NAVAL_SAM_LETHALITY

   mover BLUE_NAVAL_SAM_MOVER
   end_mover

   processor BLUE_NAVAL_SAM_GUIDANCE WSF_GUIDANCE_COMPUTER
      guide_to_truth          true
      phase LAUNCH
         commanded_flight_path_angle     from_launch_computer
         proportional_navigation_gain    0.0                 # Don't guide to target
         velocity_pursuit_gain           0.0                 # Don't guide to target

         next_phase TERMINAL if target_slant_range < 200 km # 150 km
         next_phase MIDCOURSE if on_commanded_flight_path_angle
      end_phase

      phase MIDCOURSE
         guidance_delay       2000 secs # stay on commanded loft angle
         next_phase TERMINAL when target_slant_range < 100 km #250 km
      end_phase

      phase TERMINAL
         proportional_navigation_gain     10.0
         proportional_navigation_method   augmented

         # Disable velocity pursuit. The angle which controls the switch between
         # velocity pursuit and pronav are too sensitive at short ranges.
         velocity_pursuit_gain            0.0

         # Disable g-bias. The target is also falling, so we don't want to fight
         # against it! (this is assuming terminal intercept, not boost)
         g_bias                           0.0
      end_phase
   end_processor

   processor fuse WSF_AIR_TARGET_FUSE
      use_current_target
      gross_proximity_range   7 km
      hit_proximity_range     5 km
      update_interval         0.50 sec
      fine_update_interval    0.01 sec
      time_of_flight_to_arm   60 sec
   end_processor

   processor seeker WSF_PERFECT_TRACKER
      update_interval 0.25 sec
   end_processor

end_platform_type

launch_computer BLUE_NAVAL_SAM_LAUNCH_COMPUTER WSF_BALLISTIC_MISSILE_LAUNCH_COMPUTER
   maximum_time_of_flight             1000 sec
   surface_to_air_table               weapons/sam/blue_naval_sam_launch_data.txt
   integration_time_step              0.05 sec

   # Disallow intercepts at unreasonable angles
   maximum_intercept_angle   60 deg
end_launch_computer

########EXPLICIT WEAPON#############################

weapon BLUE_NAVAL_SAM WSF_EXPLICIT_WEAPON
   launched_platform_type BLUE_NAVAL_SAM

   launch_computer BLUE_NAVAL_SAM_LAUNCH_COMPUTER
   end_launch_computer

   tilt  89.9 degrees

   # This causes a call to the launch computer to compute the predicted intercept.
   # The launcher will then be cued to the proper angles (Subject to the slewing
   # limits defined below). This is a bit of a hack until the guidance computer
   # is changed...

   cue_to_predicted_intercept true
   slew_mode azimuth
   azimuth_slew_limits -180 deg 180 deg

   quantity               1

   require_loft_angle
end_weapon


