1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7 ------------- Copyright (C) 2000 Jon S. Berndt (jon@jsbsim.org) -------------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
19 You should have received a copy of the GNU Lesser General Public License along with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
23 Further information about the GNU Lesser General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42 #include "math/FGColumnVector3.h"
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 #define ID_THRUSTER "$Id: FGThruster.h,v 1.16 2011/03/10 01:35:25 dpculp Exp $"
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58 class FGPropertyManager;
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64 /** Base class for specific thrusting devices such as propellers, nozzles, etc.
66 <h3>reverser angle:</h3>
68 "Reverser angle" as used here is a way to manipulate the thrust vector,
69 along the thrust axis ONLY, during run time. This should not be confused
70 with a thrust vectoring nozzle. The angle is defined in radians, and is
71 used thus: Final_thrust = cosine( reverser_angle ) * unmodified_thrust.
72 Therefore a reverser angle of 0 results in no change, and a reverser angle
73 of 3.14 (pi) results in a completely reversed thrust vector. An angle of
74 1.57 (pi/2) results in no thrust at all.
77 @version $Id: FGThruster.h,v 1.16 2011/03/10 01:35:25 dpculp Exp $
80 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
84 class FGThruster : public FGForce {
88 FGThruster(FGFDMExec *FDMExec, Element *el, int num );
90 virtual ~FGThruster();
92 enum eType {ttNozzle, ttRotor, ttPropeller, ttDirect};
94 virtual double Calculate(double tt) {
95 Thrust = cos(ReverserAngle)*tt;
99 void SetName(string name) {Name = name;}
100 virtual void SetRPM(double rpm) {};
101 virtual double GetPowerRequired(void) {return 0.0;}
102 virtual void SetdeltaT(double dt) {deltaT = dt;}
103 double GetThrust(void) const {return Thrust;}
104 eType GetType(void) {return Type;}
105 string GetName(void) {return Name;}
106 void SetReverserAngle(double angle) {ReverserAngle = angle;}
107 double GetReverserAngle(void) const {return ReverserAngle;}
108 double GetClutchCtrl(void) const { return ClutchCtrlNorm; }
109 void SetClutchCtrl(double c) { ClutchCtrlNorm = c; }
110 virtual double GetRPM(void) const { return 0.0; };
111 double GetGearRatio(void) {return GearRatio; }
112 virtual string GetThrusterLabels(int id, string delimeter);
113 virtual string GetThrusterValues(int id, string delimeter);
119 double PowerRequired;
123 double ReverserAngle;
124 double ClutchCtrlNorm;
126 FGPropertyManager* PropertyManager;
127 virtual void Debug(int from);
130 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%