|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.flightdynamicsmodel.AircraftModel
public class AircraftModel
Defines a fixed-wing aircraft as a finite-element model consisting of ailerons, flaps, an elevator, a rudder, and a fuselage. It is derived from Physics for Game Developers by David Bourg.
| Field Summary | |
|---|---|
(package private) AircraftRigidBody |
_airplane
the rigid-body model of the aircraft |
private double |
_airspeedPrevious
zzz |
private Vector |
_attitudeEulerPrevious
the attitude velocity in Euler angles zzz |
private AircraftModelController |
_controller
the controller interface that provides input to the flight-control surfaces |
(package private) AircraftRigidBodyElement[] |
_elements
the mass, inertia, and lifting-surface properties of the rigid body |
(package private) boolean |
_isStalled
whether any part of the wing is stalled |
(package private) boolean |
_isStalling
whether any part of the wing is nearing a stall |
(package private) double |
_liftCoefficient
the average coefficient of lift of the wing based on the flaps and ailerons |
(package private) int |
_stepNumber
the current simulation step number |
(package private) double |
_thrust
the thrust force in RPM, ranging from THRUST_MIN to THRUST_MAX, inclusively. |
(package private) Vector |
_thrustVector
the thrust vector, which is assumed to act through the center of gravity of the plane |
(package private) Time |
_timeAbsolute
the absolute running time in seconds |
(package private) Time |
_timeRelative
the relative time in seconds from the previous simulation update |
private Vector |
_velocityPrevious
the attitude velocity in Euler angles zzz |
(package private) static int |
ELEMENT_AILERON_PORT
the index of the finite element for the port aileron |
(package private) static int |
ELEMENT_AILERON_STARBOARD
the index of the finite element for the starboard aileron |
(package private) static int |
ELEMENT_ELEVATOR_PORT
the index of the finite element for the port elevator. |
(package private) static int |
ELEMENT_ELEVATOR_STARBOARD
the index of the finite element for the starboard elevator. |
(package private) static int |
ELEMENT_FLAP_PORT
the index of the finite element for the port flap. |
(package private) static int |
ELEMENT_FLAP_STARBOARD
the index of the finite element for the starboard flap. |
(package private) static int |
ELEMENT_FUSELAGE
the index of the finite element for the fuselage |
(package private) static int |
ELEMENT_RUDDER
the index of the finite element for the combined vertical stabilizer and rudder |
static double |
ENCODED_UTM_TO_INTERNAL_SCALE
the conversion factor between the UTM (Universal Transverse Mercator latitude/longitude) system of the world coordinates and the internal system for the flight-dynamics model zzz??? not quite; it's a scale on the UTM __encoding__ |
private static double |
G
the gravitational acceleration constant is feet per second squared |
static double |
IMMINENT_STALL_LIFT_COEFFICIENT
the coefficient of lift corresponding to an imminent stall |
private static double |
RHO
the air density (units to be determined zzz???; see page 130) |
| Constructor Summary | |
|---|---|
AircraftModel(CoordinateWorld3D position,
AttitudeYaw heading,
Airspeed airspeed,
RevolutionsPerMinute rpm)
Creates an aircraft model. |
|
| Method Summary | |
|---|---|
private void |
calculateAirspeedAcceleration()
Calculates the instantaneous change in position per second squared. |
private void |
calculateAttitudeVelocityAndAcceleration()
Calculates the instantaneous change in attitude in degrees per second. |
private double |
calculateCoefficientOfDragGeneral(double angleOfAttack,
int controlSurfacePosition)
Calculates the coefficient of drag on a horizontal control surface (flap, aileron, or elevator). |
private double |
calculateCoefficientOfDragRudder(double angleOfAttack)
Calculates the coefficient of drag on a combined vertical stabilizer and rudder. |
private double |
calculateCoefficientOfLiftGeneral(double angleOfAttack,
int controlSurfacePosition)
Calculates the coefficient of lift on a horizontal control surface (flap, aileron, or elevator). |
private double |
calculateCoefficientOfLiftRudder(double angleOfAttack)
Calculates the coefficient of lift on a combined vertical stabilizer and rudder. |
private void |
calculateLoads()
Calculates all the forces and moments acting on the plane based on its current state. |
private void |
calculatePositionAcceleration()
Calculates the instantaneous change in position per second squared. |
private double |
clamp(double value)
Clamps a value to the interval [-1,+1]. |
private void |
defineFiniteElements()
Defines the discrete finite elements that together form the rigid-body model of the aircraft. |
AircraftModelController |
getController()
Returns the controller interface that provides input to the flight-control surfaces. |
private void |
initialize(Vector position,
double angleYaw,
double airspeed,
double rpm)
Initializes the state of the airplane as indicated and configures its finite-element model. |
private double |
interpolate(double domainValue,
double[] domain,
double[] range,
double offDomainValue)
Interpolates a value in a two-dimensional table. |
void |
update(double deltaTime)
Updates the simulation as a discrete-event time step by using Euler's method of approximation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final AircraftRigidBody _airplane
private double _airspeedPrevious
private Vector _attitudeEulerPrevious
private final AircraftModelController _controller
final AircraftRigidBodyElement[] _elements
boolean _isStalled
boolean _isStalling
double _liftCoefficient
int _stepNumber
double _thrust
Vector _thrustVector
Time _timeAbsolute
Time _timeRelative
private Vector _velocityPrevious
static final int ELEMENT_AILERON_PORT
static final int ELEMENT_AILERON_STARBOARD
static final int ELEMENT_ELEVATOR_PORT
static final int ELEMENT_ELEVATOR_STARBOARD
static final int ELEMENT_FLAP_PORT
static final int ELEMENT_FLAP_STARBOARD
static final int ELEMENT_FUSELAGE
static final int ELEMENT_RUDDER
public static final double ENCODED_UTM_TO_INTERNAL_SCALE
private static final double G
public static final double IMMINENT_STALL_LIFT_COEFFICIENT
private static final double RHO
| Constructor Detail |
|---|
public AircraftModel(CoordinateWorld3D position,
AttitudeYaw heading,
Airspeed airspeed,
RevolutionsPerMinute rpm)
position - - the positionheading - - the headingairspeed - - the airspeedrpm - - the thrust in revolutions per minute. The range depends on the model configuration, but 0 to 2500 is reasonable| Method Detail |
|---|
private void calculateAirspeedAcceleration()
private void calculateAttitudeVelocityAndAcceleration()
private double calculateCoefficientOfDragGeneral(double angleOfAttack,
int controlSurfacePosition)
angleOfAttack - - the angle of attack in degreescontrolSurfacePosition - - the control-surface position (-1,0,+1 for up, neutral, down, respectively)
private double calculateCoefficientOfDragRudder(double angleOfAttack)
angleOfAttack - - the angle of attack in degrees
private double calculateCoefficientOfLiftGeneral(double angleOfAttack,
int controlSurfacePosition)
angleOfAttack - - the angle of attack in degreescontrolSurfacePosition - - (-1,0,+1 for up, neutral, down, respectively)
private double calculateCoefficientOfLiftRudder(double angleOfAttack)
angleOfAttack - - the angle of attack in degrees
private void calculateLoads()
private void calculatePositionAcceleration()
private double clamp(double value)
value - - the value
private void defineFiniteElements()
public AircraftModelController getController()
private void initialize(Vector position,
double angleYaw,
double airspeed,
double rpm)
position - - encoded longitude as x, encoded latitude as y, and altitude as z in feetangleYaw - - the yaw in mathematical degreesairspeed - - the airspeed in feet per secondrpm - - the rpm
private double interpolate(double domainValue,
double[] domain,
double[] range,
double offDomainValue)
domainValue - - the independent valuedomain - - the domain of the independent valuerange - - the range of the dependent value to findoffDomainValue - - the value to return if the independent value is off-scale low or high
public void update(double deltaTime)
deltaTime - - the change in time in seconds from the previous update. A reasonable value is around 0.0025.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||