Analyzing the accuracy of JSBSim for the computation of a vehicle rotations.#1453
Analyzing the accuracy of JSBSim for the computation of a vehicle rotations.#1453bcoconni wants to merge 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1453 +/- ##
=======================================
Coverage 25.11% 25.11%
=======================================
Files 171 171
Lines 18840 18842 +2
=======================================
+ Hits 4731 4733 +2
Misses 14109 14109 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I am planning to submit another PR with a proposal for new defaults for the methods of integration of rotation rates and quaternions. But I would like to hear your feedback about my analysis before proceeding. |
|
@bcoconni this is a great example! I love additional insights like this. OK from me to merge |
|
Looks like a very useful exercise, and a fair bit of work 😉 I see the A4's legendary roll rate even gets a mention. So, in terms of the NASA test cases evaluation of a number of flight dynamics engines including JSBSim, were all the results close enough to each other because they all ended up using the same integration schemes, or were there different integration schemes used but the angular rates were small enough and the simulation run short enough that there wasn't a significant difference in the results? |
e4e6a66 to
5719564
Compare
|
Great contribution @bcoconni - The PR looks good to me |
|
Thanks @agodemar. More details about the NASA test case 2: it appears that the simulation 2 (SIM 2) is deviating from the others by more than 4 degrees over the simulated 30 seconds:
With the default settings of the integration methods, we are deviating by 2.5 degrees over 30 seconds. So JSBSim 1.3.1 with its default parameters is comparing reasonably well (or at least not any worse than SIM 2) with respect to the other simulations of the paper from 2015. And when selecting better integration methods, JSBSim 1.3.1 is reasonably close to SIM 1. Also note that when the Adams-Bashforth 4 and the Buss 1 methods are selected, there is no longer a drift between JSBSim and SIM1: the gap between the 2 simulations is bounded and do not increase over time. |
|
My recollection of the comparison of the atmospheric test cases was that the entire set I performed with JSBSim (8 or 10 cases ... ?) were all right on top of the other NASA sim. |
|
As soon as this PR is merged I'll make a LinkedIn post. This gives even more strength to the library. |
|
Ah, just came across this.
|









This PR submits a Python notebook that analyzes the accuracy of JSBSim's computations for the rotations of a vehicle.
Analysis summary and conclusions
The analysis compares JSBSim to the exact computation of a free rigid body rotation from the paper Numerical Implementation of the Exact Dynamics of Free Rigid Bodies, van Zon R., Schofiled J., Dec 15, 2006
Basically it shows that the current defaults for the integration of rotations are poor choices:
jsbsim/src/models/FGPropagate.cpp
Lines 131 to 134 in 3896d4a
To put it bluntly, the trapezoidal method is worse than Euler in every possible scenario and should not be used for any purpose.
The other integration schemes (Adams-Bashforth, Buss' methods and local linearization) show adequate precision for the computation of rotations with methods of higher order performing better than methods of lower order.
Notably, methods specifically designed for the integration of quaternions such as Buss of the 1st and "augmented" 2nd order as well as NASA's local linearization are behaving better than Adams-Bashforth of the 2nd order. The Buss method of the 2nd order gives similar accuracy as Adams-Bashforth of the 4th and 5th order.
Local linearization and the Buss methods are available in JSBSim since commit 9d2416b (Dec 2011)
Pull Request content
The notebook comes with the C program from van Zon & Schofield that computes the exact solution. It needs the GNU scientific library to compile.
The CMake file to compile the C program is also included as well as the JSBSim model for the top which, I think, can claim the crown for the smallest JSBSim model ever 😄
All the files are located under the
check_casesfolder since, in my mind, this notebook is more a tool to check JSBSim performance than an example.