34 #ifndef FGMASSBALANCE_H 35 #define FGMASSBALANCE_H 44 #include "math/FGColumnVector3.h" 45 #include "math/FGMatrix33.h" 51 #define ID_MASSBALANCE "$Id: FGMassBalance.h,v 1.38 2016/12/21 08:08:32 ehofman Exp $" 115 bool InitModel(
void);
123 bool Run(
bool Holding);
125 double GetMass(
void)
const {
return Mass;}
126 double GetWeight(
void)
const {
return Weight;}
127 double GetEmptyWeight(
void)
const {
return EmptyWeight;}
129 double GetXYZcg(
int axis)
const {
return vXYZcg(axis);}
131 double GetDeltaXYZcg(
int axis)
const {
return vDeltaXYZcg(axis);}
145 double xx = sv(1)*v(1);
146 double yy = sv(2)*v(2);
147 double zz = sv(3)*v(3);
148 double xy = -sv(1)*v(2);
149 double xz = -sv(1)*v(3);
150 double yz = -sv(2)*v(3);
167 void SetEmptyWeight(
double EW) { EmptyWeight = EW;}
170 void AddPointMass(
Element* el);
171 double GetTotalPointMassWeight(
void)
const;
174 const FGMatrix33& GetJ(
void)
const {
return mJ;}
175 const FGMatrix33& GetJinv(
void)
const {
return mJinv;}
176 void SetAircraftBaseInertias(
const FGMatrix33& BaseJ) {baseJ = BaseJ;}
177 void GetMassPropertiesReport(
int i);
205 double GetIxx(
void)
const {
return mJ(1,1); }
206 double GetIyy(
void)
const {
return mJ(2,2); }
207 double GetIzz(
void)
const {
return mJ(3,3); }
208 double GetIxy(
void)
const {
return -mJ(1,2); }
209 double GetIxz(
void)
const {
return -mJ(1,3); }
210 double GetIyz(
void)
const {
return -mJ(2,3); }
218 mPMInertia.InitMatrix();
223 void CalculateShapeInertia(
void) {
226 mPMInertia(1,1) = (Weight/(slugtolb))*Radius*Radius;
227 mPMInertia(2,2) = (Weight/(slugtolb*12))*(6*Radius*Radius + Length*Length);
228 mPMInertia(3,3) = mPMInertia(2,2);
231 mPMInertia(1,1) = (Weight/(slugtolb*2))*Radius*Radius;
232 mPMInertia(2,2) = (Weight/(slugtolb*12))*(3*Radius*Radius + Length*Length);
233 mPMInertia(3,3) = mPMInertia(2,2);
236 mPMInertia(1,1) = (Weight/(slugtolb*3))*Radius*Radius*2;
237 mPMInertia(2,2) = mPMInertia(1,1);
238 mPMInertia(3,3) = mPMInertia(1,1);
241 mPMInertia(1,1) = (Weight/(slugtolb*5))*Radius*Radius*2;
242 mPMInertia(2,2) = mPMInertia(1,1);
243 mPMInertia(3,3) = mPMInertia(1,1);
250 enum esShape {esUnspecified, esTube, esCylinder, esSphere, esBall} eShapeType;
258 double GetPointMassLocation(
int axis)
const {
return Location(axis);}
259 double GetPointMassWeight(
void)
const {
return Weight;}
260 esShape GetShapeType(
void) {
return eShapeType;}
262 const FGMatrix33& GetPointMassInertia(
void) {
return mPMInertia;}
263 const std::string& GetName(
void) {
return Name;}
265 void SetPointMassLocation(
int axis,
double value) {Location(axis) = value;}
266 void SetPointMassWeight(
double wt) {
268 CalculateShapeInertia();
270 void SetPointMassShapeType(esShape st) {eShapeType = st;}
271 void SetRadius(
double r) {Radius = r;}
272 void SetLength(
double l) {Length = l;}
273 void SetName(
const std::string& name) {Name = name;}
274 void SetPointMassMoI(
const FGMatrix33& MoI) { mPMInertia = MoI; }
275 double GetPointMassMoI(
int r,
int c) {
return mPMInertia(r,c);}
280 std::vector <struct PointMass*> PointMasses;
283 void Debug(
int from);
Base class for all scheduled JSBSim models.
FGMatrix33 GetPointmassInertia(double mass_sl, const FGColumnVector3 &r) const
Computes the inertia contribution of a pointmass.
This class implements a 3 element column vector.
Handles matrix math operations.
bool Load(Element *el)
Loads this model.
Encapsulates the JSBSim simulation executive.
Models weight, balance and moment of inertia information.
bool Run(bool Holding)
Runs the Mass Balance model; called by the Executive Can pass in a value indicating if the executive ...
FGColumnVector3 StructuralToBody(const FGColumnVector3 &r) const
Conversion from the structural frame to the body frame.