<!--
YASIM flight model for the Avanti II
July 2007

SPECS:
Height: 4.72m
Length: 17.63
Wing span: 17.67
Max level spd: 272 kts
Max TO weight: 16,950 lbs

Max cruise spd (15000 lbs)
8000 ft : 272 kt
16,000  : 283 kt
25,000  : 274 kt

Unstick spd - T/O flap : 105 IAS
Approach spd max weight: 117 kt

Stall spd - max TO weight:
Wheels/Flaps up : 101 kt
Wheels down TO flap: 90 kt
Wheels/Flaps down Max Landing weight: 84 kt
-->

<airplane mass="7700">

    <approach speed="100" aoa="7" >
        <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
        <control-setting axis="/controls/engines/engine[1]/throttle" value="0.2"/>
        <control-setting axis="/controls/engines/engine[0]/condition" value="1.0"/>
        <control-setting axis="/controls/engines/engine[1]/condition" value="1.0"/>
        <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.3"/>
        <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.3"/>
        <control-setting axis="/controls/flight/flaps" value="1.0"/>
        <control-setting axis="/controls/gear/gear-down" value="1"/>
        <solve-weight idx="0" weight="300"/>
        <solve-weight idx="1" weight="1500"/>
    </approach>

    <cruise speed="380" alt="41000" fuel="0.8"> 
        <control-setting axis="/controls/flight/elevator-trim" value="0.0"/>
        <control-setting axis="/controls/engines/engine[0]/throttle" value="0.8"/>
        <control-setting axis="/controls/engines/engine[1]/throttle" value="0.8"/>
        <control-setting axis="/controls/engines/engine[0]/condition" value="1.0"/>
        <control-setting axis="/controls/engines/engine[1]/condition" value="1.0"/>
        <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.9"/>
        <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.9"/>
        <control-setting axis="/controls/flight/flaps" value="0.0"/>
        <control-setting axis="/controls/gear/gear-down" value="0"/>
        <solve-weight idx="0" weight="300"/>
        <solve-weight idx="1" weight="1500"/>
    </cruise>

    <cockpit x="3.6" y="0.3" z="0.33"/>

<!-- fuselage -->
    <fuselage ax="6.57"  ay="0" az="-1.18" bx="-5.8" by="0" bz="-0.5"
        width="2.0" taper="0" midpoint="0.5" idrag="0.1"/>
<!-- engines -->
    <fuselage ax="0.2"  ay="1.05" az="-0.15" bx="-4.0" by="-1.05" bz="-0.15"
        width="0.9" taper="0.3" idrag="0.4"/>
    <fuselage ax="0.2"  ay="-1.05" az="-0.15" bx="-4.0" by="1.05" bz="-0.15"
        width="0.9" taper="0.3" idrag="0.4"/>

<!-- wings. Some values are unknow, so I set them to a "standard" value. -->

<!-- Main wings -->
    <wing x="-1.7" y="1.0" z="-0.37" length="6.0" chord="1.6"
        sweep="1.0" dihedral="2" taper="0.375"  camber="0.2"
        incidence="1.0" twist="-1.0" >
        <stall aoa="18" width="6" peak="1.5"/>
        <flap0 start="0.05" end=".65" lift="1.4" drag="1.5"/>
        <flap1 start=".65" end=".95" lift="1.2" drag="1.2"/>
        <control-input axis="/controls/flight/flaps" control="FLAP0"/>
        <control-input axis="/controls/flight/aileron" control="FLAP1"/>
        <control-speed control="FLAP0" transition-time="64.0"/>
        <control-speed control="FLAP1" transition-time="0.2"/>
        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
        <control-input axis="/controls/flight/aileron" control="FLAP1" split="true"/>
        <control-input axis="/controls/flight/aileron-trim" control="FLAP1"
        split="true"/>
        <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>

<!-- forward wings (canards) -->
    <mstab x="5.7" y="0.5" z="-1.1" length="1.3" chord="0.7"
        sweep="3.0" dihedral="-3" taper="0.8"  camber="0.15" incidence="2.0" twist="-0.0">
        <stall aoa="16" width="6" peak="1.5" />
        <flap0 start="0.1" end="0.98" lift="1.8" drag="1.6"/>
        <control-input axis="/controls/flight/flaps" control="FLAP0"/>
        <control-speed control="FLAP0" transition-time="64.0"/>
        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
        split="true"/>
    </mstab>

<!-- hstab -->
    <hstab x="-6.2" y="0.0" z="1.7" length="2.3" chord="1.2"
        sweep="30" dihedral="-3" taper="0.8" incidence="0" camber="0.0">
        <stall aoa="11" width="4" peak="1.5"/>
        <flap0 start="0" end="1" lift="1.8" drag="1.2"/>
        <control-input axis="/controls/flight/elevator" control="FLAP0"/>
        <control-input axis="/controls/flight/elevator-trim" control="FLAP0"/>
        <control-speed control="FLAP0" transition-time="0.2"/>
        <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
    </hstab>

    <vstab x="-4.8" y="0.00" z="-0.2" length="2.5" chord="2.4"
        sweep="45" taper="0.85">
        <stall aoa="16" width="4" peak="1.5"/>
        <flap0 start="0" end="1" lift="1.3" drag="1.1"/>
        <control-input axis="/controls/flight/rudder" control="FLAP0" invert="true"/>
        <control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true"/>
        <control-speed control="FLAP0" transition-time="0.15"/>
        <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm"/>
    </vstab>

<!-- bidules -->

    <vstab x="-4.5" y="0.3" z="-0.7" length="0.5" chord="2.5"
        sweep="80" taper="0.2" dihedral="-45">
        <stall aoa="11" width="4" peak="1.5"/>
    </vstab>

    <vstab x="-4.5" y="-0.3" z="-0.7" length="0.5" chord="2.5"
        sweep="80" taper="0.2" dihedral="225">
        <stall aoa="11" width="4" peak="1.5"/>
    </vstab>

<!--
2848 lbs in the wings (Jet A - 6.84 ppg )
-->
    <tank x="-1.7" y="2.5" z="-0.2" capacity="1424" jet="true"/>
    <tank x="-1.7" y="-2.5" z="-0.2" capacity="1424" jet="true"/>

    <gear x="5.02" y="0.00" z="-1.99" compression=".3" retract-time="5" spring="0.8" damp="1.0">
        <control-input axis="/controls/flight/rudder" control="STEER" square="true"
        src0="-1.0" src1="1.0"
        dst0="-0.8" dst1="0.8"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        <control-speed control="EXTEND" transition-time="5"/>
        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
    </gear>

    <gear x="-0.9" y="1.4" z="-1.99" compression=".4" retract-time="5" spring="1.5" damp="1.8" sfric="1.0" dfric="1.0">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        <control-speed control="EXTEND" transition-time="5.1"/>
        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
    </gear>

    <gear x="-0.9" y="-1.4" z="-1.99" compression=".4" retract-time="5" spring="1.5" damp="1.8" sfric="1.0" dfric="1.0">
        <control-input axis="/controls/gear/brake-right" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        <control-speed control="EXTEND" transition-time="5.1"/>
        <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
    </gear>

<!--
Engines:
2 PT6A-66B
850 shp
Prop diam: 2.159 m 
-->

    <propeller x="-1.8" y="1.1" z="-0.2"
        mass="400" moment="35" radius="1.08"
        cruise-speed="380" cruise-rpm="2000"
        cruise-power="840" cruise-alt="35000"
        min-rpm="550" max-rpm="2000"
        fine-stop="0.25" coarse-stop="3.0"
        gear-ratio="0.66">
        <turbine-engine
            eng-power="850" eng-rpm="3000" alt="31000"
            flat-rating="850"
            min-n2="70" max-n2="100"
            bsfc="0.35"/>
        <actionpt x="-3.3" y="1.1" z="-0.2"/>
        <control-input axis="/controls/engines/engine[0]/throttle"
        control="THROTTLE" src0="0.3" src1="1.0" dst0="0.0" dst1="1.0"/>
        <control-input axis="/controls/engines/engine[0]/condition"
        control="CONDLEVER"/>
        <control-input axis="/controls/engines/engine[0]/starter"
        control="STARTER"/>
        <control-input axis="/controls/engines/engine[0]/propeller-pitch"
        control="ADVANCE" src0="0.15" src1="1.0" dst0="-0.1" dst1="1.0"/>
        <control-input axis="/controls/engines/engine[0]/propeller-pitch"
        control="PROPFEATHER"  src0="0.0" src1="0.15" dst0="1.0" dst1="0.0"/>
    </propeller>

    <propeller x="-1.8" y="-1.1" z="-0.2"
        mass="400" moment="-35" radius="1.08"
        cruise-speed="380" cruise-rpm="2000"
        cruise-power="840" cruise-alt="35000"
        min-rpm="550" max-rpm="2000"
        fine-stop="0.25" coarse-stop="3.0"
        gear-ratio="0.66">
        <turbine-engine
            eng-power="850" eng-rpm="3000" alt="31000"
            flat-rating="850"
            min-n2="70" max-n2="100"
            bsfc="0.35"/>
        <actionpt x="-3.3" y="-1.1" z="-0.2"/>
        <control-input axis="/controls/engines/engine[1]/throttle"
        control="THROTTLE" src0="0.3" src1="1.0" dst0="0.0" dst1="1.0"/>
        <control-input axis="/controls/engines/engine[1]/condition"
        control="CONDLEVER"/>
        <control-input axis="/controls/engines/engine[1]/starter"
        control="STARTER"/>
        <control-input axis="/controls/engines/engine[1]/propeller-pitch"
        control="ADVANCE" src0="0.15" src1="1.0" dst0="-0.1" dst1="1.0"/>
        <control-input axis="/controls/engines/engine[1]/propeller-pitch"
        control="PROPFEATHER"  src0="0.0" src1="0.15" dst0="1.0" dst1="0.0"/>
    </propeller>


    <ballast x="1.4" y="-2.65" z="-0.5" mass="1200"/>
    <ballast x="1.4" y="2.65" z="-0.5" mass="1200"/>

<!-- Cockpit mass and Avionics -->
    <ballast x="4.2" y="0.0" z="0.0" mass="500"/>

<!-- NoseGear assembly -->
    <ballast x="5.0" y="0.0" z="-1" mass="500"/>

<!-- MainGear assembly -->
    <ballast x="-0.9" y="0.4" z="-1.0" mass="600"/>
    <ballast x="-0.9" y="-0.4" z="-1.0" mass="600"/>

<!-- CG -->
<ballast x="-3.5" y="0.0" z="-0.8" mass="2000"/>

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

</airplane>
