Skip to content
Preview.xml@modelscript/jsbsim 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica
Live ExampleMediumAltitudeUav.xml

JSBSim 6-DOF Fixed-Wing UAV Flight Dynamics Model

Aerospace flight dynamics configuration specifying wing geometry, mass balance, turboprop thrust, pitch FCS channel, and lift/drag polars.

Playground
Source (27 lines)
1<?xml version="1.0"?>
2<fdm_config name="MediumAltitudeUAV" version="2.0">
3  <metrics>
4    <wingarea unit="M2"> 6.40 </wingarea>
5    <wingspan unit="M"> 8.50 </wingspan>
6    <chord unit="M"> 0.75 </chord>
7  </metrics>
8  <mass_balance>
9    <emptywt unit="KG"> 185.0 </emptywt>
10    <ixx unit="KG*M2"> 94.0 </ixx>
11    <iyy unit="KG*M2"> 142.0 </iyy>
12    <izz unit="KG*M2"> 218.0 </izz>
13  </mass_balance>
14  <flight_control name="PitchAutopilot">
15    <channel name="Pitch">
16      <summer name="PitchError">
17        <input>ap/theta-cmd-rad</input>
18        <input>-attitude/theta-rad</input>
19      </summer>
20      <pure_gain name="ElevatorGain">
21        <input>fcs/pitch-error</input>
22        <gain>2.4</gain>
23        <output>fcs/elevator-cmd-norm</output>
24      </pure_gain>
25    </channel>
26  </flight_control>
27</fdm_config>
JSBSim 6-DOF Flight Control & Aero Block Diagram
Flight Dynamics Model (Planform Blueprint) Airframe Geometry, Reference Points (CG/AERORP), and Control Surfaces b = 36 ft, c̄ = 4.9 ft CG (Station: 41") AERORP (43.1") THRUST VECTOR Legend: Center of Gravity (CG) Aerodynamic Center (AERORP) Thrust Line
Drag to pan · Click % to reset

JSBSim Aerospace 6-DOF Flight Dynamics (.xml) ​

@modelscript/jsbsim (languages/jsbsim) provides zero-regex XML parsing, non-linear 6-DOF rigid-body flight dynamics integration, cruise trim stabilization, linear DAE lowering, and Modelica 3.x projection for JSBSim Flight Dynamics Model (FDM) fixed-wing and rotorcraft aircraft configurations.


Supported Extensions & Standards ​

ExtensionFormatDescription
.xmlJSBSim FDM XMLAircraft configuration schema encoding metrics, mass balance, propulsion, landing gear, and aerodynamic tables

Key Capabilities ​

1. Six-Degree-of-Freedom (6-DOF) Non-Linear Equations of Motion ​

  • Integrates the full non-linear Newtonian equations of motion for a rigid aircraft in atmospheric flight:
    • Translational Accelerations in Body Frame:u˙=Fxm−qw+rvv˙=Fym−ru+pww˙=Fzm−pv+qu
    • Rotational Accelerations in Principal Axes:p˙=MxIxx+Iyy−IzzIxxqrq˙=MyIyy+Izz−IxxIyyprr˙=MzIzz+Ixx−IyyIzzpq
    • Euler Angle Kinematics:ϕ˙=p+(qsin⁡ϕ+rcos⁡ϕ)tan⁡θθ˙=qcos⁡ϕ−rsin⁡ϕψ˙=qsin⁡ϕ+rcos⁡ϕcos⁡θ
    • Geodetic Altitude Rate of Climb:h˙=usin⁡θ−vsin⁡ϕcos⁡θ−wcos⁡ϕcos⁡θ

2. Aerodynamics & Steady Cruise Trim ​

  • Models lift (CL), drag (CD), side force (CY), and moments (Cl,Cm,Cn) as functions of dynamic pressure q¯=12ρV2, angle of attack α=arctan⁡(w/u), and sideslip β=arcsin⁡(v/V):CL=CL0+CLα⋅αCD=CD0+kCL2Cm=Cmα(α−αtrim)+Cmq(qc¯2V)
  • Computes automatic cruise trim equilibrium where aerodynamic lift cancels aircraft gross weight (L=mg):αtrim=mg−q¯SCL0q¯SCLαensuring stable horizontal flight without pitch oscillation or kinetic energy loss.

3. Direct DAE Lowering ​

  • Lowers state variables (u,v,w,p,q,r,ϕ,θ,ψ,h) and aero force equations into @modelscript/runtime's DAEBuilder linear memory arena.
  • Enables co-simulation between aerodynamic airframes, onboard flight control computers (@modelscript/simulink), and satellite navigation systems (@modelscript/ccsds).

4. Bidirectional Modelica 3.x Projection ​

  • Projects JSBSim aircraft into Modelica.Mechanics.MultiBody 6-DOF airframes with aerodynamic force elements.

Pre-Flight Diagnostics ​

The JSBSim linter validates aircraft geometry, mass distributions, and inertia tensors:

10 rules7 error3 warning Run with msx jsbsim lint

CodeRuleSeverityMessage
M8901missing-aircraft-nameerrorJSBSim <fdm_config> element is missing required 'name' attribute.
M8902non-positive-reference-areaerrorWing reference area (<val>) must be strictly positive.
M8903non-positive-wingspan-chorderrorWing metric '<param>' (<val>) must be strictly positive.
M8904non-positive-empty-weighterrorAircraft empty weight (<val>) must be strictly positive.
M8905invalid-inertia-tensorerrorMoments of inertia tensor is invalid: <reason>.
M8906missing-aerodynamics-sectionerrorAircraft model does not define any aerodynamic force/moment coefficients in <aerodynamics>.
M8907missing-landing-gearwarningAircraft model defines no landing gear bogies in <ground_reactions>; ground interaction is disabled.
M8908negative-engine-thrusterrorEngine '<engineName>' specifies negative maximum thrust (<val>).
M8909undefined-fcs-inputwarningFCS channel '<channelName>' references input property '<inputProperty>' not bound in flight control.
M8910unrealistic-cg-locationwarningCenter of gravity (<cgX>) is significantly far from aerodynamic center (<aeroX>); aircraft may have extreme pitch instability.

Generated from languages/jsbsim/src/errors.ts. All languages →


CLI Usage ​

bash
# Inspect aircraft metrics, mass balance, engines, and aero coefficients
msx jsbsim inspect Cessna172Skyhawk.xml

# Run pre-flight linting and inertia tensor validation
msx jsbsim lint Cessna172Skyhawk.xml

# Simulate 6-DOF flight dynamics with automatic cruise trim
msx jsbsim simulate Cessna172Skyhawk.xml --duration=15.0 --speed=180.0 --altitude=5000.0

# Lower 6-DOF flight dynamics equations to ModelScript linear DAE arena
msx jsbsim to-dae Cessna172Skyhawk.xml

# Project into Modelica 3.x 6-DOF flight mechanics model
msx jsbsim to-modelica Cessna172Skyhawk.xml -o FlightMechanics.mo

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy