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

<!-- Grob 115E
     3D model by Emmanuel BARANGER
     FDM by Jon Stockill

     Updated with melchior's script : Emmanuel BARANGER    2013
     Updated                        : Emmanuel BARANGER 08/2023
     Updated                        : Emmanuel BARANGER 07/2024

     Sources            : http://en.wikipedia.org/wiki/Grob_G_115

     Wingspan           : 10.0 m    (   32 ft  8 in )
     Length             : 7.54 m    (   24 ft  9 in )
     Height             :  2.4 m    (    7 ft 10 in )
     Engine             :  1 x AEIO-360-B1F/B 4-cylinder air-cooled piston engine ( 180 hp )
     Empty weight       :  685 kg   ( 1510 lb       )
     Max takeoff weight :  990 kg   ( 2183 lb       )
     Cruise speed       :  185 km/h (  124 kt       )
     Max speed          :  343 km/h (  185 kt       )
-->
<airplane mass="1518" version="YASIM_VERSION_CURRENT" mtow-lbs="2183">

  <!-- Approach configuration -->
  <approach speed="55" aoa="2" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.20"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.00"/>
    <control-setting axis="/controls/flight/flaps"               value="0.75"/>
    <solve-weight    idx="0" weight="170"/>
    <solve-weight    idx="1" weight="170"/>
    <solve-weight    idx="2" weight="40"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="124" alt="5000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.75"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.60"/>
    <control-setting axis="/controls/flight/flaps"               value="0.00"/>
    <solve-weight    idx="0" weight="170"/>
    <solve-weight    idx="1" weight="170"/>
    <solve-weight    idx="2" weight="40"/>
  </cruise>

  <cockpit x="1.27" y="0.26" z="0.30"/>

  <!-- Propeller pan -->
  <fuselage ax=" 3.909" ay=" 0.000" az="-0.177" bx=" 3.832" by=" 0.000" bz="-0.177" width="0.110" taper="0.00" midpoint="1"/>
  <fuselage ax=" 3.832" ay=" 0.000" az="-0.177" bx=" 3.707" by=" 0.000" bz="-0.177" width="0.211" taper="0.53" midpoint="1"/>
  <fuselage ax=" 3.707" ay=" 0.000" az="-0.177" bx=" 3.524" by=" 0.000" bz="-0.177" width="0.292" taper="0.72" midpoint="1"/>

  <!-- Fuselage -->
  <fuselage ax=" 3.454" ay=" 0.050" az="-0.177" bx=" 3.222" by=" 0.169" bz="-0.247" width="0.535" taper="0.60" midpoint="1"/>
  <fuselage ax=" 3.353" ay=" 0.169" az="-0.247" bx=" 2.192" by=" 0.143" bz="-0.318" width="0.835" taper="0.59" midpoint="1"/>
  <fuselage ax=" 2.192" ay=" 0.143" az="-0.318" bx=" 0.827" by=" 0.143" bz="-0.384" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.827" ay=" 0.143" az="-0.384" bx="-0.758" by=" 0.000" bz="-0.217" width="0.835" taper="0.80" midpoint="0"/>
  <fuselage ax=" 3.524" ay=" 0.000" az="-0.177" bx=" 3.311" by=" 0.000" bz="-0.234" width="0.504" taper="0.60" midpoint="1"/>
  <fuselage ax=" 3.454" ay="-0.050" az="-0.177" bx=" 3.222" by="-0.169" bz="-0.247" width="0.535" taper="0.60" midpoint="1"/>
  <fuselage ax=" 3.353" ay="-0.169" az="-0.247" bx=" 2.192" by="-0.143" bz="-0.318" width="0.835" taper="0.59" midpoint="1"/>
  <fuselage ax=" 2.192" ay="-0.143" az="-0.318" bx=" 0.827" by="-0.143" bz="-0.384" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.827" ay="-0.143" az="-0.384" bx="-0.758" by=" 0.000" bz="-0.217" width="0.835" taper="0.80" midpoint="0"/>
  <fuselage ax="-0.758" ay=" 0.000" az="-0.217" bx="-3.362" by=" 0.000" bz="-0.085" width="0.700" taper="0.20" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 2.076" ay=" 0.143" az="-0.333" bx=" 1.508" by=" 0.143" bz=" 0.138" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.759" ay=" 0.143" az=" 0.032" bx=" 1.024" by=" 0.143" bz=" 0.112" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.167" ay=" 0.143" az=" 0.124" bx=" 0.576" by=" 0.119" bz="-0.012" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.578" ay=" 0.119" az="-0.012" bx="-0.292" by=" 0.084" bz="-0.221" width="0.835" taper="0.80" midpoint="0"/>
  <fuselage ax=" 2.076" ay="-0.143" az="-0.333" bx=" 1.508" by="-0.143" bz=" 0.138" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.759" ay="-0.143" az=" 0.032" bx=" 1.024" by="-0.143" bz=" 0.112" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.167" ay="-0.143" az=" 0.124" bx=" 0.576" by="-0.119" bz="-0.012" width="0.835" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.578" ay="-0.119" az="-0.012" bx="-0.292" by="-0.084" bz="-0.221" width="0.835" taper="0.80" midpoint="0"/>

  <!-- Nose wheel -->
  <fuselage ax=" 3.096" ay=" 0.000" az="-1.158" bx=" 2.969" by=" 0.000" bz="-1.142" width="0.260" taper="0.20" midpoint="1"/>
  <fuselage ax=" 2.969" ay=" 0.000" az="-1.142" bx=" 2.567" by=" 0.000" bz="-1.142" width="0.260" taper="1.00" midpoint="1"/>
  <fuselage ax=" 2.567" ay=" 0.000" az="-1.142" bx=" 2.220" by=" 0.000" bz="-1.142" width="0.260" taper="0.30" midpoint="0"/>

  <!-- Left wheel -->
  <fuselage ax=" 1.311" ay=" 1.281" az="-1.158" bx=" 1.184" by=" 1.281" bz="-1.142" width="0.260" taper="0.20" midpoint="1"/>
  <fuselage ax=" 1.184" ay=" 1.281" az="-1.142" bx=" 0.782" by=" 1.281" bz="-1.142" width="0.260" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.782" ay=" 1.281" az="-1.142" bx=" 0.435" by=" 1.281" bz="-1.142" width="0.260" taper="0.30" midpoint="0"/>

  <!-- Right wheel -->
  <fuselage ax=" 1.311" ay="-1.281" az="-1.158" bx=" 1.184" by="-1.281" bz="-1.142" width="0.260" taper="0.20" midpoint="1"/>
  <fuselage ax=" 1.184" ay="-1.281" az="-1.142" bx=" 0.782" by="-1.281" bz="-1.142" width="0.260" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.782" ay="-1.281" az="-1.142" bx=" 0.435" by="-1.281" bz="-1.142" width="0.260" taper="0.30" midpoint="0"/>

  <wing x="1.075" y="0" z="-0.645"
        chord="1.804"
        length="1.106"
        taper="0.79"
        incidence="2"
        twist="0"
        sweep="3"
        dihedral="5"
        camber="0.01">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap0 start="0.73" end="1" lift="1.4" drag="1.5"/>
   </wing>

  <wing x="1.008" y="1.106" z="-0.553"
        append="1"
        chord="1.427"
        length="3.883"
        taper="0.6678"
        incidence="2"
        twist="-4"
        sweep="-4"
        dihedral="5"
        camber="0.01">
        <stall   aoa="20"  width="1"    peak="1.5"/>
        <flap0 start="0.00" end="0.58" lift="1.4" drag="1.5"/>
        <flap1 start="0.58" end="0.96" lift="1.2" drag="1.2"/>

        <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="-3.000" y="-0.130" z="0"
         chord="0.900"
         length="1.8"
         taper="0.7269"
         sweep="0">
         <stall   aoa="18" 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="-3.11253" y="0" z="0.076"
         chord="1.6"
         length="1.4"
         taper="0.375"
         sweep="20">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" 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" min="1" max="-1"/>
  </vstab>

  <!-- Engine       : Lycoming AEIO-360

       source       : http://en.wikipedia.org/wiki/Lycoming_O-360

       Power        : 180 hp at 2700 rpm
       weight       : 258 lb (117 kg)
       Displacement : 361 cu in (5916 cc)
       Compression  : 8.5:1
       propeller    : Hoffmann HO-V343
  -->
  <propeller x="3" y="0" z="-0.3"
             mass="258"
             moment="3.6"
             radius="0.88"
             cruise-speed="124"
             cruise-rpm="2100"
             cruise-alt="5000"
             cruise-power="150"
             takeoff-power="200"
             takeoff-rpm="2700">
             <actionpt x="3.676" y="0.0" z="-0.177" />
             <!-- Engine now correct for AEIO360-->
             <piston-engine eng-rpm="2700"
                            eng-power="200"
                            displacement="361"
                            compression="8.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" />
             </piston-engine>
  </propeller>

  <!-- Nose wheel -->
  <gear x="2.789" y="0" z="-1.397"
        compression="0.15"
        sfric="0.8"
        dfric="1"
        damp="0.8"
        stiction="1">
        <control-input control="STEER" axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="-.25" dst1=".25"/>
  </gear>

  <!-- Left wheel -->
  <gear x="1.030" y="1.281" z="-1.398"
        compression="0.1"
        sfric="0.8"
        dfric="1"
        damp="0.8"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-left"    split="true"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
  </gear>

  <!-- Right wheel -->
  <gear x="1.030" y="-1.281" z="-1.398"
        compression="0.1"
        sfric="0.8"
        dfric="1"
        damp="0.8"
        stiction="1">
        <control-input control="BRAKE" axis="/controls/gear/brake-right"   split="true"/>
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" split="true"/>
  </gear>

  <!-- Pilot, copilot, baggage -->
  <weight x="1.30" y="-0.265" z="-0.107" mass-prop="/sim/weight[0]/weight-lb"/>
  <weight x="1.30" y=" 0.265" z="-0.107" mass-prop="/sim/weight[1]/weight-lb"/>
  <weight x="0.55" y=" 0.000" z="-0.300" mass-prop="/sim/weight[2]/weight-lb"/>

  <!-- Fuel
     ==========
     The tanks are located in the wings.
     Each has a capacity of 75 litres
  -->
  <tank x="1" y=" 1.4" z="-0.5" capacity="99.31"/>
  <tank x="1" y="-1.4" z="-0.5" capacity="99.31"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.433 / 6     = 0.238
                 1.000 + 0.238 = 1.238
  -->
  <ballast x="3.241" y="0" z="-0.386" mass="224.5"/>

</airplane>
