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

<!-- Velocity XL

     Alternative Velocity XL FDM Gary R. Neely "Buckaroo"

     Updated Decmeber 2015 : BARANGER Emmanuel aka "helijah"
     Updated November 2021 : BARANGER Emmanuel aka "helijah"

     source             : https://en.wikipedia.org/wiki/Velocity_XL

     Wingspan           : 31 ft 0 in (  9.45 m    )
     lenght             : 20 ft 0 in (  6.10 m    )
     height             :  8 ft 5 in (  2.56 m    )
     Empty mass         :    1700 lb (   771 kg   )
     Max takeoff weight :    2701 lb (  1225 kg   )
     Engine             : 1 x Continental IO-550 air-cooled flat six ( 310 hp )
     Cruise speed       :     205 kt (   380 km/h ) normal at 75% power
     Stall speed        :      65 kt (   121 km/h )
-->
<airplane mass="1650" version="YASIM_VERSION_CURRENT" mtow-lbs="2701">

  <!-- Mostly guesswork, with a little research.
       75% throttle is max cruise, but the POH recommends 60% for best fuel and noise results.
       Cruise mixture is a guess, needs experimentation, leaning just rich of peak. Some Velocity
       packages have an engine control setting that adjusts mixture automatically.
       Best glide ratio is said to be 12:1, the model currently gives a conservative L/D of ~11:1. -->
  <approach speed="75" aoa="2" 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/gear/gear-down"                    value="1"/>
    <solve-weight idx="0" weight="180"/>
    <solve-weight idx="1" weight="0"/>
  </approach>

  <cruise speed="178" alt="8000" fuel="0.7">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.65"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.8"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.5"/>
    <control-setting axis="/controls/gear/gear-down" value="0"/>
    <solve-weight idx="0" weight="180"/>
    <solve-weight idx="1" weight="0"/>
  </cruise>

  <!-- Cockpit position: -->
  <cockpit x="0.77" y="0.236" z="0.404"/>

  <!-- Fuselage -->
  <fuselage ax=" 3.017" ay=" 0.000" az="-0.123" bx=" 2.993" by=" 0.000" bz="-0.123" width="0.070" taper="0.10" midpoint="1"/>
  <fuselage ax=" 2.993" ay=" 0.000" az="-0.123" bx=" 2.937" by=" 0.000" bz="-0.126" width="0.172" taper="0.40" midpoint="1"/>
  <fuselage ax=" 2.937" ay=" 0.000" az="-0.126" bx=" 2.671" by=" 0.000" bz="-0.131" width="0.470" taper="0.36" midpoint="1"/>

  <!-- Left -->
  <fuselage ax=" 2.671" ay=" 0.000" az="-0.131" bx=" 1.758" by=" 0.145" bz="-0.131" width="0.780" taper="0.60" midpoint="1"/>
  <fuselage ax=" 1.758" ay=" 0.145" az="-0.131" bx=" 0.925" by=" 0.113" bz="-0.011" width="1.030" taper="0.74" midpoint="1"/>
  <fuselage ax=" 0.925" ay=" 0.113" az="-0.011" bx=" 0.418" by=" 0.072" bz=" 0.021" width="1.123" taper="0.92" midpoint="1"/>
  <fuselage ax=" 0.418" ay=" 0.072" az=" 0.021" bx="-0.275" by=" 0.072" bz=" 0.021" width="1.123" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.275" ay=" 0.072" az=" 0.021" bx="-1.288" by=" 0.107" bz=" 0.021" width="1.123" taper="0.80" midpoint="0"/>
  <fuselage ax="-1.288" ay=" 0.107" az=" 0.021" bx="-1.866" by=" 0.205" bz=" 0.075" width="0.898" taper="0.60" midpoint="0"/>
  <fuselage ax="-1.863" ay=" 0.205" az=" 0.089" bx="-2.099" by=" 0.205" bz=" 0.129" width="0.531" taper="0.50" midpoint="0"/>

  <!-- Right -->
  <fuselage ax=" 2.671" ay=" 0.000" az="-0.131" bx=" 1.758" by="-0.145" bz="-0.131" width="0.780" taper="0.60" midpoint="1"/>
  <fuselage ax=" 1.758" ay="-0.145" az="-0.131" bx=" 0.925" by="-0.113" bz="-0.011" width="1.030" taper="0.74" midpoint="1"/>
  <fuselage ax=" 0.925" ay="-0.113" az="-0.011" bx=" 0.418" by="-0.072" bz=" 0.021" width="1.123" taper="0.92" midpoint="1"/>
  <fuselage ax=" 0.418" ay="-0.072" az=" 0.021" bx="-0.275" by="-0.072" bz=" 0.021" width="1.123" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.275" ay="-0.072" az=" 0.021" bx="-1.288" by="-0.107" bz=" 0.021" width="1.123" taper="0.80" midpoint="0"/>
  <fuselage ax="-1.288" ay="-0.107" az=" 0.021" bx="-1.866" by="-0.205" bz=" 0.075" width="0.898" taper="0.60" midpoint="0"/>
  <fuselage ax="-1.863" ay="-0.205" az=" 0.089" bx="-2.099" by="-0.205" bz=" 0.129" width="0.531" taper="0.50" midpoint="0"/>

  <mstab x="0.111" y="0" z="-0.146"
         chord="3.5"
         length="2.41"
         taper="0.38"
         dihedral="2.6"
         sweep="38"
         camber="0.03">
         <stall aoa="18" width="1" peak="1.5"/>
  </mstab>

  <!-- Aileron trailing edges are up to 1/4" below wing trailing edge at neutral.
       Travel is 2.5" at inboard trailing edge.
       Dihedral unknown, but slight based on photos and drawings. -->
  <wing x="-1.371" y="1.8936" z="-0.0577"
        chord="1.36"
        length="2.94"
        taper="0.5"
        dihedral="0"
        sweep="20.5"
        camber="0.03">
        <stall   aoa="18" width="1"    peak="1.5"/>
        <flap0 start="0.25" end="0.75" lift="1.15" drag="1.2"/>

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

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

  <!-- Canard travel is 26 deg down, 23 deg up.
       Dihedral unknown. Photos and drawings suggest a slight negative value. -->
  <hstab x="1.957" y="0" z="0.018"
         chord="0.473"
         length="2.32"
         taper="1"
         incidence="-2"
         camber="0.1">
         <stall   aoa="15" width="1"    peak="1.5" />
         <flap0 start="0.25" end="0.95" lift="1.28" drag="1.5"/>

         <control-input  control="FLAP0" axis="/controls/flight/elevator"      invert="true"/>
         <control-input  control="FLAP0" axis="/controls/flight/elevator-trim" invert="true"/>
         <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
  </hstab>

  <!-- Twin vertical stabs have one-way rudders; travel is outboard up to 1.75" at trailing edge.
       Both rudders can be employed to make a weak speedbrake.
       Note that an optional bellyflap is used on some builds for a more effective speedbrake. -->
  <vstab x="-2.346" y="-4.645" z="0.076"
         sweep="21"
         chord="0.730"
         taper="0.545"
         length="1.311">
         <stall   aoa="14" width="1"  peak="1.5" />
         <flap0 start="0"    end="1"  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"/>
  </vstab>

  <vstab x="-2.346" y="4.645" z="0.076"
         sweep="21"
         chord="0.730"
         taper="0.545"
         length="1.311">
         <stall   aoa="14" width="1"  peak="1.5" />
         <flap0 start="0"    end="1"  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"/>
  </vstab>

  <!-- EB : I doubled the vertical stabilizers to simulate the speedbrake without going through an unnecessary Nasal file :)  -->
  <vstab x="-2.346" y="-4.645" z="0.076"
         sweep="21"
         chord="0.730"
         taper="0.545"
         length="1.311">
         <stall   aoa="14" width="1"  peak="1.5" />
         <flap0 start="0"    end="1"  lift="1.5" drag="1.2"/>

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

         <control-output control="FLAP0" prop="/surface-positions/speedbrake-left"/>
  </vstab>

  <vstab x="-2.346" y="4.645" z="0.076"
         sweep="21"
         chord="0.730"
         taper="0.545"
         length="1.311">
         <stall   aoa="14" width="1"  peak="1.5" />
         <flap0 start="0"    end="1"  lift="1.5" drag="1.2"/>

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

         <control-output control="FLAP0" prop="/surface-positions/speedbrake-right"/>
  </vstab>

  <!--  Continental IO-550
                 source       : https://en.wikipedia.org/wiki/Continental_IO-550

                 type         : 6-cylinder air-cooled horizontally opposed aircraft piston engine
                 power        : 300 hp at 2700 rpm
                 weight       : 430.72 lb dry ( 195.37 kg )
                 Displacement : 552 in3 ( 9.05 L )
                 Compression  : 8.5:1

        Engine/prop as original FDM except for location and action point.
        Action point is a guess at thrust bearing location.
  -->
  <propeller x="-1.47011" y="0" z="0.14603"
             mass="430"
             radius="0.88"
             moment="9.64"
             cruise-speed="250"
             cruise-rpm="2700"
             cruise-alt="8500"
             cruise-power="280"
             takeoff-power="280"
             takeoff-rpm="2700"
             gear-ratio=".94"
             fine-stop="0.8"
             coarse-stop="4"
             min-rpm="2454"
             max-rpm="2887"
             contra="1">
             <actionpt x="-2.22477" y="0" z="0.14603"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <piston-engine eng-rpm="2700"
                            eng-power="300"
                            displacement="541.5"
                            compression="8.7">
                            <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>

  <!-- Slight changes to gear locations: -->
  <gear x="2.150" y="0" z="-1.255"
        compression="0.1"
        spring="0.8"
        stiction="1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" square="true" src0="-1.0" src1="1.0" dst0="-0.5" dst1="0.5"/>
        <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="7"/>
  </gear>

  <gear x="-0.9" y="0.9" z="-1.2"
        compression="0.1"
        spring="0.8"
        stiction="1">
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"    split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <control-input  control="STEER"  axis="/sim/gears/toe-left"/>

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

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

  <gear x="-0.9" y="-0.9" z="-1.2"
        compression="0.1"
        spring="0.8"
        stiction="1">
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"   split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <control-input  control="STEER"  axis="/sim/gears/toe-right"/>

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

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

  <!-- Based on two 33 gallon tanks in approximately mid-wing strake locations
       and one 4 gallon feed sump located behind rear seat. This needs some nasal work
       to make the main tanks feed the sump which then feeds the engine. Currently all
       tanks feed evenly by the default fuel system, so the sump tank will run dry
       quickly, though that's not a problem. Change the order of these if your fuel
       gauges report wrong.
       Note that positions may be more outboard than shown here, as inboard strakes
       are baggage compartments. -->
  <tank x="-1" y=" 0.000" z="-0.1" capacity=" 24"/>
  <tank x="-1" y=" 0.900" z="-0.1" capacity="198"/>
  <tank x="-1" y="-0.900" z="-0.1" capacity="198"/>

  <!-- Weight options:
  forward seats
  rear seat or baggage -->
  <weight x=" 0.77" y="0" z="0" mass-prop="/sim/weight[0]/weight-lb"/>
  <weight x="-1.00" y="0" z="0" mass-prop="/sim/weight[1]/weight-lb"/>

  <ballast x="2.00" y="0" z="0" mass="325"/>

</airplane>
