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

<!-- Bugatti Model 100 : Emmanuel BARANGER 2010
            updated by : OO ZVY            2012
            udpated by : Emmanuel BARANGER 2020/04

     sources   : http://morlock68.free.fr/bugatti.htm
                 https://www.wikiwand.com/en/Bugatti%20Model%20100

     wingspan         : 8.235 m    (      ft   in)
     length           :  7.70 m    (      ft   in)
     height           :  2.25 m    (      ft 5 in)
     cruise speed     :   635 km/h (  343 kt     )
     landing speed    :   115 km/h (   62 kt     )
     max speed        :   805 km/h (  435 kt     )
     empty weight     :  1200 Kg   ( 2646 lb     )
     max weight       :  1355 kg   ( 2987 lb     )
     engine           : 2 x T50 B1 450 hp each at 4500 rpm
-->
<airplane mass="2646" version="YASIM_VERSION_CURRENT" mtow-lbs="2987">

  <!-- Approach configuration -->
  <approach speed="75" aoa="6">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.3"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.3"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.55"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="0.55"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.6"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.6"/>

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

  <!-- Cruise configuration -->
  <cruise speed="435" alt="2000">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="1"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="1"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>

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

  <!-- eyepoint -->
  <cockpit x="1.969" y="0" z="0.527"/>

  <fuselage ax=" 3.860" ay=" 0.000" az=" 0.179" bx=" 3.565" by=" 0.000" bz=" 0.179" width="0.338" taper="0.20" midpoint="1"/>
  <fuselage ax=" 3.565" ay=" 0.000" az=" 0.179" bx=" 3.337" by=" 0.000" bz=" 0.179" width="0.462" taper="0.73" midpoint="1"/>
  <fuselage ax=" 3.337" ay=" 0.000" az=" 0.179" bx=" 2.650" by=" 0.000" bz=" 0.146" width="0.683" taper="0.68" midpoint="1"/>
  <fuselage ax=" 2.650" ay=" 0.000" az=" 0.146" bx=" 1.504" by=" 0.000" bz=" 0.142" width="0.836" taper="0.82" midpoint="1"/>
  <fuselage ax=" 1.504" ay=" 0.000" az=" 0.142" bx=" 0.009" by=" 0.000" bz=" 0.142" width="0.836" taper="0.92" midpoint="0"/>
  <fuselage ax=" 0.009" ay=" 0.000" az=" 0.142" bx="-2.044" by=" 0.000" bz=" 0.142" width="0.769" taper="0.56" midpoint="0"/>
  <fuselage ax="-2.044" ay=" 0.000" az=" 0.142" bx="-2.539" by=" 0.000" bz=" 0.142" width="0.431" taper="0.80" midpoint="0"/>
  <fuselage ax="-2.539" ay=" 0.000" az=" 0.142" bx="-3.260" by=" 0.000" bz=" 0.347" width="0.345" taper="0.50" midpoint="0"/>
  <fuselage ax="-3.260" ay=" 0.000" az=" 0.347" bx="-3.878" by=" 0.000" bz=" 0.412" width="0.172" taper="0.20" midpoint="0"/>

  <fuselage ax=" 3.337" ay=" 0.000" az=" 0.179" bx=" 2.651" by=" 0.000" bz=" 0.229" width="0.683" taper="0.68" midpoint="1"/>
  <fuselage ax=" 2.651" ay=" 0.000" az=" 0.229" bx=" 1.506" by=" 0.000" bz=" 0.289" width="0.836" taper="0.82" midpoint="1"/>
  <fuselage ax=" 1.506" ay=" 0.000" az=" 0.289" bx=" 0.001" by=" 0.000" bz=" 0.330" width="0.836" taper="0.92" midpoint="0"/>
  <fuselage ax=" 0.001" ay=" 0.000" az=" 0.330" bx="-2.039" by=" 0.000" bz=" 0.391" width="0.769" taper="0.56" midpoint="0"/>
  <fuselage ax="-2.044" ay=" 0.000" az=" 0.391" bx="-2.539" by=" 0.000" bz=" 0.391" width="0.431" taper="0.80" midpoint="0"/>
  <fuselage ax="-2.539" ay=" 0.000" az=" 0.391" bx="-3.288" by=" 0.000" bz=" 0.388" width="0.345" taper="0.50" midpoint="0"/>
  <fuselage ax="-3.288" ay=" 0.000" az=" 0.388" bx="-3.878" by=" 0.000" bz=" 0.412" width="0.172" taper="0.20" midpoint="0"/>

  <wing x="-0.326" y="0" z="0"
        chord    = "2.500"
        length   = "4.309"
        taper    = "0.2"
        dihedral = "3"
        sweep    = "-14"
        camber   = "0.005">
        <stall     aoa="16" width="1"    peak="1.5"/>
        <flap0   start="0.24" end="0.60" lift="1.7" drag="1.9"/>
        <flap1   start="0.63" end="0.96" lift="1.4" drag="1.1"/>
        <spoiler start="0.63" end="0.96" lift="1.7" drag="1.9"/>

        <control-input  control="FLAP0"   axis="/controls/flight/flaps"/>
        <control-input  control="SPOILER" axis="/controls/flight/spoilers"/>
        <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="SPOILER" prop="/surface-positions/speedbrake-pos-norm"   invert="true" />
        <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"/>
  </wing>

  <hstab x="-3.118" y="0" z="0.370"
         chord    = "1.390"
         length   = "1.6"
         taper    = "0.15"
         sweep    = "6"
         dihedral = "28">
         <stall   aoa="14" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.4" 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="-3.118" y="0" z="0.370"
         chord    = "1.390"
         length   = "0.83"
         taper    = "0.20"
         dihedral = "-90"
         sweep    = "15">
         <stall   aoa="12" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.4" drag="1.2"/>

         <control-input  control="FLAP0" axis="/controls/flight/rudder"            square="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>

  <!-- sources   : http://morlock68.free.fr/bugatti.htm

         Name         : T50 B1
         Type         : 8 cylinders inline
         Displacement :     in3 (     l  )
         Weight       : 485 lb  ( 220 kg )
         Cruise power : 343 hp at 4300 rpm
         Max power    : 435 hp at 4500 rpm

         Compression and Displacement of D520 (I have not find better :( )
  -->
  <propeller x="0.963" y="0.120" z="0.349"
             radius        = "0.882"
             mass          = "485"
             moment        = "-10"
             cruise-alt    = "2000"
             cruise-power  = "420"
             cruise-speed  = "343"
             cruise-rpm    = "4300"
             takeoff-power = "435"
             takeoff-rpm   = "4500"
             contra        = "1">
             <actionpt x="3.661" y="0" z="0.178"/>
             <control-input control="ADVANCE"  axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-power    = "435"
                            eng-rpm      = "4500"
                            displacement = "1751"
                            compression  = "5.8">
                            <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="-0.623" y="-0.120" z="0.349"
             radius        = "0.882"
             mass          = "485"
             moment        = "-10"
             cruise-alt    = "2000"
             cruise-power  = "420"
             cruise-speed  = "343"
             cruise-rpm    = "4300"
             takeoff-power = "435"
             takeoff-rpm   = "4500"
             contra        = "1">
             <actionpt x="3.476" y="0" z="0.178"/>
             <control-input control="ADVANCE"  axis="/controls/engines/engine[1]/propeller-pitch"/>
             <piston-engine eng-power    = "435"
                            eng-rpm      = "4500"
                            displacement = "1751"
                            compression  = "5.8">
                            <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="0.709" y="1.487" z="-1.158"
        compression                  = "0.4"
        spring                       = "2"
        damp                         = "1.2"
        sfric                        = "1"
        dfric                        = "1"
        reduce-friction-by-extension = "0.7"
        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[0]/position-norm"/>

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

  <gear x="0.709" y="-1.487" z="-1.158"
        compression                  = "0.4"
        spring                       = "2"
        damp                         = "1.2"
        sfric                        = "1"
        dfric                        = "1"
        reduce-friction-by-extension = "0.7"
        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[1]/position-norm"/>

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

  <gear x="-3.279" y="0" z="-0.511"
        compression                  = "0.2"
        spring                       = "2"
        damp                         = "1.2"
        sfric                        = "1"
        dfric                        = "1"
        reduce-friction-by-extension = "0.7"
        stiction                     = "1">
        <control-input  control="CASTERING" axis="/controls/gear/tailwheel-lock" src0="0" src1="1" dst0="1" dst1="0"/>
        <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.1"/>
  </gear>

  <tank x="0.05" y=" 1.15" z="0" capacity="482.5"/>
  <tank x="0.05" y="-1.15" z="0" capacity="482.5"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.500 / 6     = 0.416
                -0.326 + 0.416 = 0.090
  -->
  <ballast x="2" y="0" z="0" mass="162"/>

</airplane>
