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

<!-- Dornier Do 335 - 2008
                   Updated Emmanuel BARANGER 2010
                   Updated Emmanuel BARANGER 10/2019
                   Updated Emmanuel BARANGER 02/2021
                   Updated Emmanuel BARANGER 03/2023

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

     Wingspan            : 13.80 m  ( 45 ft 1 in )
     Length              : 13.85 m  ( 45 ft 5 in )
     Height              :  5.00 m  ( 16 ft      )
     Empty weight        :  7260 kg ( 16006 lb   )
     Gross weight        :  9600 kg ( 21164 lb   )
     Engines             : 2 x DB 603E-1 ( 2 x 1800 hp for takeoff )
                                         ( 2 x 1500 hp for maximum continuous )
     Fuel capacity       : 1230 l   ( 320 US gal ) main fuel tank (single-seat)
     Maximum speed       : 763 km/h ( 412 kn     ) at 6500 m ( 21300 ft )
     Cruise speed        : 685 km/h ( 370 kn     ) at 7200 m ( 23600 ft )
     Economical cruise speed : 452 km/h ( 244 kn ) at 6000 m ( 20000 ft )
-->
<airplane mass="16006" version="YASIM_VERSION_CURRENT" mtow-lbs="21164">

  <approach speed="90" aoa="2" fuel="0.3">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.2"/>
    <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[1]/throttle"        value="0.2"/>
    <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/flight/flaps"                      value="1"/>
    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <cruise speed="370" alt="20000">
    <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/engines/engine[1]/throttle"        value="1"/>
    <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/flight/flaps"                      value="0"/>
    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="2.611" y="0" z="0.756"/>

  <fuselage ax=" 6.933" ay=" 0.000" az=" 0.083" bx=" 6.347" by=" 0.000" bz=" 0.083" width="0.630" taper="0.10" midpoint="1"/>
  <fuselage ax=" 6.363" ay=" 0.000" az=" 0.046" bx=" 5.760" by=" 0.000" bz=" 0.046" width="1.200" taper="0.90" midpoint="1"/>
  <fuselage ax=" 5.793" ay=" 0.000" az=" 0.046" bx="-2.817" by=" 0.000" bz=" 0.046" width="1.200" taper="1.00" midpoint="1"/>
  <fuselage ax="-2.817" ay=" 0.000" az=" 0.046" bx="-5.953" by=" 0.000" bz=" 0.590" width="1.200" taper="0.50" midpoint="0"/>
  <fuselage ax="-6.012" ay=" 0.000" az=" 0.580" bx="-6.894" by=" 0.000" bz=" 0.580" width="0.630" taper="0.10" midpoint="0"/>

  <fuselage ax=" 5.757" ay=" 0.000" az=" 0.352" bx=" 3.410" by=" 0.000" bz=" 0.464" width="0.840" taper="0.70" midpoint="1"/>
  <fuselage ax=" 3.410" ay=" 0.000" az=" 0.464" bx=" 2.006" by=" 0.000" bz=" 0.664" width="1.200" taper="0.70" midpoint="1"/>
  <fuselage ax=" 2.048" ay=" 0.000" az=" 0.664" bx="-0.453" by=" 0.000" bz=" 0.664" width="1.200" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.453" ay=" 0.000" az=" 0.664" bx="-5.953" by=" 0.000" bz=" 0.590" width="1.200" taper="0.50" midpoint="0"/>

  <wing x="0.959" y="0" z="-0.248"
        chord    = "3.900"
        length   = "6.934"
        taper    = "0.49"
        dihedral = "4"
        sweep    = "6"
        camber   = "0.01">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.11" end="0.49" lift="1.7" drag="1.9"/>
        <flap1 start="0.49" end="0.92" lift="1.2" drag="1.1"/>

        <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" side="left"  prop="/surface-positions/left-aileron-pos-norm"/>
        <control-output control="FLAP1" side="right" prop="/surface-positions/right-aileron-pos-norm"/>

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

  <hstab x="-5.063" y="0.305" z="0.644"
         chord    = "1.659"
         length   = "2.55"
         sweep    = "2"
         dihedral = "1"
         taper    = "0.62">
         <stall   aoa="20" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.5" drag="1.2"/>

         <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="-5.051" y="0.00" z="0.757"
         chord  = "1.749"
         length = "1.7"
         taper  = "0.35"
         sweep  = "10">
         <stall   aoa="16" width="1"    peak="1.5"/>
         <flap0 start="0.1"  end="0.85" lift="1.4" drag="1.2"/>

         <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="-5.051" y="0.00" z="0.260"
         chord    = "1.749"
         length   = "1.7"
         taper    = "0.35"
         dihedral = "-90"
         sweep    = "10">
         <stall   aoa="16" width="1"   peak="1.5"/>
         <flap0 start="0.2"  end="0.8" lift="1.3" drag="1.2"/>

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

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

                 name              : Daimler-Benz DB 603
                 type              : 12-cylinder liquid-cooled supercharged inverted Vee aircraft piston engine
                 Power             : 1800 hp for takeoff
                                     1500 hp for maximum continuous
                 weight            :  920 kg    ( 2030 lb )
                 displacement      : 2716.9 in3 ( 44.52 l )
                 compression       : 7.5:1
  -->
  <propeller x="4.990" y="0" z="0.049"
             mass         = "2030"
             moment       = "-25"
             radius       = "1.83"
             cruise-power = "1500"
             cruise-speed = "370"
             cruise-rpm   = "1537"
             cruise-alt   = "20000"
             fine-stop    = "1"
             coarse-stop  = "3.5"
             gear-ratio   = "0.542"
             contra       = "1">
             <actionpt x="6.489" y="0" z="0.084"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power    = "1800"
                            eng-rpm      = "2700"
                            displacement = "2716.9"
                            compression  = "7.5"
                            turbo-mul    = "2"
                            wastegate-mp = "40">
                            <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"/>
             </piston-engine>
  </propeller>

  <propeller x="-1.510" y="0" z="0.049"
             mass         = "2030"
             moment       = "-25"
             radius       = "1.83"
             cruise-power = "1500"
             cruise-speed = "370"
             cruise-rpm   = "1537"
             cruise-alt   = "20000"
             fine-stop    = "1"
             coarse-stop  = "3.5"
             gear-ratio   = "0.542"
             contra       = "1">
             <actionpt x="-6.207" y="0" z="0.584"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <piston-engine eng-power    = "1800"
                            eng-rpm      = "2700"
                            displacement = "2716.9"
                            compression  = "7.5"
                            turbo-mul    = "2"
                            wastegate-mp = "40">
                            <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"/>
             </piston-engine>
  </propeller>

  <gear x="4.897" y="0.00" z="-2.390"
        compression = "0.2"
        spring      = "4"
        damp        = "2"
        stiction    = "1">
        <control-input  control="STEER"  axis="/controls/flight/rudder"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
        <control-speed  control="EXTEND" transition-time="7"/>

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

  <gear x="0.840" y="2.794" z="-2.396"
        compression = "0.2"
        spring      = "4"
        damp        = "2"
        stiction    = "1">
        <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="6.2"/>
  </gear>

  <gear x="0.840" y="-2.794" z="-2.396"
        compression = "0.2"
        spring      = "4"
        damp        = "2"
        stiction    = "1">
        <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="6"/>
  </gear>

  <!-- 1230 l = 320 US gal = 2394 lbs -->
  <!-- Center tank     757 l   =   200 US Gal = 1500 lbs -->
  <tank x=" 0.90" y=" 0.00" z=" 0.450" capacity="1500"/>
  <!-- Left wing tank  236.5 l = 62.47 US Gal =  447 lbs -->
  <tank x=" 0.80" y=" 4.30" z=" 0.146" capacity="447"/>
  <!-- Right wing tank 236.5 l = 62.47 US Gal =  447 lbs -->
  <tank x=" 0.80" y="-4.30" z=" 0.146" capacity="447"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 3.900 / 6     = 0.650
                 0.959 + 0.650 = 1.609
  -->
  <ballast x="6.5" y="0" z="-0.5" mass="2920"/>

</airplane>
