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

<!-- Piaggio-Pegna-Pc-7 : Emmanuel BARANGER    2010
                Updated : Emmanuel BARANGER 11/2025

     sources            : https://www.wikiwand.com/en/articles/Piaggio_P.7

     wingspan           :  6.7600 m  (    22 ft 2.00 in )
     length             :  8.8583 m  (    29 ft 0.75 in )
     height             :   2.451 m  (     8 ft 0.50 in )
     empty weight       :    1403 kg (  3093 lb         )
     Gross weight       :    1682 kg (  3709 lb         )
     max speed          :   600 km/h (   324 kt         )
     engine             : 1 Isotta-Fraschini V-12 liquid-cooled piston engine (850 hp)
-->
<airplane mass="3093" version="YASIM_VERSION_CURRENT" mtow-lbs="3709">

  <approach speed="70" aoa="8" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.0"/>
  </approach>

  <cruise speed="300" alt="5000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="1.0"/>
  </cruise>

  <cockpit x="-1.70136" y="0" z="0.53148"/>

  <!-- bol -->
  <fuselage ax=" 4.423" ay=" 0.000" az=" 0.172" bx=" 4.179" by=" 0.000" bz=" 0.172" width="0.194" taper="0.10" midpoint="1"/>
  <fuselage ax=" 4.179" ay=" 0.000" az=" 0.172" bx=" 3.879" by=" 0.000" bz=" 0.172" width="0.339" taper="0.57" midpoint="1"/>

  <!-- Fuselage -->
  <fuselage ax=" 3.879" ay=" 0.000" az=" 0.172" bx=" 3.300" by=" 0.000" bz=" 0.123" width="0.660" taper="0.52" midpoint="1"/>
  <fuselage ax=" 3.300" ay=" 0.000" az=" 0.123" bx=" 2.406" by=" 0.000" bz=" 0.053" width="0.880" taper="0.75" midpoint="1"/>
  <fuselage ax=" 2.406" ay=" 0.000" az=" 0.053" bx="-0.900" by=" 0.000" bz=" 0.072" width="0.880" taper="1.00" midpoint="1"/>
  <fuselage ax="-0.900" ay=" 0.000" az=" 0.072" bx="-3.281" by=" 0.000" bz=" 0.072" width="0.880" taper="0.30" midpoint="0"/>
  <fuselage ax="-3.281" ay=" 0.000" az=" 0.072" bx="-4.400" by=" 0.000" bz=" 0.072" width="0.264" taper="0.20" midpoint="0"/>
  <fuselage ax="-0.900" ay=" 0.000" az=" 0.072" bx="-3.281" by=" 0.000" bz=" 0.403" width="0.880" taper="0.30" midpoint="0"/>
  <fuselage ax="-3.281" ay=" 0.000" az=" 0.222" bx="-4.400" by=" 0.000" bz=" 0.222" width="0.264" taper="0.20" midpoint="0"/>
  <fuselage ax="-3.281" ay=" 0.000" az=" 0.402" bx="-4.400" by=" 0.000" bz=" 0.402" width="0.264" taper="0.20" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax=" 1.068" ay=" 0.000" az=" 0.486" bx=" 0.765" by=" 0.000" bz=" 0.486" width="0.193" taper="0.10" midpoint="1"/>
  <fuselage ax=" 0.765" ay=" 0.000" az=" 0.486" bx="-1.525" by=" 0.000" bz=" 0.486" width="0.193" taper="1.00" midpoint="1"/>
  <fuselage ax="-1.225" ay=" 0.000" az=" 0.486" bx="-1.525" by=" 0.000" bz=" 0.486" width="0.339" taper="0.57" midpoint="1"/>

  <wing x="0.015" y="0" z="0.395"
        chord  = "1.858"
        length = "3.386"
        taper  = "0.5"
        sweep  = "-5"
        camber = "0.007">
        <stall    aoa="20" width="4"    peak="1.5"/>
        <flap1  start="0.51" end="1.00" lift="1.1" drag="1.2"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron"                  split="true"/>
        <control-input  control="FLAP1" axis="/controls/flight/aileron-trim"             split="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>

  <!-- Left Foil
  <mstab x="1.502" y="0.565" z="-1.355"
         chord    = "0.372"
         length   = "1.05"
         taper    = "0.5"
         sweep    = "10"
         dihedral = "20"
         camber   = "0.007">
         <stall aoa="20" width="4" peak="1.5"/>
  </mstab>
  -->
  <!-- Foil rear
  <mstab x="-2.959" y="0.000" z="-0.666"
         chord  = "0.144"
         length = "0.340"
         taper  = "1"
         camber = "0.007">
         <stall aoa="20" width="4" peak="1.5"/>
  </mstab>
  -->
  <hstab x="-3.491" y="0" z="0.511"
         chord  = "1.387"
         length = "1.3"
         taper  = "0.5"
         sweep  = "18">
         <stall   aoa="18" width="4" 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.457" y="0" z="0.386"
         chord  = "1.930"
         length = "1.1"
         sweep  = "25"
         taper  = "0.4">
         <stall    aoa="14" width="3" peak="1.5"/>
         <flap0  start="0"    end="1" lift="1.6" 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>

<!--  Source           : http://en.wikipedia.org/wiki/Isotta_Fraschini_Asso_XI
                         (not good engine but I have no found another yet)

          Engine       : Isotta Fraschini Asso XI
          Type         : 12-cylinder supercharged water-cooled 60° V-12 piston aircraft engine
          Power        : 836 hp at 2250 rpm at 4000 m (13120 ft); take off power 880 hp at 2250 rpm
          weight       : 594 kg ( 1310 lb )
          Displacement : 32.65 L (1992 in3)
          Compression  : 6.4:1
          Gear ratio   : 0.743 or 0.512
-->
  <propeller x="1.427" y="0" z="0"
             radius        = "1.1825"
             mass          = "1310"
             moment        = "-50"
             cruise-speed  = "300"
             cruise-alt    = "5000"
             cruise-power  = "836"
             cruise-rpm    = "2250"
             takeoff-power = "880"
             takeoff-rpm   = "2250"
             gear-ratio    = "0.743">
             <actionpt x="3.97626" y="0" z="0.17276"/>
             <piston-engine eng-rpm      = "3000"
                            eng-power    = "890"
                            displacement = "1992"
                            compression  = "6.4">
                            <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>

  <!-- Fuselage -->
  <!-- 0 - Avant -->
  <gear x="3.200" y="0.000" z="-0.220"
        compression                  = "1.2"
        spring                       = "15"
        damp                         = "8"
        sfric                        = "0.4"
        dfric                        = "0.3"
        on-water                     = "1"
        on-solid                     = "0"
        ignored-by-solver            = "1"
        reduce-friction-by-extension = "1"
        speed-planing                = "5"
        spring-factor-not-planing    = "0.2">
  </gear>

  <!-- 1 - Centrale -->
  <gear x="0.000" y="0.000" z="-0.270"
        compression                  = "1.4"
        spring                       = "6"
        damp                         = "8"
        sfric                        = "0.4"
        dfric                        = "0.1"
        on-water                     = "1"
        on-solid                     = "0"
        ignored-by-solver            = "1"
        reduce-friction-by-extension = "1"
        speed-planing                = "5"
        spring-factor-not-planing    = "0.3">
  </gear>

  <!-- 2 - Arriere -->
  <gear x="-2.400" y="0.000" z="-0.020"
        compression                  = "1.1"
        spring                       = "3"
        damp                         = "8"
        sfric                        = "0.4"
        dfric                        = "0.2"
        on-water                     = "1"
        on-solid                     = "0"
        ignored-by-solver            = "1"
        reduce-friction-by-extension = "1"
        speed-planing                = "5"
        spring-factor-not-planing    = "0.9">
  </gear>

  <!-- 3 - Left tip wing -->
  <gear x="0.300" y="3.300" z="0.000"
        compression                  = "0.3"
        spring                       = "0.9"
        damp                         = "10"
        sfric                        = "0.8"
        dfric                        = "0.7"
        on-water                     = "1"
        on-solid                     = "0"
        ignored-by-solver            = "1"
        reduce-friction-by-extension = "1.25"
        speed-planing                = "15"
        spring-factor-not-planing    = "0.7">
  </gear>

  <!-- 4 - Right tip wing -->
  <gear x="0.300" y="-3.300" z="0.000"
        compression                  = "0.3"
        spring                       = "0.9"
        damp                         = "10"
        sfric                        = "0.8"
        dfric                        = "0.7"
        on-water                     = "1"
        on-solid                     = "0"
        reduce-friction-by-extension = "1.25"
        speed-planing                = "15"
        spring-factor-not-planing    = "0.7">
    </gear>

  <!-- 5 - Gouvernail -->
  <gear x="-3.930" y="0.000" z="-0.020"
        compression       = "1"
        spring            = "8"
        sfric             = "0.9"
        dfric             = "0.8"
        on-water          = "0"
        on-solid          = "0"
        ignored-by-solver = "1">
        <control-input axis="/controls/gear/water-rudder-pos" control="STEER" invert ="true" square="true"/>
  </gear>

  <!-- 6 -Foil left -->
  <gear x=" 1.502" y=" 1.042" z="-1.155"
        compression       = "0.2"
        on-water          = "0"
        on-solid          = "1"
        ignored-by-solver = "1">
  </gear>

  <!-- 7 -Foil right -->
  <gear x=" 1.502" y="-1.042" z="-1.155"
        compression       = "0.2"
        on-water          = "0"
        on-solid          = "1"
        ignored-by-solver = "1">
  </gear>

  <!-- 8 -Foil rear -->
  <gear x="-2.958" y=" 0.000" z="-0.666"
        compression       = "0.2"
        on-water          = "0"
        on-solid          = "1"
        ignored-by-solver = "1">
  </gear>

  <!-- Fuel  -->
  <tank x=" 1.3" y="0" z="-0.2" capacity="349" />
  <tank x="-0.2" y="0" z="-0.2" capacity="349" />
  <tank x="-1.7" y="0" z="-0.2" capacity="259" />

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.858 / 6     = 0.309
                 0.015 + 0.309 = 0.324
  -->
  <ballast x="0.000" y="0.000" z="-0.300" mass="642"/>

</airplane>
