<?xml version="1.0" encoding="UTF-8"?>

<!-- A 24 Viking
     3D model by 
     Emmanuel BARANGER
     and
     Pierre GEOFFROY
-->

<airplane mass="969">

<!-- Approach configuration -->
<approach speed="40" aoa="11" 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/flight/flaps" value="1.0"/>
  <control-setting axis="/sim/weight[0]/weight-lb" value ="180"/>
  <control-setting axis="/sim/weight[1]/weight-lb" value ="180"/>
</approach>

<!-- Cruise configuration -->
<cruise speed="89" alt="6000" 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"/>
  <control-setting axis="/controls/flight/flaps" value="0.0"/>
  <control-setting axis="/sim/weight[0]/weight-lb" value ="180"/>
  <control-setting axis="/sim/weight[1]/weight-lb" value ="180"/>
</cruise>

<cockpit x="1.537" y="-0.221" z="-0.010"/>

<fuselage ax="3.622" ay="0" az="-0.549" 
          bx="-3.304" by="0" bz="-0.447"
          width="1.287" 
          taper="0.2" 
          midpoint="0.5"/>

<wing x="0.796" y="0.0" z="0.555" 
      taper="1" 
      incidence="0"
      length="5.276" 
      chord="1.512" 
      sweep="0" 
      dihedral="0" 
      twist="0" 
      camber="0.1">
  <stall aoa="25" width="3.0" peak="1.5"/>
  <flap0 start="0" end="0.557" lift="1.2" drag="1.25"/>
  <flap1 start="0.558" end="0.95" lift="1.2" drag="1.1"/>
  <control-input axis="/controls/flight/flaps" control="FLAP0"/>
  <control-speed control="FLAP0" transition-time="2"/>
  <control-input axis="/controls/flight/aileron" control="FLAP1" split="true"/>
  <control-input axis="/controls/flight/aileron-trim" control="FLAP1" split="true"/>
  <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
  <control-output control="FLAP1" side="left" prop="/surface-positions/left-aileron-pos-norm"/>
  <control-output control="FLAP1" side="right" prop="/surface-positions/right-aileron-pos-norm"/>
</wing>

<hstab x="-3.200" y="0.0" z="1.123" 
       taper="1" 
       incidence="0" 
       length="1.807" 
       chord="0.819" 
       sweep="0">
<!--   effectiveness="3.0" -->
  <stall aoa="25" width="4" peak="1.5"/>
  <flap0 start="0" end="1" lift="1.25" drag="1.1" effectiveness="1.25"/>
  <control-input axis="/controls/flight/elevator" control="FLAP0"/>
  <control-input axis="/controls/flight/elevator-trim" control="FLAP0"/>
  <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
</hstab>

<vstab x="-2.484" y="0" z="-0.337" 
       taper="0.5" 
       length="1.380" 
       chord="1.170">
<!--   effectiveness="3.0" -->
  <stall aoa="14" width="3" peak="1.5"/>
  <flap0 start="0" end="1" lift="1.75" drag="1.35"/>
  <control-input axis="/controls/flight/rudder" control="FLAP0" invert="true"/>
  <control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true"/>
  <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm" min="1" max="-1"/>
</vstab>

  <!-- engine:    ROTAX 912 S ULS
       propeller: Albastar / Wezel Flugzeugtechnik AS 180
  =================================================================================
  TO-/MC- engine power(kW): 73,5/69
                      RPM : 5800/5500
  propeller max RPM: 2387
  diameter: 1,80 m
  MTOM: 450 kg -->
  <propeller x="2.162" y="0.0" z="0.689" 
             radius="0.90"
	     cruise-speed="89" 
	     cruise-rpm="2263"
	     cruise-alt="6000" 
	     cruise-power="95"
	     takeoff-power="100" 
	     takeoff-rpm="2387"
	     mass="145" 
	     moment="3.24"  
	     gear-ratio="0.412" >
    <piston-engine eng-rpm="5800" 
                   eng-power="100"
                   displacement="82.6" 
	             compression="10.5"/>
    <actionpt x="2.636" y="0.0" z="-0.037" />
    <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" />
  </propeller>

<!-- Wheels -->
<gear x="1.572" y="0.812" z="-1.615" 
      compression="0.2" 
      retract-time="2"
      on-water="0" 
      on-solid="1" 
      spring="1" 
      damp="2">
      <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
      <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
      <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
      <control-speed control="EXTEND" transition-time="2"/>
      <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
</gear>

<gear x="1.572" y="-0.812" z="-1.615" 
      compression="0.2" 
      retract-time="2" 
      on-water="0" 
      on-solid="1"
      spring="1" 
      damp="2">
      <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
      <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
      <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
      <control-speed control="EXTEND" transition-time="2"/>
      <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
</gear>

<gear x="-3.190" y="0.0" z="-0.730" 
      compression="0.02" 
      retract-time="2" 
      on-water="0" 
      on-solid="1"
      spring="1" 
      damp="2">
      <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
      <control-speed control="EXTEND" transition-time="2"/>
      <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
</gear>

  
<!-- Main fuselage -->
<!-- 3 - Noze -->
<gear x="3.088" y="0" z="-1.128" 
      ignored-by-solver="1"
      compression="0.6"  
      spring="15" 
      damp="8" 
      sfric="0.4" 
      dfric="0.3" 
      on-water="1" 
      on-solid="0" 
      reduce-friction-by-extension="1.0"
      speed-planing="10"
      spring-factor-not-planing="0.2">
</gear>

<!-- 4 - Center -->
<gear x="0.878" y="0" z="-1.231"
      ignored-by-solver="1"
      compression="1.2"
      spring="6"
      damp="8"
      sfric="0.4" 
      dfric="0.1" 
      on-water="1" 
      on-solid="0" 
      reduce-friction-by-extension="1.1"
      speed-planing="12"
      spring-factor-not-planing="0.3">
</gear>

<!-- 5 - Tail -->
<gear x="-2.000" y="0" z="-0.824"
      ignored-by-solver="1"
      compression="0.3"
      spring="3"
      damp="8"
      sfric="0.4" 
      dfric="0.2" 
      on-water="1"
      on-solid="0"
      reduce-friction-by-extension="1.6"
      speed-planing="0"
      spring-factor-not-planing="0.9">
</gear>

<!-- 6 - wing floats Left -->
<gear x="1.308" y="4.400" z="-0.523" 
      ignored-by-solver="1"
      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>

<!-- 7 - wing floats right -->
<gear x="1.308" y="-4.400" z="-0.523" 
      ignored-by-solver="1"
      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>

<!-- 8 - Center left-->
<gear x="1.308" y="3" z="-1.231"
      ignored-by-solver="1"
      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>

<!-- 9 - Center right -->
<gear x="1.308" y="-2" z="-1.231"
      ignored-by-solver="1"
      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>

<!-- 10 - Gouvernail -->
<gear x="-0.749" y="0" z="-0.959"
      compression="1.8"
      spring="8" 
      sfric="0.9" 
      dfric="0.8" 
      ignored-by-solver="1"
      on-water="1"
      on-solid="0"
      reduce-friction-by-extension="0.9"
      speed-planing="25" 
      spring-factor-not-planing="3">
      <control-input axis="/controls/gear/water-rudder-pos" control="STEER" invert ="true" square="true"/>
</gear>


<tank x="0.456" y="0" z="-0.310" capacity="56" />

<!-- pilot -->
  <weight x="0.8" y="0.3" z="-0.1" mass-prop="/sim/weight[0]/weight-lb"/>

<!-- copilot -->
  <weight x="0.8" y="-0.3" z="-0.1" mass-prop="/sim/weight[1]/weight-lb"/>

<!-- baggage -->
  <weight x="0.4" y="0" z="0.2" mass-prop="/sim/weight[2]/weight-lb"/>
	
<!-- Mass distribution -->
<!-- CG Middle of chord : x=0.796 y=0 z=0.555 -->
<!--         updated to : x=1.1076 y=0 z=0.548 -->
<ballast x="0.69" y="0.0" z="1.65" mass="50"/>

</airplane>
