<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Aichi M6A Seiran - BARANGER Emmanuel (  /2014)
               Update : BARANGER Emmanuel (04/2021)
               Update : BARANGER Emmanuel (11/2023)

     sources            : http://en.wikipedia.org/wiki/Aichi_M6A

     wingspan           :  12.26 m  (   40 ft 2 3/4 in )
     length             :  11.64 m  (   38 ft 2 1/4 in )
     height             :   4.58 m  (   15 ft 3/8 in   )
     empty weight       :   3301 kg ( 7277 lb          )
     Max takeoff weight :   4445 kg ( 9800 lb          )
     engine             : 1 Aichi Atsuta Type 31 liquid-cooled, inverted V12 cylinder ( 1400 hp )
     max speed          :  474 km/h (  256 kt          ) at 5200 m ( 17060 ft )
     cruise speed       :  296 km/h (  160 kt          ) at 3000 m (  9850 ft )
-->
<airplane mass="7277" version="YASIM_VERSION_CURRENT" mtow-lbs="9800">

  <approach speed="50" aoa="4" fuel="0.3">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1.0"/>
    <control-setting axis="/controls/flight/flaps"                      value="1.0"/>
  </approach>

  <cruise speed="160" alt="16000" >
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/flight/flaps"                      value="0"/>
  </cruise>

  <cockpit x="0.95675" y="0" z="1.13835" />

  <!-- Bol -->
  <fuselage ax=" 4.902" ay=" 0.000" az=" 0.226" bx=" 4.754" by=" 0.000" bz=" 0.226" width="0.373" taper="0.20" midpoint="1"/>
  <fuselage ax=" 4.754" ay=" 0.000" az=" 0.226" bx=" 4.546" by=" 0.000" bz=" 0.226" width="0.536" taper="0.70" midpoint="1"/>
  <fuselage ax=" 4.546" ay=" 0.000" az=" 0.226" bx=" 4.338" by=" 0.000" bz=" 0.226" width="0.619" taper="0.87" midpoint="1"/>

  <!-- Fuselage down -->
  <fuselage ax=" 4.338" ay=" 0.000" az=" 0.226" bx=" 3.898" by=" 0.000" bz=" 0.226" width="0.846" taper="0.74" midpoint="1"/>
  <fuselage ax=" 3.898" ay=" 0.000" az=" 0.226" bx=" 2.346" by=" 0.000" bz=" 0.226" width="1.037" taper="0.82" midpoint="1"/>
  <fuselage ax=" 2.346" ay=" 0.000" az=" 0.226" bx="-0.643" by=" 0.000" bz=" 0.226" width="1.037" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.643" ay=" 0.000" az=" 0.226" bx="-5.126" by=" 0.000" bz=" 0.226" width="1.037" taper="0.20" midpoint="0"/>
  <!-- Fuselage up -->
  <fuselage ax=" 4.325" ay=" 0.000" az=" 0.229" bx=" 3.888" by=" 0.000" bz=" 0.278" width="0.846" taper="0.74" midpoint="1"/>
  <fuselage ax=" 3.888" ay=" 0.000" az=" 0.278" bx=" 2.346" by=" 0.000" bz=" 0.449" width="1.037" taper="0.82" midpoint="1"/>
  <fuselage ax=" 2.346" ay=" 0.000" az=" 0.449" bx="-0.643" by=" 0.000" bz=" 0.449" width="1.037" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.643" ay=" 0.000" az=" 0.449" bx="-5.126" by=" 0.000" bz=" 0.449" width="1.037" taper="0.20" midpoint="0"/>
  <!-- Air -->
  <fuselage ax=" 2.941" ay=" 0.000" az="-0.024" bx=" 2.346" by=" 0.000" bz="-0.024" width="1.037" taper="0.82" midpoint="1"/>
  <fuselage ax=" 2.346" ay=" 0.000" az="-0.024" bx="-0.643" by=" 0.000" bz=" 0.106" width="1.037" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.643" ay=" 0.000" az=" 0.106" bx="-5.126" by=" 0.000" bz=" 0.176" width="1.037" taper="0.20" midpoint="0"/>
  <!-- Cockpit -->
  <fuselage ax=" 1.970" ay=" 0.000" az=" 0.896" bx=" 1.421" by=" 0.000" bz=" 0.896" width="0.846" taper="0.10" midpoint="1"/>
  <fuselage ax=" 1.421" ay=" 0.000" az=" 0.896" bx=" 0.330" by=" 0.000" bz=" 0.896" width="0.846" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.330" ay=" 0.000" az=" 0.896" bx="-0.635" by=" 0.000" bz=" 0.896" width="0.846" taper="0.70" midpoint="0"/>
  <fuselage ax="-0.635" ay=" 0.000" az=" 0.896" bx="-1.681" by=" 0.000" bz=" 0.896" width="0.592" taper="0.05" midpoint="0"/>

  <!-- Left float -->
  <fuselage ax=" 5.819" ay=" 1.686" az="-1.984" bx=" 4.405" by=" 1.686" bz="-1.984" width="1.050" taper="0.30" midpoint="1"/>
  <fuselage ax=" 4.405" ay=" 1.686" az="-1.984" bx=" 1.255" by=" 1.686" bz="-1.984" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.255" ay=" 1.686" az="-1.984" bx="-0.983" by=" 1.686" bz="-1.653" width="1.050" taper="0.60" midpoint="0"/>
  <fuselage ax="-0.983" ay=" 1.686" az="-1.653" bx="-2.198" by=" 1.686" bz="-1.463" width="0.630" taper="0.30" midpoint="0"/>

  <!-- Right float -->
  <fuselage ax=" 5.819" ay="-1.686" az="-1.984" bx=" 4.405" by="-1.686" bz="-1.984" width="1.050" taper="0.30" midpoint="1"/>
  <fuselage ax=" 4.405" ay="-1.686" az="-1.984" bx=" 1.255" by="-1.686" bz="-1.984" width="1.050" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.255" ay="-1.686" az="-1.984" bx="-0.983" by="-1.686" bz="-1.653" width="1.050" taper="0.60" midpoint="0"/>
  <fuselage ax="-0.983" ay="-1.686" az="-1.653" bx="-2.198" by="-1.686" bz="-1.463" width="0.630" taper="0.30" midpoint="0"/>

  <wing x="0.86652" y="0" z="-0.12076"
        chord="2.711"
        length="6.136"
        taper="0.6"
        dihedral="4.5"
        sweep="-2.5"
        camber="0.01">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.12" end="0.51" lift="1.5" drag="1.6"/>
        <flap1 start="0.51" end="0.92" lift="1.3" drag="1.8"/>

        <control-input  control="FLAP0" axis="/controls/flight/flaps"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron"      split="true"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron-trim" split="true"/>

        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
        <control-output control="FLAP1" prop="/surface-positions/left-aileron-pos-norm"  side="left"/>
        <control-output control="FLAP1" prop="/surface-positions/right-aileron-pos-norm" side="right"/>
        <control-output control="FLAP1" prop="/surface-positions/aileron-pos-norm"/>

        <control-speed transition-time="8" control="FLAP0" />
  </wing>

  <hstab x="-4.4" y="0" z="0.70"
         chord="1.565"
         length="2.539"
         taper="0.4"
         sweep="1">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" drag="1.6"/>

         <control-input  control="FLAP0" axis="/controls/flight/elevator"/>
         <control-input  control="FLAP0" axis="/controls/flight/elevator-trim"/>

         <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
  </hstab>

  <vstab x="-4.62909" y="0" z="0.05361"
         chord="2.404"
         length="2.445"
         taper="0.36"
         sweep="12">
         <stall   aoa="16" width="1"    peak="1.5"/>
         <flap0 start="0"    end="0.82" lift="1.3" drag="1.1"/>

         <control-input  control="FLAP0" axis="/controls/flight/rudder"      invert="true"/>
         <control-input  control="FLAP0" axis="/controls/flight/rudder-trim" invert="true"/>

         <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm" min="1" max="-1"/>
  </vstab>

  <!-- Engines   source            : http://en.wikipedia.org/wiki/Aichi_Atsuta

                 name              : Aichi Atsuta
                 type              : Twelve-cylinder liquid-cooled supercharged 60 deg inverted Vee aircraft piston engine
                 power takeoff     : 1400 hp at 2800 rpm at sea level
                 power cruise      : 1290 hp at 2600 rpm at 5000 m ( 16000 ft )
                 weight            : 715 kg ( 1576 lb )
                 displacement      : 33.93 L (2071 cu in)
                 compression       : 7.2:1

  -->
  <propeller x="3.24114" y="0" z="0.20852"
             mass="1576"
             radius="1.665"
             moment="35"
             cruise-power="1290"
             cruise-alt="16000"
             cruise-speed="160"
             cruise-rpm="2600"
             min-rpm="500"
             max-rpm="2800">
             <actionpt x="4.49114" y="0" z="0.20852"/>
             <control-input control="ADVANCE"  axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-rpm="2800"
                            alt="0"
                            eng-power="1400"
                            displacement="2071"
                            compression="7.2"/>
             <control-input control="THROTTLE" axis="/controls/engines/engine[0]/throttle"/>
             <control-input control="STARTER"  axis="/controls/engines/engine[0]/starter"/>
             <control-input control="MAGNETOS" axis="/controls/engines/engine[0]/magnetos"/>
             <control-input control="MIXTURE"  axis="/controls/engines/engine[0]/mixture"/>
  </propeller>

  <!-- Flotteurs -->
  <!-- 0 / 1 Avants -->
  <gear x="5.229" y="1.6863" z="-2.24"
        compression="1.2"
        spring = "15"
        sfric = "0.8"
        dfric = "0.7"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.15"
        speed-planing="15"
        spring-factor-not-planing="0.7">
  </gear>

  <gear x="5.229" y="-1.6863" z="-2.24"
        compression="1.2"
        spring = "15"
        sfric = "0.8"
        dfric = "0.7"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.15"
        speed-planing="15"
        spring-factor-not-planing="0.7">
  </gear>

  <!-- 2 / 3 Centrales -->
  <gear x="1.698" y="1.6863" z="-2.24"
        compression="1.5"
        spring = "15"
        sfric = "0.85"
        dfric = "0.75"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.15"
        speed-planing="25"
        spring-factor-not-planing="0.25">
  </gear>

  <gear x="1.698" y="-1.6863" z="-2.24"
        compression="1.5"
        spring = "15"
        sfric = "0.85"
        dfric = "0.75"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.15"
        speed-planing="25"
        spring-factor-not-planing="0.25">
  </gear>

  <!-- 4 / 5 Arrieres -->
  <gear x="-1.283" y="1.6863" z="-1.98"
        compression="1.8"
        spring = "8"
        sfric = "0.9"
        dfric = "0.8"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="0.9"
        speed-planing="25"
        spring-factor-not-planing="3">
  </gear>

  <gear x="-1.283" y="-1.6863" z="-1.98"
        compression="1.8"
        spring = "8"
        sfric = "0.9"
        dfric = "0.8"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="0.9"
        speed-planing="25"
        spring-factor-not-planing="3">
  </gear>

  <!-- 6 - Gouvernail gauche -->
  <gear x="-2.08345" y="1.6863" z="-1.62403"
        compression="1.8"
        spring="8"
        sfric="0.9"
        dfric="0.8"
        ignored-by-solver="1"
        on-water="1"
        on-solid="0"
        reduce-friction-by-extension="0.9"
        speed-planing="25"
        spring-factor-not-planing="3">
        <control-input axis="/controls/gear/water-rudder-pos" control="STEER" invert ="true" square="true"/>
  </gear>

  <!-- 7 - Gouvernail droit -->
  <gear x="-2.08345" y="-1.6863" z="-1.62403"
        compression="1.8"
        spring="8"
        sfric="0.9"
        dfric="0.8"
        ignored-by-solver="1"
        on-water="1"
        on-solid="0"
        reduce-friction-by-extension="0.9"
        speed-planing="25"
        spring-factor-not-planing="3">
        <control-input axis="/controls/gear/water-rudder-pos" control="STEER" invert ="true" square="true"/>
  </gear>

  <!-- Fuel  -->
  <tank x=" 0.95" y=" 1.69" z="0.0" capacity="210"/>
  <tank x=" 0.30" y=" 0.00" z="0.5" capacity="156"/>
  <tank x=" 0.95" y="-1.69" z="0.0" capacity="210"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
       2.711 / 6     = 0.451
       0.866 + 0.451 = 1.317
  -->
  <ballast x="4" y="0" z="0" mass="842"/>

</airplane>
