<?xml version="1.0"?>

<!--
************************************************************************
YASim aerodynamic model for a Piper J3 Cub.
Started 2002-08-15 by David Megginson.

This aerodynamic model is based on three-views, unauthoritative
performance data, and wild guesses.  These sites provided particularly
useful information or were simply fun to visit:

Performance data:
  http://www.marss.com/cub.htm
Weight and balance:
  http://www.danford.net/balance.htm
Three-view:
  http://www.fiddlersgreen.net/aircraft/private/j3cub/j3cub_info/j3_info.htm
Useless but fun free paper model:
  http://www.fiddlersgreen.net/aircraft/private/j3cub/j3cub.htm
Useless but fun 1945 Piper Cub add from FLYING:
  http://www.fiddlersgreen.net/aircraft/private/j3cub/j3cub_info/piperad.jpg

The reference datum for measurements is the leading edge of the wing,
since it is what the weight-and-balance site above uses.
************************************************************************
-->

<!-- 
  680lb empty weight.
 -->
<!-- FIXME: this includes the engine; is that correct? -->
<airplane mass="680">

<!-- Approach configuration (actually touchdown, I think) -->
<approach speed="25" aoa="16">
  <control-setting axis="/controls/throttle[0]" value="0.3"/>
  <control-setting axis="/controls/mixture[0]" value="1.0"/>
</approach>

<!-- Cruise configuration -->
<cruise speed="67" alt="0">
  <control-setting axis="/controls/throttle[0]" value="1.0"/>
  <control-setting axis="/controls/mixture[0]" value="1.0"/>
</cruise>

<!-- pilot's eyepoint -->
<cockpit x="-0.23" y="0" z="-0.30"/>

<fuselage ax="1.37" ay="0" az="-0.71" bx="-4.81" by="0" bz="-0.65"
          width="0.71" taper="0.16" midpoint="0.17"/>

<!--
  I treat it as a perfectly rectangular wing for now.  Note that
  the dihedral is exaggerated to simulate hull-interference effects
  on a high-wing aircraft; once YASim models that properly, the
  angle should be reduced to something like 2 degrees.

  Note that the J3 Cub has no flaps.  With a stall speed of 25kt, who
  needs them?  From what I've read, the ailerons add lots of drag.
-->
<wing x="-0.80" y="0.42" z="0.0" taper="1.0"
      length="4.87" chord="1.60" sweep="0" dihedral="5" camber="0.1">
  <stall aoa="16" width="6" peak="1.5"/>
  <flap0 start=".31" end="0.85" lift="1.5" drag="1.4"/>
  <control-input axis="/controls/aileron" control="FLAP0" split="true"/>
  <control-input axis="/controls/aileron-trim" control="FLAP0" split="true"/>
  <control-output control="FLAP0" side="left"
		  prop="/surface-positions/left-aileron-pos-norm"/>
  <control-output control="FLAP0" side="right"
		  prop="/surface-positions/right-aileron-pos-norm"/>
</wing>

<!-- FIXME: taper (used the C172 value) -->
<hstab x="-4.87" y="0.05" z="-0.42" taper="0.5" effectiveness="1.24"
       length="1.49" chord="1.13" sweep="0">
  <stall aoa="16" width="4" peak="1.5"/>
  <flap0 start="0" end="1" lift="1.7" drag="1.2"/>
  <control-input axis="/controls/elevator" control="FLAP0"/>
  <control-input axis="/controls/elevator-trim" control="FLAP0"/>
  <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
</hstab>

<!-- FIXME: taper (used the C172 value) -->
<!-- rudder has to be able to counteract aileron drag -->
<vstab x="-4.87" y="0" z="-0.65" taper="0.38" effectiveness="1.24"
       length="1.31" chord="1.37" sweep="0">
  <stall aoa="16" width="4" peak="1.5"/>
  <flap0 start="0" end="1" lift="1.5" drag="1.2" effectiveness="1.5"/>
  <control-input axis="/controls/rudder" control="FLAP0" invert="true"/>
  <control-input axis="/controls/rudder-trim" control="FLAP0" invert="true"/>
  <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm"
		  min="1" max="-1"/>
</vstab>

<!-- FIXME: engine mass (just a guess; it's a small engine) -->
<!-- Assume 75% power at 8000ft -->
<propeller radius="0.95"
	   cruise-speed="60" cruise-rpm="2300"
           cruise-alt="8000" cruise-power="48"
           takeoff-power="55" takeoff-rpm="2300"
           eng-power="65" eng-rpm="2700"
           x="0.71" y="0" z="-0.65" mass="150" moment="8">
  <actionpt x="1.31" y="0" z="-0.65"/>
  <control-input axis="/controls/throttle[0]" control="THROTTLE"/>
  <control-input axis="/controls/starter[0]" control="STARTER"/>
  <control-input axis="/controls/magnetos[0]" control="MAGNETOS"/>
  <control-input axis="/controls/mixture[0]" control="MIXTURE"/>
</propeller>

<!-- FIXME: the J3 Cub may not actually have a tail-wheel lock -->
<gear x="-5.17" y="0" z="-0.71" compression="0.2">
  <control-input axis="/controls/tailwheel-castering" control="CASTERING"/>
</gear>

<gear x="0" y="0.95" z="-1.96" compression=".1"> <!-- left main -->
  <control-input axis="/controls/brakes[0]" control="BRAKE" split="true"/>
  <control-input axis="/controls/parking-brake" control="BRAKE" split="true"/>
</gear>

<gear x="0" y="-0.95" z="-1.96" compression=".1"> <!-- right main -->
  <control-input axis="/controls/brakes[1]" control="BRAKE" split="true"/>
  <control-input axis="/controls/parking-brake" control="BRAKE" split="true"/>
</gear>

<!-- There's just one 12-gallon tank, right behind the engine (!!!) -->
<tank x="-0.45" y="0" z="-0.89" capacity="72"/> 

<!--
  Note the tandem seating; the x values (arms) come from the
  weight-and-balance page cited at the start.
-->

<!-- pilot -->
<weight x="-0.23" y="0" z="-0.70" mass-prop="/yasim/j3cub/pilot-lb"/>

<!-- passenger -->
<weight x="-0.91" y="0" z="-0.70" mass-prop="/yasim/j3cub/passenger-lb"/>

</airplane>
