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

<!-- Savoia-Marchetti S.65 : Emmanuel BARANGER (09/2022)
                    Update : Emmanuel BARANGER (07/2024)

     sources          : https://www.wikiwand.com/en/Savoia-Marchetti_S.65#

     wingspan         :    31 ft 16 in (  9,50 m   )
     length           :    35 ft 10 in ( 10,70 m   )
     height           :     9 ft 18 in (  2,80 m   )
     empty weight     :  3946 lb       ( 1790 kg   ) estimated
     engine           : 2 Isotta Fraschini Asso 750 W-18 liquid-cooled piston engines ( 1000 hp each )
     Maximum speed    :   346 kn       (  644 km/h ) estimated
-->
<airplane mass="3946" version="YASIM_VERSION_CURRENT" mtow-lbs="7800">

  <approach speed="60" aoa="2" 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"/>

    <control-setting axis="/controls/engines/engine[1]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"  value="1.0"/>
    <solve-weight    idx="0"                                     weight="180"/>
  </approach>

  <cruise speed="300" alt="5000" fuel="0.7">
    <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[1]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"  value="1"/>
    <solve-weight    idx="0"                                     weight="180"/>
  </cruise>

  <cockpit x="0.962" y="0" z="1.258" />

  <fuselage ax=" 4.219" ay=" 0.000" az=" 0.679" bx=" 3.666" by=" 0.000" bz=" 0.679" width="0.426" taper="0.00" midpoint="1"/>
  <fuselage ax=" 3.666" ay=" 0.000" az=" 0.679" bx=" 3.470" by=" 0.000" bz=" 0.679" width="0.609" taper="0.70" midpoint="1"/>
  <fuselage ax=" 3.470" ay=" 0.000" az=" 0.679" bx=" 3.013" by=" 0.000" bz=" 0.629" width="0.812" taper="0.76" midpoint="1"/>
  <fuselage ax=" 3.013" ay=" 0.000" az=" 0.629" bx=" 0.200" by=" 0.000" bz=" 0.629" width="0.812" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.200" ay=" 0.000" az=" 0.629" bx="-0.296" by=" 0.000" bz=" 0.667" width="0.812" taper="0.80" midpoint="0"/>
  <fuselage ax="-0.296" ay=" 0.000" az=" 0.667" bx="-0.628" by=" 0.000" bz=" 0.736" width="0.649" taper="0.70" midpoint="0"/>
  <fuselage ax="-0.622" ay=" 0.000" az=" 0.736" bx="-1.385" by=" 0.000" bz=" 0.736" width="0.459" taper="0.00" midpoint="0"/>

  <!-- Left float -->
  <fuselage ax=" 5.177" ay=" 1.188" az="-1.235" bx=" 2.876" by=" 1.188" bz="-1.388" width="0.782" taper="0.30" midpoint="1"/>
  <fuselage ax=" 2.876" ay=" 1.188" az="-1.388" bx=" 1.144" by=" 1.188" bz="-1.388" width="0.782" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.144" ay=" 1.188" az="-1.388" bx="-3.366" by=" 1.188" bz="-1.132" width="0.782" taper="0.30" midpoint="0"/>

  <!-- Right float -->
  <fuselage ax=" 5.177" ay="-1.188" az="-1.235" bx=" 2.876" by="-1.188" bz="-1.388" width="0.782" taper="0.30" midpoint="1"/>
  <fuselage ax=" 2.876" ay="-1.188" az="-1.388" bx=" 1.144" by="-1.188" bz="-1.388" width="0.782" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.144" ay="-1.188" az="-1.388" bx="-3.366" by="-1.188" bz="-1.132" width="0.782" taper="0.30" midpoint="0"/>

  <wing x="1.023" y="0" z="0.347"
        chord="2.160"
        length="4.792"
        taper="1"
        dihedral="2"
        camber="0.002">
        <stall   aoa="20" width="1" peak="1.5"/>
        <flap1 start="0.59" end="1" lift="1.2" 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>

  <hstab x="-4.570" y="0" z="0.393"
         chord="1.727"
         length="1.658"
         taper="1">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" 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="-4.552" y="0" z="-0.071"
         chord="1.808"
         length="1.652"
         taper="1">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" 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>

  <!-- Engines   source            : https://www.wikiwand.com/en/Isotta_Fraschini_Asso_750

                 name              : Isotta Fraschini Asso 750
                 type              : W-18 liquid/water-cooled
                 power cruise      : 1000 hp at 1900 rpm
                 weight            : 630 kg ( 1390 lb )
                 displacement      : 47.6 l ( 2900 cu in )
                 compression       : 5.6:1
  -->
  <propeller x="2.653" y="0" z="0.679"
             mass="1390"
             radius="1.11"
             moment="25"
             cruise-speed="300"
             cruise-alt="5000"
             cruise-power="900"
             cruise-rpm="1800"
             takeoff-power="1000"
             takeoff-rpm="1900"
             contra="1">
             <actionpt x="3.810" y="0" z="0.679"/>
             <piston-engine eng-power="1000"
                            eng-rpm="1900"
                            displacement="2900"
                            compression="5.6">
                            <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.184" y="0" z="0.736"
             mass="1390"
             radius="1.11"
             moment="25"
             cruise-speed="300"
             cruise-alt="5000"
             cruise-power="900"
             cruise-rpm="1800"
             takeoff-power="1000"
             takeoff-rpm="1900"
             contra="1">
             <actionpt x="-0.734" y="0" z="0.736"/>
             <piston-engine eng-power="1000"
                            eng-rpm="1900"
                            displacement="2900"
                            compression="5.6">
                            <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>

  <!-- Left noze 0 -->
  <gear x="4.355" y="1.188" z="-1.980"
        compression="1.0"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.3"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25"
        spring-factor-not-planing="0.2">
  </gear>

  <!-- Right noze 1 -->
  <gear x="4.355" y="-1.188" z="-1.980"
        compression="1.0"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.3"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25"
        spring-factor-not-planing="0.2">
  </gear>

  <!-- Left center 2 -->
  <gear x="1.154" y="1.188" z="-1.912"
        compression="1.4"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.1"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.1"
        speed-planing="35"
        spring-factor-not-planing="0.3">
  </gear>

  <!-- Right center 3 -->
  <gear x="1.154" y="-1.188" z="-1.912"
        compression="1.4"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.1"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.1"
        speed-planing="35"
        spring-factor-not-planing="0.3">
  </gear>

  <!-- Left rear 4 -->
  <gear x="-2.211" y="1.188" z="-1.502"
        compression="1.3"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.2"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.6"
        speed-planing="25"
        spring-factor-not-planing="0.9">
  </gear>

  <!-- Right rear 5 -->
  <gear x="-2.211" y="-1.188" z="-1.502"
        compression="1.3"
        spring="12"
        damp="8"
        sfric="0.4"
        dfric="0.2"
        on-water="1"
        on-solid="1"
        reduce-friction-by-extension="1.6"
        speed-planing="25"
        spring-factor-not-planing="0.9">
  </gear>

  <!-- Fuel  -->
  <tank x=" 1.05" y=" 1.75" z=" 0.4" capacity="450"/>
  <tank x=" 1.10" y=" 0.00" z=" 0.3" capacity="300"/>
  <tank x=" 1.05" y="-1.75" z=" 0.4" capacity="450"/>

  <weight x="0.95" y="0" z="0.8" mass-prop="/sim/weight[0]/weight-lb"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.160 / 6     = 0.360
                 1.023 + 0.360 = 1.383
  -->
  <ballast x="3.03" y="0" z="0.38" mass="601"/>

</airplane>
