JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGElectric.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGElectric.h
4  Author: David Culp
5  Date started: 04/07/2004
6 
7  ----- Copyright (C) 2004 David P. Culp (davidculp2@comcast.net) --------------
8 
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
12  version.
13 
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
17  details.
18 
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.
22 
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.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 04/07/2004 DPC Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGELECTRIC_H
35 #define FGELECTRIC_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include "FGEngine.h"
42 
43 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44 FORWARD DECLARATIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 namespace JSBSim {
48 
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 CLASS DOCUMENTATION
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52 
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 CLASS DECLARATION
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66 
67 class FGElectric : public FGEngine
68 {
69 public:
71  FGElectric(FGFDMExec* exec, Element *el, int engine_number, FGEngine::Inputs& input);
73  ~FGElectric();
74 
75  void Calculate(void);
76  double GetPowerAvailable(void) {return (HP * hptoftlbssec);}
77  double getRPM(void) {return RPM;}
78  std::string GetEngineLabels(const std::string& delimiter);
79  std::string GetEngineValues(const std::string& delimiter);
80 
81 private:
82 
83  double CalcFuelNeed(void);
84 
85  //double BrakeHorsePower;
86 
87  // constants
88  double hptowatts;
89 
90  double PowerWatts; // maximum engine power
91  double RPM; // revolutions per minute
92  double HP; // engine output, in horsepower
93 
94  void Debug(int from);
95 };
96 }
97 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 #endif
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGElectric
Models an electric motor.
Definition: FGElectric.h:67
JSBSim::FGElectric::~FGElectric
~FGElectric()
Destructor.
Definition: FGElectric.cpp:79
JSBSim::FGElectric::FGElectric
FGElectric(FGFDMExec *exec, Element *el, int engine_number, FGEngine::Inputs &input)
Constructor.
Definition: FGElectric.cpp:58
JSBSim::FGEngine::Inputs
Definition: FGEngine.h:106
JSBSim::FGEngine
Base class for all engines.
Definition: FGEngine.h:103
JSBSim::Element
Definition: FGXMLElement.h:143
JSBSim::FGElectric::Calculate
void Calculate(void)
Calculates the thrust of the engine, and other engine functions.
Definition: FGElectric.cpp:86