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

<!-- B 25a Mitchell BARANGER Emmanuel (2009)
     change by         Detlef FABER           (2009)
     change by         JC_SV                  (2012)
     change by         Buckaroo (Gary Neely)  (March 2012, major revision)
     change by         BARANGER Emmanuel      (August 2015 - add version="YASIM_VERSION_CURRENT")
     Total revision by BARANGER Emmanuel      (March 2022)

     Sources         : https://www.wikiwand.com/en/North_American_B-25_Mitchell

     Wingspan           : 20.60 m     (    67 ft  7 in )
     Lenght             : 16.48 m     (    52 ft 11 in )
     Height             :  4.98 m     (    16 ft  4 in )
     Empty mass         :  8835 kg    ( 19477 lb       )
     Max takeoff weight : 15876 kg    ( 35000 lb       )
     Cruise speed       :   400 km/h  (   247 kts      )
     Engines            : 2 Wright R-2600-92 Twin Cyclone 14-cylinder two-row air-cooled radial piston engines ( 1700 hp each )
-->
<airplane mass="15477" version="YASIM_VERSION_CURRENT" mtow-lbs="31000">

  <approach speed="89" aoa="4" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.3"/>
    <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/engines/engine[0]/boost"           value="0.7"/>

    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="0.7"/>

    <control-setting axis="/controls/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <cruise speed="222" alt="15000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.5"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[0]/boost"           value="1"/>

    <control-setting axis="/controls/engines/engine[1]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="0.5"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/boost"           value="1"/>

    <control-setting axis="/controls/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="4.626" y="0.325" z="0.755"/>

  <!-- Fuselage up -->
  <fuselage ax=" 5.717" ay=" 0.000" az=" 0.304" bx=" 5.211" by=" 0.000" bz=" 0.304" width="1.473" taper="0.40" midpoint="1"/>
  <fuselage ax=" 5.211" ay=" 0.000" az=" 0.304" bx="-0.248" by=" 0.000" bz=" 0.304" width="1.473" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.248" ay=" 0.000" az=" 0.304" bx="-6.867" by=" 0.000" bz=" 0.100" width="1.473" taper="0.55" midpoint="0"/>
  <!-- Fuselage down -->
  <fuselage ax=" 7.748" ay=" 0.000" az="-0.088" bx=" 7.341" by=" 0.000" bz="-0.144" width="0.951" taper="0.20" midpoint="1"/>
  <fuselage ax=" 7.341" ay=" 0.000" az="-0.144" bx=" 6.476" by=" 0.000" bz="-0.123" width="1.327" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.476" ay=" 0.000" az="-0.123" bx=" 5.006" by=" 0.000" bz="-0.146" width="1.473" taper="0.90" midpoint="1"/>
  <fuselage ax=" 5.006" ay=" 0.000" az="-0.146" bx="-0.250" by=" 0.000" bz="-0.146" width="1.473" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.250" ay=" 0.000" az="-0.146" bx="-6.867" by=" 0.000" bz=" 0.100" width="1.473" taper="0.55" midpoint="0"/>
  <fuselage ax="-6.867" ay=" 0.000" az=" 0.100" bx="-7.790" by=" 0.000" bz=" 0.126" width="0.810" taper="0.75" midpoint="0"/>
  <fuselage ax="-7.790" ay=" 0.000" az=" 0.126" bx="-8.205" by=" 0.000" bz=" 0.079" width="0.607" taper="0.60" midpoint="0"/>

  <!-- Moteur gauche, left nacelle -->
  <fuselage ax=" 3.900" ay=" 2.891" az="-0.106" bx=" 3.807" by=" 2.891" bz="-0.106" width="1.179" taper="0.90" midpoint="1"/>
  <fuselage ax=" 3.807" ay=" 2.891" az="-0.106" bx=" 3.217" by=" 2.891" bz="-0.106" width="1.392" taper="0.84" midpoint="1"/>
  <fuselage ax=" 3.217" ay=" 2.891" az="-0.106" bx=" 0.758" by=" 2.891" bz="-0.106" width="1.392" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.758" ay=" 2.891" az="-0.106" bx="-0.136" by=" 2.891" bz="-0.106" width="1.392" taper="0.90" midpoint="0"/>
  <fuselage ax="-0.136" ay=" 2.891" az="-0.106" bx="-1.784" by=" 2.891" bz="-0.106" width="1.253" taper="0.15" midpoint="0"/>

  <!-- Moteur droit, right nacelle -->
  <fuselage ax=" 3.900" ay="-2.891" az="-0.106" bx=" 3.807" by="-2.891" bz="-0.106" width="1.179" taper="0.90" midpoint="1"/>
  <fuselage ax=" 3.807" ay="-2.891" az="-0.106" bx=" 3.217" by="-2.891" bz="-0.106" width="1.392" taper="0.84" midpoint="1"/>
  <fuselage ax=" 3.217" ay="-2.891" az="-0.106" bx=" 0.758" by="-2.891" bz="-0.106" width="1.392" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.758" ay="-2.891" az="-0.106" bx="-0.136" by="-2.891" bz="-0.106" width="1.392" taper="0.90" midpoint="0"/>
  <fuselage ax="-0.136" ay="-2.891" az="-0.106" bx="-1.784" by="-2.891" bz="-0.106" width="1.253" taper="0.15" midpoint="0"/>

  <!-- invert="true" -->
  <wing x="0.671" y="0" z="0.127"
        chord="3.838"
        length="10.264"
        taper="0.44"
        sweep="-2"
        incidence="2"
        dihedral="2"
        twist="-2"
        idrag="0.8"
        camber="0.133">
        <stall   aoa="20"  width="1"     peak="1.5"/>
        <flap0 start="0.08" end="0.60" lift="1.6" drag="1.9"/>
        <flap1 start="0.60" end="0.94" lift="1.3" drag="1.35"/>

        <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-speed  control="FLAP0" transition-time="5"/>
  </wing>

  <hstab x="-6.553" y="0" z="0.477"
         chord="2.233"
         length="3.37"
         sweep="6"
         taper="0.71"
         camber="0.05">
         <stall   aoa="18" width="1"    peak="1.5"/>
         <flap0 start="0.14"  end="0.95" lift="2.4" drag="1.8"/>

         <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>

  <!-- Rudders -->
  <vstab x="-6.677" y="3.358" z="-0.197"
         chord="1.985"
         length="2.536"
         sweep="5"
         taper="0.74">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" drag="1.35"/>

         <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"/>
  </vstab>

  <vstab x="-6.677" y="-3.358" z="-0.197"
         chord="1.985"
         length="2.536"
         sweep="5"
         taper="0.74">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" drag="1.35"/>

         <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"/>
  </vstab>

  <!-- Informations : http://en.wikipedia.org/wiki/Wright_R-2600

     Engines : Wright R2600
             : Power 1700 ch
             : 14 cylinders
             : Displacement 2603.9 (42.67 l)
             : Masse 2045 lb (930 kg)
             : RPM 2400 - 2600
             : Compression 6.9:1
  -->

  <!-- Engine left -->
  <propeller x="3.679" y="2.891" z="-0.106"
             mass="1980"
             moment="125"
             radius="2"
             min-rpm="366"
             max-rpm="1463"
             gear-ratio="0.5625"
             cruise-rpm="1350"
             cruise-power="1500"
             cruise-speed="200"
             cruise-alt="6700">
             <actionpt x="4.063" y="2.891" z="-0.106"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power="1700"
                            eng-rpm="2600"
                            displacement="2603.9"
                            compression="6.9"
                            supercharger="1"
                            turbo-mul="2.1"
                            wastegate-mp="44.5">
                            <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"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Engine right-->
  <propeller x="3.679" y="-2.891" z="-0.106"
             mass="1980"
             moment="125"
             radius="2"
             min-rpm="366"
             max-rpm="1463"
             gear-ratio="0.5625"
             cruise-rpm="1350"
             cruise-power="1500"
             cruise-speed="200"
             cruise-alt="6700">
             <actionpt x="4.063" y="-2.891" z="-0.106"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <piston-engine eng-power="1700"
                            eng-rpm="2600"
                            displacement="2603.9"
                            compression="6.9"
                            supercharger="1"
                            turbo-mul="2.1"
                            wastegate-mp="44.5">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[1]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[1]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[1]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[1]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Nose wheel -->
  <gear x="6.118" y="0.000" z="-2.375"
        compression="0.2"
        spring="6"
        damp="1.0"
        sfric="0.8"
        dfric="0.7">
        <control-input  control="STEER"  axis="/controls/flight/rudder" square="true" src0="-1" src1="1" dst0="-0.8" dst1="0.8"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>

        <control-speed  control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Left wheel -->
  <gear x="1.028" y="2.953" z="-2.271"
        compression="0.2"
        spring="6"
        damp="1.0"
        sfric="0.8"
        dfric="0.7">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>

        <control-speed  control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Right wheel -->
  <gear x="1.028" y="-2.953" z="-2.271"
        compression="0.2"
        spring="6"
        damp="1.0"
        sfric="0.8"
        dfric="0.7">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

        <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>

        <control-speed  control="EXTEND" transition-time="5"/>
  </gear>

  <tank x=" 1.70" y=" 1.5" z="-0.18" capacity="1104"/>
  <tank x=" 1.70" y="-1.5" z="-0.18" capacity="1104"/>
  <tank x="-0.65" y=" 1.5" z="-0.18" capacity="912"/> <!-- Tank Rear Left -->
  <tank x="-0.65" y="-1.5" z="-0.18" capacity="912"/> <!-- Tank Rear Right -->
  <tank x=" 1.60" y=" 3.5" z="-0.18" capacity="912"/> <!-- Tank Aux Left -->
  <tank x=" 1.60" y="-3.5" z="-0.18" capacity="912"/> <!-- Tank Aux Right -->

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 3.838 / 6     = 0.639
                 0.671 + 0.639 = 1.310  for FG : 1.943
  -->
  <ballast x="7.0" y="0" z="-0.5" mass="3260"/>

</airplane>
