JSBSim vs YASim

From FlightGear wiki
Jump to navigation Jump to search

JSBSim and YASim are the two most commonly used flight dynamics models used within FlightGear. They each have their pros and cons; they'll be discussed here.

Accuracy and realism

Accuracy and realism of the flight dynamics model are two common points raised in the argument against YASim. In reality, if you give YASim or JSBSim garbage parameters, they'll both return garbage aerodynamics. The accuracy of the algorithm is constrained by its input.

YASim and JSBSim have different problems with regards to accurately emulating a real-life aircraft. Since YASim is solver-based, you do not need wind-tunnel data or accurate tables of propeller performance; you simply tell it some basic aircraft parameters and it will attempt to find a solution that approximates the aircraft's aerodynamics model. JSBSim uses detailed tables of performance and lift/drag numbers instead; JSBSim has no concept of wings or fuselage. Instead, drag, lift, and other forces are computed as functions of alpha (pitch), beta (yaw), control deflection, flap deflection, etc. This means that JSBSim needs accurate data to produce an accurate flight model.

Both YASim and JSBSim have their niche; YASim is simpler to get started with but it's not as easily matched to a real aircraft's performance, while JSBSim is much more difficult to use but is more controllable.

YASim

YASim uses a solver-based approach to aerodynamics; you lay out the physical characteristics of the aircraft (such as its wings, fuselage, engines, stabilizers, etc.) as well as its flying characteristics (cruise speed and altitude, the angle of attack during landing) and YASim attempts to solve for the given configuration. It's not always successful (since there are many possible aerodynamic solutions for a given set of parameters) and it's generally not too accurate unless it's been iteratively fine-tuned by the author to match the performance of the real-life aircraft.

Cquote1.png YASim can't make use of coefficient tables you provide e.g. for a wing - it simply doesn't take them as input, it takes the rough outline and performance data as input. So the incoming data structure for a YaSim plane would by necessity very different.
— Thorsten (Thu Dec 25). Re: getting data direct from the 3d file..
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png YaSim does not input a natural set of aerodynamically relevant parameters, it inputs aircraft outline and performance limits and tries to guess the relevant parameters from there. Internally it is like JSBSim a coefficient scheme, but the coefficient tables aren't actually based on performance tables but guessed by the YaSim solver, so they're simpler and more generic. So the best it can do is to get the rough performance characteristics right, but it can't conceptually be as realistic as JSBSim for the simple reason that even if you have better data, YaSim doesn't allow you to use it. And you're kidding yourself if you think aircraft can be described accurately by specifying things like wingspan, cruise speed or stall speed. The reality is multidimensional tables of lift and drag as a function of AOA, airspeed, ...
Cquote2.png

JSBSim

JSBSim, on the other hand, uses a data-driven approach to flight dynamics. If it were given all the proper tables for the real-life aircraft it's simulating (which is effectively impossible), it will produce perfectly realistic dynamics; if you wanted to, you could simulate a brick. It's commonly used for older aircraft with published performance data; it's very difficult to create a JSBSim FDM without any wind-tunnel data.


Cquote1.png JSBSim inputs a natural set of parameters/parametrized functions which you get when you derive aircraft equations of motion from first principles, making a few assumptions (approximately steady-state flow, limited dynamical deformation of the airplane,...) on the way. So for decent input data, it won't be perfectly realistic, but realistic in the sense that it reproduces to high fidelity the performance of an aircraft inside the known envelope.
Cquote2.png
Cquote1.png JsBSim surely is the more "engineering" Approach, with it's strict mathematical, table based approach while YaSim is better suited to fine-tune the Pilot Experience. Ground Interaction never was a big theme in JSBSim, while YaSim gets a lot of appeal with it's sophisticated Ground/Water Effects. I chose YaSim for exactly that Reason. The Aircraft needs to fly and feel (at least visually) like a real one. That means I need to adjust lots of "emotional" Parameters to get specific Feedback from the FDM. This is what YaSim is good at.
Cquote2.png

Which one should I use?

Continue down until you answer 'yes'.

  1. Do you have wind-tunnel data for the aircraft in question? If so, use JSBSim.
  2. Is this your first FDM? If so, use YASim.
  3. Do you dislike YASim's open-ended solver? If so, use JSBSim.
  4. Do you dislike JSBSim's necessary reams of data? If so, use YASim.
  5. See 3.

In the end, it really doesn't matter which one you use --- just pick one and use it. It's not a life-or-death decision.