# F-22 forest flight: dynamics and graphics, v14

This is an interactive, uncalibrated approximation, not a flight-training device or an engineering F-22 model. Aircraft coordinates, velocities, forces and mass use SI units. The 3D visual model has full-size aircraft dimensions. This is not a small RC aircraft mass model.

## Rigid body and controls

- Three translational and three rotational degrees of freedom. Gravity is 9.80665 m/s².
- Integrate world velocity and position from forces; integrate body angular rates from moments including the gyroscopic term ω × (Iω). Quaternion attitude is normalized every integration step.
- Foreground elapsed time is divided into steps no longer than 1/120 s. Environment and camera update once per rendered frame. Visibility changes reset the clock; paused flight and river observation freeze the aircraft state.
- Acro inputs request body angular rates. A limited PI rate controller drives bounded, slew-limited aerodynamic controls. There is no bank-angle, pitch-angle or horizon-leveling feedback. Neutral input is not an instantaneous attitude lock; authority depends on airspeed and inertia.
- Pitch/yaw commands are scheduled by estimated available lift and a 9 G rate budget. Incidence protection bounds rate requests relative to airflow (24° pitch incidence / 18° sideslip, assumed simulator values). Bank and pitch attitude remain unrestricted; protection may command incidence recovery with a neutral stick. Neither velocity nor attitude is snapped to a desired direction and there is no artificial minimum speed.
- Tail control pressure uses forward air velocity. Forward-flow wing loads fade out in separated or reversed flow; cross-flow drag at the tail supplies passive restoring/damping moments, and an empirical 0.38 additional reverse-flow drag coefficient prevents treating tail-first motion as efficient cruise. Controller integrals bleed off when forward-flow authority is lost. These coefficients and protections are qualitative assumptions, not F-22 data.
- Chase, side and front cameras follow world velocity, independently of nose direction. Terrain is fixed in world coordinates and generated symmetrically upstream/downstream. Ground speed measures horizontal distance per real elapsed second; airspeed includes vertical motion relative to the wind. Water flow has its own independent river simulation.
- The wing, horizontal tail, vertical tail and body produce aerodynamic forces and moments. Thrust follows a first-order engine response. Standard tropospheric density varies with altitude. The wind setting is a constant world-X wind; airspeed and groundspeed differ.
- Parameters are applied on reset. Initial total mass 24,000 kg includes 4,300 kg fuel. CG starts at 30% mean aerodynamic chord. Fuel burns at an illustrative rate and is assumed at 35% MAC, changing total mass and CG.
- Inertia is estimated from radii of gyration: pitch 9.2 m² × mass, yaw 10.4 m² × mass, roll 2.5 m² × mass. These are assumptions, not published F-22 inertia data.

## Wing flow

An original implementation solves a 24-strip, one-chordwise-row horseshoe vortex system. Bound vortices lie at quarter chord, collocation points at three-quarter chord, and spanwise endpoints use cosine spacing. Trailing legs run 1,000 spans downstream. Solve the no-penetration boundary system using a pivoted matrix inverse computed once. Boundary conditions include incidence, body rates, and effective normal tilts from the shared slew-limited surface angles. Flaperons act over |x| = 1.966–4.558 m and ailerons over |x| = 4.558–5.965 m. Assumed equivalent incidence is 0.30 times flap deflection or 0.24 times aileron deflection. These are partial-chord effectiveness approximations, not a remeshed F-22 or measured control derivatives. Kutta–Joukowski loads drive wing lift and roll moment. Induced drag is evaluated in a distant wake plane at 100 spans using half the full wake downwash.

The assumed trapezoidal wing spans 13.6 m, with 9 m root chord, 2.5 m tip chord and 42° leading-edge sweep; area is therefore 78.2 m². This is a low-resolution lifting surface, not a CFD mesh extracted from the visual F-22 model. A capped swept-wing compressibility correction is used. Attached flow is blended into a flat-plate-like separated-flow approximation starting at 15° and ending at 28° incidence with no leading-edge droop. Full 18° droop shifts these thresholds by an assumed 3° / 5°. The droop correction is empirical; leading-edge geometry is not separately resolved by the one-row lattice. Profile, tail, body, and high-Mach drag terms are empirical. The effective reference aerodynamic center is assumed at 36% MAC.

This is potential-flow numerics plus reduced-order empirical aerodynamics. It is **not** a solution of full-aircraft 3D viscous Navier–Stokes equations. It does not resolve shocks, turbulence, boundary layers, engine jets, thrust-vectoring hardware, fuselage pressure fields or transonic vortices. The rate controller is not the real aircraft's flight-control law. High incidence, reverse flow, rapid rotation and Mach > 0.75 are particularly approximate. The interface identifies these regimes.

The 14 joint angles are updated in physics substeps and copied unchanged into the displayed model. Left/right stabilator angles produce separate tail loads and a differential roll moment. Actual rudder deflections drive side force. Flap, aileron and leading-edge deflections add empirical profile drag. Initial trim includes the moments of deployed surfaces. Nozzle petal opening follows engine power as a visual cue; it does not redirect thrust.

The river CFD remains a separate depth-averaged shallow-water finite-volume solver; it does not compute aircraft aerodynamics.

## Mobile performance

Automatic touch-device selection uses a light graphics profile. User selection can override it.

- Five terrain chunks, 80 × 32 cells per chunk; opaque low-polygon instanced crowns, approximately 1,600 trees, four silhouettes. No leaf-card overdraw or tree shadows.
- Pixel ratio capped at 1; no multisample antialiasing or shadow maps. Four reduced textures total about 313 kB.
- Water uses the same river solver with 8 m cells, 48 × 96 grid, on the same 384 × 768 m domain. Lower-resolution water mesh and panorama reflection eliminate secondary scene render passes. This profile does not show dynamic object reflections or screen-space riverbed refraction.
- Desktop keeps the original detailed forest, 4 m river grid, real scene reflection and riverbed refraction.
- Aircraft physics uses the same 24-panel flow model and time step on both profiles.

## Verification

`node validation/control-surfaces-check.cjs` verifies signed differential control loads, increased lift/induced drag with symmetric flap deflection, shared physical/visual angles, servo limits and neutral geometry. `node validation/controller-calibration-check.cjs` verifies channel detection, reversed and asymmetric travel, center correction, full throttle endpoints, ambiguous gestures, canceled calibration and device-local persistence.

`node validation/physics-check.cjs` checks zero/signed wing lift, positive induced drag, dynamic-pressure scaling, algebraic boundary residuals, a 12/24/48 panel refinement trend, level trim, fuel consumption, mass-dependent acceleration, CG trim changes, banked turns without automatic leveling, control signs, separated flow, fuel-out glide, wind, normalized attitude, mobile scene budgets, and 5–60 FPS trajectory equivalence. It also checks pause / river-observation freezes and shader include availability. `node validation/flight-features-check.cjs` retains the controller, Expo and exhaust checks.

The v12 regression reproduces a three-second pitch pull followed by release: the former model sustained tail-first motion for more than ten seconds, while the revised case keeps positive forward airspeed. A deliberately reversed initial attitude tests continuous velocity and departure recovery. Prescribed world-velocity cases isolate scene integration and assert stationary terrain landmarks, correct horizontal ground speed, camera translation in both Z directions and along X, vertical/zero motion, and independence from a nose-only rotation. These are headless math/geometry checks, not visual browser tests.

These checks establish internal consistency, not agreement with aircraft flight data. GPU shader execution, actual phone frame rates and real browser audio hardware have not been measured in this update. Terrain collision uses five aircraft extremity samples; trees, landing gear and structural damage are not simulated. Automatic cruise is a demonstration path rather than a dynamic autopilot.

## References

- U.S. Air Force public fact sheet: dimensions, approximately 19,700 kg aircraft weight, 38,000 kg maximum takeoff weight, and two 35,000-pound-class engines. https://www.af.mil/About-Us/Fact-Sheets/Display/Article/104506/f-22-raptor/
- MIT AVL documentation: horseshoe vortex formulation and thin-surface / low-angle / subsonic limitations. No AVL software is bundled. https://web.mit.edu/drela/Public/web/avl/avl_doc.txt
- NASA lift equation: L = 0.5 ρ V² S CL. https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/lift-equation/
- FAA Airplane Flying Handbook, Chapter 5: angle-of-attack stall, increasing drag and reduced control effectiveness. It does not supply F-22 coefficients or protection limits. https://www.faa.gov/sites/faa.gov/files/regulations_policies/handbooks_manuals/aviation/airplane_handbook/06_afh_ch5.pdf
- NASA: lift perpendicular to the flight path and drag along it. https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/lift-to-drag-ratio/
- MDN Web Audio autoplay policy: sound is armed by default but the AudioContext starts on the first trusted pointer or keyboard interaction. https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Autoplay
