|
From: <de...@us...> - 2003-04-03 10:40:30
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv4810
Modified Files:
DynamicObject.h DynamicalSystem.h AeroDynamics.h
Log Message:
no message
Index: DynamicObject.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/DynamicObject.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DynamicObject.h 21 Mar 2003 20:08:35 -0000 1.5
--- DynamicObject.h 3 Apr 2003 10:40:22 -0000 1.6
***************
*** 85,88 ****
--- 85,90 ----
void EnableSmoke();
+ bool isNearGround();
+
protected:
***************
*** 115,118 ****
--- 117,121 ----
bool m_Local;
bool m_Human;
+ bool m_NearGround;
simdata::Matrix3 m_Inertia;
Index: DynamicalSystem.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/DynamicalSystem.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DynamicalSystem.h 12 Mar 2003 21:38:16 -0000 1.1
--- DynamicalSystem.h 3 Apr 2003 10:40:22 -0000 1.2
***************
*** 27,74 ****
#define __DYNAMICALSYSTEM_H__
- #include <limits>
#include <vector>
! class DynamicalSystem
! {
! unsigned short const m_NVariable;
! std::vector<double> const & rkqc(std::vector<double> &y,
! std::vector<double> &dyx,
! double &x, double htry, double eps,
! std::vector<double> const &yscal,
! double &hdid, double &hnext);
! std::vector<double> const &odeint(std::vector<double> const & ystart,
! double x1, double x2,
! double eps, double h1, double hmin,
! unsigned int &nok, unsigned int &nbad);
!
! static double const PGROW ;
! static double const PSHRNK;
! static double const FCOR;
!
! static double const SAFETY;
! static double const ERRCON;
!
! static unsigned int const MAXSTP;
! static double const TINY;
! double m_precision, m_hmin, m_hestimate;
public:
! std::vector<double> const & rk4(std::vector<double> const & y,
! std::vector<double> const & dyx,
! double x, double h);
! std::vector<double> const & RungeKutta(std::vector<double> const &y0,
! double t1, double t2);
! DynamicalSystem(
! unsigned short NVariable,
! double Precision = 1.e-3, //1.e-4
! double Hmin = 0.0,
! double Hestimate = 1.e-2):
! m_NVariable(NVariable),
! m_precision(Precision),
! m_hmin(Hmin),
! m_hestimate(Hestimate)
! {;};
! protected:
! virtual std::vector<double> const &f(double, std::vector<double> &) = 0;
};
! #endif
--- 27,46 ----
#define __DYNAMICALSYSTEM_H__
#include <vector>
! #include "NumericalMethod.h"
!
!
! class DynamicalSystem: public VectorField {
! NumericalMethod* _numericalMethod;
public:
! DynamicalSystem(unsigned short dimension);
! DynamicalSystem(VectorField* pf);
! ~DynamicalSystem();
! //void setVectorField(VectorField* pf);
! void setNumericalMethod(NumericalMethod* pnumericalMethod);
! std::vector<double> const& flow(std::vector<double>& y0, double t0, double dt) const;
};
!
! #endif //__DYNAMICALSYSTEM_H__
!
Index: AeroDynamics.h
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Include/AeroDynamics.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AeroDynamics.h 22 Mar 2003 12:38:56 -0000 1.6
--- AeroDynamics.h 3 Apr 2003 10:40:22 -0000 1.7
***************
*** 50,53 ****
--- 50,54 ----
};
+ class AeroVectorField;
/**
***************
*** 56,60 ****
*/
class AeroDynamics: public simdata::Object, public Physics, protected DynamicalSystem
! {
public:
SIMDATA_OBJECT(AeroDynamics, 0, 0)
--- 57,61 ----
*/
class AeroDynamics: public simdata::Object, public Physics, protected DynamicalSystem
! {
public:
SIMDATA_OBJECT(AeroDynamics, 0, 0)
***************
*** 120,127 ****
protected:
float m_WingSpan;
double m_WingChord; // chord length
double m_WingArea; // surface area of wings
! double m_stallAOA; // stall AOA
float m_DeMax;
--- 121,131 ----
protected:
+ //vector field which determines trajectory and behaviour of this dynamical system
+ std::vector<double> const& _f(double x, std::vector<double>& y);
+
float m_WingSpan;
double m_WingChord; // chord length
double m_WingArea; // surface area of wings
! double m_stallAOA; // stall AOA
float m_DeMax;
***************
*** 201,204 ****
--- 205,212 ----
protected:
+ // FIXME: needs to be moved in a mother class
+ bool isNearGround();
+
+
std::vector<double> const &f(double x, std::vector<double> &y);
void bindToBody(std::vector<double> const &y);
***************
*** 210,216 ****
double CalculateDragCoefficient() const;
double CalculateSideCoefficient() const;
- double CalculateDynamicPressure(double alt) const;
- double CalculateGravity(double const p_altitude) const;
- double CalculateAirDensity(double const alt) const;
double CalculateRollMoment(double const qbarS) const;
double CalculatePitchMoment(double const qbarS) const;
--- 218,221 ----
***************
*** 223,228 ****
simdata::Vector3 BodyToLocal(const simdata::Vector3 & vec);
void BodyToLocal();
-
- simdata::Matrix3 MakeAngularVelocityMatrix(simdata::Vector3 u);
simdata::Vector3 const& LiftVector();
--- 228,231 ----
***************
*** 230,239 ****
simdata::Vector3 const& SideVector() const;
- /*
- double ControlSensibility(double p_x) const; // control joystick sensibility
- double ControlInputValue(double p_gForce) const; // decrease deflection value to lower G
- double CIVbasis(double p_t) const;
- */
-
double m_depsilon; // Gforce control feedback stall
unsigned short m_Maxi; // number of FM iteration
--- 233,236 ----
***************
*** 242,247 ****
double m_ElevatorInput; // desired elevator deflection
- //double SetControl(double const p_setting, double const & p_mMax, double const & p_mMin) const;
-
// control surfaces
double m_Aileron;
--- 239,242 ----
***************
*** 251,257 ****
double m_Thrust;
- // calculated forces
- double m_qBarFactor;
-
simdata::Vector3 m_CurrentForceTotal;
simdata::Vector3 m_GravityForce;
--- 246,249 ----
***************
*** 267,270 ****
--- 259,263 ----
double m_gForce; // current g acceleration
+ double m_qBarFactor; // 0.5 * WingSpan * density (updated 1 time in a simulation step)
double m_Gravity; // current gravitational acceleration
simdata::Vector3 m_GravityWorld; // current gravity vector in earth coordinates
***************
*** 288,291 ****
--- 281,286 ----
simdata::Vector3 m_VelocityLocal; // velocity in earth coordinates
simdata::Vector3 m_VelocityBody; // (U,V,W) velocity in body coordinates
+ simdata::Vector3 m_AirflowBody; // air flow velocity in body coordinate
+ simdata::Vector3 m_WindLocal; // wind velocity in local coordinates
simdata::Vector3 m_AngularVelocityLocal;// angular velocity in earth coordinates
simdata::Vector3 m_AngularVelocityBody; // (P,Q,R) angular velocity in body coordinates
***************
*** 295,298 ****
--- 290,294 ----
bool m_Bound;
+ bool m_NearGround;
simdata::Vector3 *m_Position;
simdata::Vector3 *m_Velocity;
|