Menu

#1923 Several errors in AIModel

2020.4
Accepted
nobody
AI (9)
High
2024-01-19
2016-12-15
AceOfSina
No

---- #1

In file flightgear/AIModel/submodel.cxx ,
in function FGSubmodelMgr::transform ,
IC.speed = _parent_speed;

IC.speed is fps, but _parent_speed is mps.

---- #2

In file flightgear/AIModel/AIThermal.cxx ,
in function FGAIThermal::Run ,
double Rmax = diameter/2.0;

"diameter" is in nm (nautical miles), but "Rmax" is to be used as "feet".

---- #3

In file flightgear/AIModel/AIThermal.cxx ,
in function FGAIThermal::Run , (further downwards in the same function)

Rsink = ( shapingRmax ) + ( ( (1.0-shaping)Rmax*alt_rel ) / altitude_agl_ft ); // in the main thermal body

Variable "shaping" is real number ( 0. <= shaping <= 1. )
Variable "Rmax" is in feet (incorrectly as nm)
Variable "alt_rel" is real number, a ratio
Variable "altitude_agl_ft" is in feet

(As I have read it) To divide by "altitude_agl_ft" makes no sense, because it causes addition with wrong units:
(shaping * Rmax) ---> feet
( (1.0-shaping)Rmaxalt_rel ) ----> feet
( ( (1.0-shaping)Rmaxalt_rel ) / altitude_agl_ft ) ----> unitless
( shapingRmax ) + ( ( (1.0-shaping)Rmax*alt_rel ) / altitude_agl_ft ) ---> feet + unitless (??)

(To my comprehension) The division by "altitude_agl_ft" is wrong. Correction:
Rsink = ( shapingRmax ) + ( (1.0-shaping)Rmax*alt_rel );

---- #4

In file flightgear/AIModel/AIThermal.hxx ,

The class AIThermal has member-variable "double altitude_agl_ft", which shadows member-variable ""double altitude_agl_ft"" from base-class AIBase.

The member-variable AIThermal::altitude_agl_ft should be removed.

---- #5

The class AIBase has member-variable "vs" (vertical speed) in fpm (feet per minute). But in AIBallistic and in AIWingman, "vs" is used as fps (feet per second).


More, to come

Discussion

  • James Turner

    James Turner - 2016-12-15

    Please provide these fixes as a patch, not a bug report!

     
  • xDraconian

    xDraconian - 2018-09-29
    • labels: --> AI
     
  • Gijs

    Gijs - 2024-01-19

    Some progress was made over the years:

    4 = Fixed per [3f2c9e]
    5 = Fixed per [9008b3]

     

    Related

    Commit: [3f2c9e]
    Commit: [9008b3]

  • Gijs

    Gijs - 2024-01-19
    • status: New --> Accepted
    • Milestone: 2016.4 --> 2020.4
     

Log in to post a comment.