-
Notifications
You must be signed in to change notification settings - Fork 540
Description
I'm submitting a ...
- bug report
- feature request
- support request
Describe the issue
As far as we understand, the vector vPQRdot in FGAccelerations class is the derivative of the angular velocity of the body w.r.t the ECEF frame, expressed in body frame coordinates, and the vector vPQRidot is the derivative of the angular velocity of the body w.r.t the ECI frame, also expressed in body frame coordinates.
In method FGAccelerations::CalculatePQRdot, the variable vPQRdot is derived from vPQRidot using the expression :
jsbsim/src/models/FGAccelerations.cpp
Line 162 in 0176553
| vPQRdot = vPQRidot - in.vPQRi * (in.Ti2b * in.vOmegaPlanet); |
It should be vPQRdot = vPQRidot + in.vPQRi * (in.Ti2b * in.vOmegaPlanet) instead.
Proof :
The correct expression is the last equation above, expressed in body frame coordinates.
What is the current behavior?
To highlight the problem, we have slightly modified the orbit check-case, with an initial angular rate w.r.t the ECI frame of vPQRi=[15deg/s, 0., 0.]. The body is a spinning ball around its X-axis (pointing to the East), orbiting the Earth in the equatorial plane. In this scenario, the body X-axis and the angular velocity vector are constant in the ECI frame, i.e. vPQRidot is null. The angular velocity vector w.r.t ECEF frame, namely vPQR, is then simply equal to the Earth sidereal rate vector projected on the (rotating) Y-Z plane of the body frame.
The following graph shows the Q and R components of the vPQR vector, and vPQRdot vector, straight from the BallOut.csv output file produced by the JSBSim program :

The sign error on vPQRdot is obvious.
Fortunately, as the equation of motion are integrated in the ECI frame using vPQRidot in FGPropagate class, this error has a limited effect on trajectory computations:
- the calculation of
vPQRidotis OK, - the calculation of
vPQRiby integratingvPQRidotis OK, - the calculation of
vPQRfromvPQRiis OK, - the attitude computations are OK.
Only the outputs and further computations based on vPQRdot are affected by a (small) error.
What is the expected behavior?
Once the sign error on the term in.vPQRi * (in.Ti2b * in.vOmegaPlanet) is corrected in FGAccelerations::CalculatePQRdot (l.158 and l.162) and FGAccelerations::SetHoldDown (l.214), consistent results are restored, as shown by the following figure:

All the other output variables in the BallOut.csv file have remained exactly the same, confirming that a change in vPQRdot values has no adverse side-effect on the simulation loop.
Please tell us about your environment:
- OS : Linux Debian 12
- JSBSim 1.2.0
- Language C++
Other information
We would like to thank the JSBSim developer team for their invaluable contribution to the flight dynamics simulation community.