You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(260) |
Jun
(65) |
Jul
(28) |
Aug
(13) |
Sep
(46) |
Oct
(55) |
Nov
(25) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(97) |
Feb
(13) |
Mar
(90) |
Apr
(25) |
May
(97) |
Jun
(124) |
Jul
(39) |
Aug
(16) |
Sep
(62) |
Oct
(13) |
Nov
(32) |
Dec
(258) |
2006 |
Jan
(87) |
Feb
(67) |
Mar
(27) |
Apr
(19) |
May
(42) |
Jun
(12) |
Jul
(31) |
Aug
(51) |
Sep
(7) |
Oct
(4) |
Nov
(27) |
Dec
(6) |
2007 |
Jan
(23) |
Feb
(41) |
Mar
(6) |
Apr
(14) |
May
(31) |
Jun
(6) |
Jul
(9) |
Aug
(13) |
Sep
(41) |
Oct
(26) |
Nov
(13) |
Dec
(11) |
2008 |
Jan
(75) |
Feb
(24) |
Mar
(32) |
Apr
(103) |
May
(49) |
Jun
(15) |
Jul
(45) |
Aug
(61) |
Sep
(6) |
Oct
(12) |
Nov
(18) |
Dec
(32) |
2009 |
Jan
(77) |
Feb
(33) |
Mar
(33) |
Apr
(19) |
May
(52) |
Jun
(43) |
Jul
(14) |
Aug
(80) |
Sep
(32) |
Oct
(81) |
Nov
(20) |
Dec
(12) |
2010 |
Jan
(15) |
Feb
(50) |
Mar
(28) |
Apr
(49) |
May
(12) |
Jun
(19) |
Jul
(78) |
Aug
(49) |
Sep
(52) |
Oct
(22) |
Nov
(108) |
Dec
(33) |
2011 |
Jan
(47) |
Feb
(3) |
Mar
(7) |
Apr
(3) |
May
(7) |
Jun
(43) |
Jul
(80) |
Aug
(55) |
Sep
(34) |
Oct
(33) |
Nov
(33) |
Dec
(20) |
2012 |
Jan
(16) |
Feb
(18) |
Mar
(29) |
Apr
(26) |
May
(4) |
Jun
(5) |
Jul
(13) |
Aug
(14) |
Sep
(47) |
Oct
(29) |
Nov
(19) |
Dec
(66) |
2013 |
Jan
(55) |
Feb
(46) |
Mar
|
Apr
(1) |
May
|
Jun
(32) |
Jul
|
Aug
(1) |
Sep
(40) |
Oct
(3) |
Nov
(43) |
Dec
(26) |
2014 |
Jan
(63) |
Feb
(30) |
Mar
(2) |
Apr
(3) |
May
(51) |
Jun
(18) |
Jul
(4) |
Aug
(6) |
Sep
(10) |
Oct
|
Nov
(17) |
Dec
(3) |
2015 |
Jan
(13) |
Feb
(36) |
Mar
(12) |
Apr
(37) |
May
(8) |
Jun
|
Jul
(29) |
Aug
(23) |
Sep
(55) |
Oct
(82) |
Nov
(57) |
Dec
(72) |
2016 |
Jan
(61) |
Feb
(6) |
Mar
(1) |
Apr
(18) |
May
(59) |
Jun
(42) |
Jul
(24) |
Aug
(20) |
Sep
(6) |
Oct
|
Nov
(8) |
Dec
(1) |
2017 |
Jan
(2) |
Feb
(20) |
Mar
(14) |
Apr
(4) |
May
(9) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bertrand <bco...@us...> - 2017-06-04 21:06:12
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31273/tests Modified Files: TestExternalReactions.py Log Message: New feature: external moments can now be specified in addition to external forces. Index: TestExternalReactions.py =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/TestExternalReactions.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestExternalReactions.py 26 May 2017 09:44:47 -0000 1.1 --- TestExternalReactions.py 4 Jun 2017 21:06:08 -0000 1.2 *************** *** 21,25 **** import os, math import numpy as np ! from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest class TestExternalReactions(JSBSimTestCase): --- 21,27 ---- import os, math import numpy as np ! import xml.etree.ElementTree as et ! ! from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest, CopyAircraftDef class TestExternalReactions(JSBSimTestCase): *************** *** 198,202 **** self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) ! RunTest(TestExternalReactions) --- 200,251 ---- self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) ! ! def test_moment(self): ! script_path = self.sandbox.path_to_jsbsim_file('scripts', ! 'ball_chute.xml') ! tree, aircraft_name, aircraft_path = CopyAircraftDef(script_path, ! self.sandbox) ! extReact_element = tree.getroot().find('external_reactions') ! moment_element = et.SubElement(extReact_element, 'moment') ! moment_element.attrib['name'] = 'parachute' ! moment_element.attrib['frame'] = 'WIND' ! direction_element = et.SubElement(moment_element, 'direction') ! x_element = et.SubElement(direction_element, 'x') ! x_element.text = '0.2' ! y_element = et.SubElement(direction_element, 'y') ! y_element.text = '0.0' ! z_element = et.SubElement(direction_element, 'z') ! z_element.text = '-1.5' ! ! tree.write(self.sandbox('aircraft', aircraft_name, ! aircraft_name+'.xml')) ! ! fdm = CreateFDM(self.sandbox) ! fdm.set_aircraft_path('aircraft') ! fdm.load_script(script_path) ! fdm.run_ic() ! ! mDir = np.array([0.2, 0.0, -1.5]) ! mDir /= np.linalg.norm(mDir) ! self.assertAlmostEqual(fdm['external_reactions/parachute/l'], mDir[0]) ! self.assertAlmostEqual(fdm['external_reactions/parachute/m'], mDir[1]) ! self.assertAlmostEqual(fdm['external_reactions/parachute/n'], mDir[2]) ! ! fdm['external_reactions/parachute/magnitude-lbsft'] = -3.5 ! ! while fdm.run(): ! Tw2b = fdm.get_auxiliary().get_Tw2b() ! mag = fdm['aero/qbar-psf'] * fdm['fcs/parachute_reef_pos_norm']*20.0 ! f = Tw2b * np.mat([-1.0, 0.0, 0.0]).T * mag ! self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], f[0, 0]) ! self.assertAlmostEqual(fdm['forces/fby-external-lbs'], f[1, 0]) ! self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], f[2, 0]) ! ! m = -3.5 * Tw2b * np.mat(mDir).T ! fm = np.cross(self.getLeverArm(fdm,'parachute'), ! np.array([f[0,0], f[1,0], f[2, 0]])) ! self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0, 0] + fm[0]) ! self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1, 0] + fm[1]) ! self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2, 0] + fm[2]) RunTest(TestExternalReactions) |
From: Bertrand <bco...@us...> - 2017-06-04 21:06:12
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31273/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h FGExternalReactions.cpp FGExternalReactions.h Log Message: New feature: external moments can now be specified in addition to external forces. Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** FGExternalForce.cpp 4 Jun 2017 17:39:57 -0000 1.21 --- FGExternalForce.cpp 4 Jun 2017 21:06:08 -0000 1.22 *************** *** 49,52 **** --- 49,63 ---- </force> + <moment name="name" frame="BODY|LOCAL|WIND"> + + <function> ... </function> + + <direction> <!-- optional for initial direction vector --> + <x> value </x> + <y> value </y> + <z> value </z> + </direction> + </force> + </external_reactions> *************** *** 80,83 **** --- 91,96 ---- } + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + FGParameter* FGExternalForce::bind(Element *el, FGPropertyManager* pm, const string& magName, FGPropertyVector3& v) *************** *** 130,133 **** --- 143,148 ---- } + //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + void FGExternalForce::setForce(Element *el) { *************** *** 156,160 **** &FGForce::GetLocationZ, &FGForce::SetLocationZ); } ! //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 171,189 ---- &FGForce::GetLocationZ, &FGForce::SetLocationZ); } ! ! //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! ! void FGExternalForce::setMoment(Element *el) ! { ! FGPropertyManager* PropertyManager = fdmex->GetPropertyManager(); ! Name = el->GetAttributeValue("name"); ! string BasePropertyName = "external_reactions/" + Name; ! ! momentDirection = FGPropertyVector3(PropertyManager, BasePropertyName, ! "l", "m", "n"); ! momentMagnitude = bind(el, PropertyManager, BasePropertyName + "/magnitude-lbsft", ! momentDirection); ! } ! //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 162,165 **** --- 191,195 ---- { delete forceMagnitude; + delete momentMagnitude; Debug(1); } *************** *** 169,173 **** const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! vFn = forceMagnitude->GetValue() * forceDirection; return FGForce::GetBodyForces(); } --- 199,208 ---- const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! if (forceMagnitude) ! vFn = forceMagnitude->GetValue() * forceDirection; ! ! if (momentMagnitude) ! vMn = Transform() * (momentMagnitude->GetValue() * momentDirection); ! return FGForce::GetBodyForces(); } Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** FGExternalForce.h 4 Jun 2017 17:39:57 -0000 1.18 --- FGExternalForce.h 4 Jun 2017 21:06:08 -0000 1.19 *************** *** 66,71 **** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** Encapsulates code that models an individual arbitrary force. ! This class encapsulates an individual force applied at the specified location on the vehicle, and oriented as specified in one of three frames: --- 66,71 ---- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** Encapsulates code that models an individual arbitrary force, moment or a combination thereof. ! This class encapsulates an individual reaction applied at the specified location on the vehicle, and oriented as specified in one of three frames: *************** *** 106,109 **** --- 106,134 ---- @endcode + The location of the force vector, in structural coordinates, can be set at + runtime through the following properties: + + @code + external_reactions/{force name}/location-x-in + external_reactions/{force name}/location-y-in + external_reactions/{force name}/location-z-in + @endcode + + The XML definition of a moment (optional items are in []) is a bit simpler + because you do not need to specify the location: + + @code + <moment name="name" frame="BODY | LOCAL | WIND"> + + [<function> ... </function>] + + [<direction> <!-- optional initial direction vector --> + <x> {number} </x> + <y> {number} </y> + <z> {number} </z> + </direction>] + </moment> + @endcode + The initial direction can optionally be set by specifying a unit vector in the chosen frame (body, local, or wind). *************** *** 114,123 **** those could be handled in the calling application. ! The force direction is not actually required to be specified as a unit ! vector, but prior to the force vector being calculated, the direction ! vector is normalized when initialized. ! The direction can be specified at runtime through setting any/all of the ! following properties: @code --- 139,148 ---- those could be handled in the calling application. ! The force (or moment) direction is not actually required to be specified as ! a unit vector, but prior to the force (or moment) vector being calculated, ! the direction vector is normalized when initialized. ! The force direction can be specified at runtime through setting any/all of ! the following properties: @code *************** *** 127,133 **** @endcode However in that case, the direction is no longer normalized. ! When no <function> has been provided in the definition, the force magnitude can be specified through the following property: --- 152,167 ---- @endcode + The moment direction can be specified at runtime through setting any/all of + the following properties: + + @code + external_reactions/{moment name}/l + external_reactions/{moment name}/m + external_reactions/{moment name}/n + @endcode + However in that case, the direction is no longer normalized. ! When no <function> has been provided in the force definition, its magnitude can be specified through the following property: *************** *** 136,148 **** @endcode ! The location of the force vector, in structural coordinates, can be set at ! runtime through the following properties: @code ! external_reactions/{force name}/location-x-in ! external_reactions/{force name}/location-y-in ! external_reactions/{force name}/location-z-in @endcode - */ --- 170,179 ---- @endcode ! When no <function> has been provided in the moment definition, its magnitude ! can be specified through the following property: @code ! external_reactions/{moment name}/magnitude-lbsft @endcode */ *************** *** 190,194 **** @param el pointer to the XML element defining an individual force. */ ! FGExternalForce(FGFDMExec *FDMExec) : FGForce(FDMExec) { Debug(0); } /** Copy Constructor --- 221,227 ---- @param el pointer to the XML element defining an individual force. */ ! FGExternalForce(FGFDMExec *FDMExec) ! : FGForce(FDMExec), forceMagnitude(NULL), momentMagnitude(NULL) ! { Debug(0); } /** Copy Constructor *************** *** 201,204 **** --- 234,238 ---- void setForce(Element* el); + void setMoment(Element* el); const FGColumnVector3& GetBodyForces(void); *************** *** 208,213 **** std::string Name; ! FGParameter* forceMagnitude; ! FGPropertyVector3 forceDirection; void Debug(int from); }; --- 242,247 ---- std::string Name; ! FGParameter *forceMagnitude, *momentMagnitude; ! FGPropertyVector3 forceDirection, momentDirection; void Debug(int from); }; Index: FGExternalReactions.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** FGExternalReactions.cpp 4 Jun 2017 17:39:57 -0000 1.24 --- FGExternalReactions.cpp 4 Jun 2017 21:06:08 -0000 1.25 *************** *** 87,90 **** --- 87,99 ---- } + // Parse moment elements + + Element* moment_element = el->FindElement("moment"); + while (moment_element) { + Forces.push_back(new FGExternalForce(FDMExec)); + Forces.back()->setMoment(moment_element); + moment_element = el->FindNextElement("moment"); + } + PostLoad(el, PropertyManager); Index: FGExternalReactions.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** FGExternalReactions.h 3 Jun 2017 19:49:20 -0000 1.19 --- FGExternalReactions.h 4 Jun 2017 21:06:08 -0000 1.20 *************** *** 62,75 **** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** Manages the external and/or arbitrary forces. The external reactions capability in JSBSim really should be named ! "arbitrary forces", because this feature can be used to model a wide ! variety of forces that act on a vehicle. Some examples include: parachutes, ! catapult, arresting hook, and tow line. ! ! This class acts similarly to the other "manager classes" (FGPropulsion, ! FGFCS, FGGroundReactions, FGAerodynamics) because it manages collections ! of constituent forces. The individual forces are implemented with the ! FGExternalForce class. The format of the <em>optional</em> external reactions section in the config --- 62,76 ---- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** Manages the external and/or arbitrary forces and moments. ! The external reactions capability in JSBSim really should be named ! "arbitrary forces and moments", because this feature can be used to model a ! wide variety of forces and moments that act on a vehicle. Some examples ! include: parachutes, catapult, arresting hook, and tow line. ! ! This class acts similarly to the other "manager classes" (FGPropulsion, ! FGFCS, FGGroundReactions, FGAerodynamics) because it manages collections of ! constituent elements. The individual forces and moments are implemented with ! the FGExternalForce class. The format of the <em>optional</em> external reactions section in the config *************** *** 82,93 **** <property> ... </property> ! <force name="name" frame="BODY | LOCAL | WIND" unit="unit"> ... </force> ! <!-- Additional force definitions may follow --> ! <force name="name" frame="BODY | LOCAL | WIND" unit="unit"> ... </force> </external_reactions> --- 83,100 ---- <property> ... </property> ! <force name="name" frame="BODY | LOCAL | WIND"> ... </force> + <moment name="name" frame="BODY | LOCAL | WIND"> + ... + </moment> ! <!-- Additional force and moment definitions may follow --> ! <force name="name" frame="BODY | LOCAL | WIND"> ... </force> + <moment name="name" frame="BODY | LOCAL | WIND"> + ... + </moment> </external_reactions> *************** *** 95,114 **** See the FGExternalForce class for more information on the format of the ! force specification itself. ! When force elements are encountered in the configuration file, a new instance ! of the FGExternalForce class is created and a pointer to the class is pushed ! onto the Forces vector. ! This class is one of a few of the manager classes that allows properties ! to be "declared". In code, these are represented by the <em>interface_properties</em> vector. Properties that have not yet been created in an already parsed section of the configuration file and that are ! used in the definition of an external force should be declared in the ! external_reactions section because they will not be created automatically, ! and so would cause an error, since the property cannot be found to exist. ! See the FGExternalForce documentation for details on how forces are ! actually calculated. */ --- 102,122 ---- See the FGExternalForce class for more information on the format of the ! force and moment specifications. ! When force or moment elements are encountered in the configuration file, a ! new instance of the FGExternalForce class is created and a pointer to the ! class is pushed onto the Forces vector. ! This class is one of a few of the manager classes that allows properties to ! be "declared". In code, these are represented by the <em>interface_properties</em> vector. Properties that have not yet been created in an already parsed section of the configuration file and that are ! used in the definition of an external force or moment should be declared in ! the external_reactions section because they will not be created ! automatically, and so would cause an error, since the property cannot be ! found to exist. ! See the FGExternalForce documentation for details on how forces and moments ! are actually calculated. */ |
From: Bertrand <bco...@us...> - 2017-06-04 17:40:00
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30017/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h FGExternalReactions.cpp Log Message: Prepare the code for the addition of external moments (in addition to external forces). Also created FGPropertyVector3 to mimic FGColumnVector3 except that its components are properties rather than double. The idea is to save data duplication and prevent the use of FGPropertyManager::Tie() which is unfriendly with property listeners. Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** FGExternalForce.cpp 3 Jun 2017 19:49:20 -0000 1.20 --- FGExternalForce.cpp 4 Jun 2017 17:39:57 -0000 1.21 *************** *** 69,98 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGExternalForce::FGExternalForce(FGFDMExec *FDMExec, Element *el) ! : FGForce(FDMExec) { ! FGPropertyManager* PropertyManager = fdmex->GetPropertyManager(); ! Name = el->GetAttributeValue("name"); ! string BasePropertyName = "external_reactions/" + Name; ! ! // The value sent to the sim through the external_reactions/{force name}/magnitude ! // property will be multiplied against the unit vector, which can come in ! // initially in the direction vector. The frame in which the vector is defined ! // is specified with the frame attribute. The vector is normalized to magnitude 1. ! ! Element* function_element = el->FindElement("function"); ! if (function_element) { ! Magnitude = new FGFunction(PropertyManager, function_element); ! } else { ! string nodeName = BasePropertyName + "/magnitude"; ! FGPropertyNode* node = PropertyManager->GetNode(nodeName, true); ! Magnitude = new FGPropertyValue(node); ! } // Set frame (from FGForce). string sFrame = el->GetAttributeValue("frame"); if (sFrame.empty()) { cerr << el->ReadFrom() ! << "No frame specified for external force, \"" << Name << "\"." << endl << "Frame set to Body" << endl; ttype = tNone; --- 69,92 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGPropertyVector3::FGPropertyVector3(FGPropertyManager* pm, ! const std::string& baseName, ! const std::string& xcmp, ! const std::string& ycmp, ! const std::string& zcmp) { ! data[0] = pm->CreatePropertyObject<double>(baseName + "/" + xcmp); ! data[1] = pm->CreatePropertyObject<double>(baseName + "/" + ycmp); ! data[2] = pm->CreatePropertyObject<double>(baseName + "/" + zcmp); ! } + FGParameter* FGExternalForce::bind(Element *el, FGPropertyManager* pm, + const string& magName, FGPropertyVector3& v) + { // Set frame (from FGForce). string sFrame = el->GetAttributeValue("frame"); if (sFrame.empty()) { cerr << el->ReadFrom() ! << "No frame specified for external " << el->GetName() << ", \"" ! << Name << "\"." << endl << "Frame set to Body" << endl; ttype = tNone; *************** *** 105,113 **** } else { cerr << el->ReadFrom() ! << "Invalid frame specified for external force, \"" << Name << "\"." ! << endl << "Frame set to Body" << endl; ttype = tNone; } Element* location_element = el->FindElement("location"); if (!location_element) { --- 99,144 ---- } else { cerr << el->ReadFrom() ! << "Invalid frame specified for external " << el->GetName() << ", \"" ! << Name << "\"." << endl ! << "Frame set to Body" << endl; ttype = tNone; } + Element* direction_element = el->FindElement("direction"); + if (!direction_element) { + cerr << el->ReadFrom() + << "No direction element specified in " << el->GetName() + << " object. Default is (0,0,0)." << endl; + } else { + FGColumnVector3 direction = direction_element->FindElementTripletConvertTo("IN"); + direction.Normalize(); + v = direction; + } + + // The value sent to the sim through the external_reactions/{force name}/magnitude + // property will be multiplied against the unit vector, which can come in + // initially in the direction vector. The frame in which the vector is defined + // is specified with the frame attribute. The vector is normalized to magnitude 1. + + Element* function_element = el->FindElement("function"); + if (function_element) { + return new FGFunction(pm, function_element); + } else { + FGPropertyNode* node = pm->GetNode(magName, true); + return new FGPropertyValue(node); + } + } + + void FGExternalForce::setForce(Element *el) + { + FGPropertyManager* PropertyManager = fdmex->GetPropertyManager(); + Name = el->GetAttributeValue("name"); + string BasePropertyName = "external_reactions/" + Name; + + forceDirection = FGPropertyVector3(PropertyManager, BasePropertyName, + "x", "y", "z"); + forceMagnitude = bind(el, PropertyManager, BasePropertyName + "/magnitude", + forceDirection); + Element* location_element = el->FindElement("location"); if (!location_element) { *************** *** 124,146 **** PropertyManager->Tie( BasePropertyName + "/location-z-in", (FGForce*)this, &FGForce::GetLocationZ, &FGForce::SetLocationZ); - - Element* direction_element = el->FindElement("direction"); - if (!direction_element) { - cerr << el->ReadFrom() - << "No direction element specified in force object. Default is (0,0,0)." - << endl; - } else { - vDirection = direction_element->FindElementTripletConvertTo("IN"); - vDirection.Normalize(); - } - - PropertyManager->Tie(BasePropertyName + "/x", (FGExternalForce*)this, - &FGExternalForce::GetDirectionX, &FGExternalForce::SetDirectionX); - PropertyManager->Tie(BasePropertyName + "/y", (FGExternalForce*)this, - &FGExternalForce::GetDirectionY, &FGExternalForce::SetDirectionY); - PropertyManager->Tie(BasePropertyName + "/z", (FGExternalForce*)this, - &FGExternalForce::GetDirectionZ, &FGExternalForce::SetDirectionZ); - - Debug(0); } --- 155,158 ---- *************** *** 149,153 **** FGExternalForce::~FGExternalForce() { ! delete Magnitude; Debug(1); } --- 161,165 ---- FGExternalForce::~FGExternalForce() { ! delete forceMagnitude; Debug(1); } *************** *** 157,161 **** const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! vFn = Magnitude->GetValue() * vDirection; return FGForce::GetBodyForces(); } --- 169,173 ---- const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! vFn = forceMagnitude->GetValue() * forceDirection; return FGForce::GetBodyForces(); } Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGExternalForce.h 3 Jun 2017 19:49:20 -0000 1.17 --- FGExternalForce.h 4 Jun 2017 17:39:57 -0000 1.18 *************** *** 44,47 **** --- 44,48 ---- #include "models/propulsion/FGForce.h" #include "math/FGColumnVector3.h" + #include "simgear/props/propertyObject.hxx" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 59,62 **** --- 60,64 ---- class FGParameter; class Element; + class FGPropertyManager; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 149,152 **** --- 151,186 ---- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ + class FGPropertyVector3 + { + public: + FGPropertyVector3(void) {} + FGPropertyVector3(FGPropertyManager* pm, const std::string& baseName, + const std::string& xcmp, const std::string& ycmp, + const std::string& zcmp); + + FGPropertyVector3& operator=(const FGColumnVector3& v) { + data[0] = v(1); + data[1] = v(2); + data[2] = v(3); + + return *this; + } + + operator FGColumnVector3() const { + return FGColumnVector3(data[0], data[1], data[2]); + } + + FGColumnVector3 operator*(double a) const { + return FGColumnVector3(a * data[0], a * data[1], a * data[2]); + } + + private: + SGPropObjDouble data[3]; + }; + + inline FGColumnVector3 operator*(double a, const FGPropertyVector3& v) { + return v*a; + } + class FGExternalForce : public FGForce { *************** *** 156,160 **** @param el pointer to the XML element defining an individual force. */ ! FGExternalForce(FGFDMExec *FDMExec, Element *el); /** Copy Constructor --- 190,194 ---- @param el pointer to the XML element defining an individual force. */ ! FGExternalForce(FGFDMExec *FDMExec) : FGForce(FDMExec) { Debug(0); } /** Copy Constructor *************** *** 166,182 **** ~FGExternalForce(); const FGColumnVector3& GetBodyForces(void); - double GetDirectionX(void) const {return vDirection(eX);} - double GetDirectionY(void) const {return vDirection(eY);} - double GetDirectionZ(void) const {return vDirection(eZ);} - void SetDirectionX(double x) {vDirection(eX) = x;} - void SetDirectionY(double y) {vDirection(eY) = y;} - void SetDirectionZ(double z) {vDirection(eZ) = z;} private: std::string Name; ! FGParameter* Magnitude; ! FGColumnVector3 vDirection; void Debug(int from); }; --- 200,213 ---- ~FGExternalForce(); + void setForce(Element* el); const FGColumnVector3& GetBodyForces(void); private: + FGParameter* bind(Element* el, FGPropertyManager* pm, + const std::string& baseName, FGPropertyVector3& v); std::string Name; ! FGParameter* forceMagnitude; ! FGPropertyVector3 forceDirection; void Debug(int from); }; Index: FGExternalReactions.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** FGExternalReactions.cpp 3 Jun 2017 19:49:20 -0000 1.23 --- FGExternalReactions.cpp 4 Jun 2017 17:39:57 -0000 1.24 *************** *** 82,86 **** Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back( new FGExternalForce(FDMExec, force_element) ); force_element = el->FindNextElement("force"); } --- 82,87 ---- Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back(new FGExternalForce(FDMExec)); ! Forces.back()->setForce(force_element); force_element = el->FindNextElement("force"); } |
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16381/src/models/propulsion Modified Files: FGElectric.cpp FGForce.h FGPiston.cpp FGPropeller.cpp FGRocket.cpp FGThruster.cpp FGTurbine.cpp Log Message: Headers inclusion clean up. It should allow to reduce the compilation time (less source files recompiled) when some headers are modified. Index: FGElectric.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGElectric.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** FGElectric.cpp 27 Sep 2015 09:54:21 -0000 1.20 --- FGElectri |
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16381/src/models Modified Files: FGBuoyantForces.cpp FGExternalForce.cpp FGExternalForce.h FGExternalReactions.cpp FGExternalReactions.h FGGasCell.h Log Message: Headers inclusion clean up. It should allow to reduce the compilation time (less source files recompiled) when some headers are modified. Index: FGBuoyantForces.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGBuoyantForces.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** FGBuoyantForces.cpp 28 Mar 2015 14:49:02 -0000 1.30 --- FGBuoyantForces.cpp 3 Jun 2017 19:49:20 -0000 1.31 *************** *** 39,45 **** #include <iostream> #include "FGBuoyantForces.h" #include "FGMassBalance.h" - #include "input_output/FGPropertyManager.h" #include "input_output/FGXMLElement.h" --- 39,45 ---- #include <iostream> + #include "FGFDMExec.h" #include "FGBuoyantForces.h" #include "FGMassBalance.h" #include "input_output/FGXMLElement.h" Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** FGExternalForce.cpp 28 May 2017 19:01:49 -0000 1.19 --- FGExternalForce.cpp 3 Jun 2017 19:49:20 -0000 1.20 *************** *** 52,61 **** */ #include "FGExternalForce.h" #include "input_output/FGXMLElement.h" #include "math/FGPropertyValue.h" #include "math/FGFunction.h" - #include <iostream> using namespace std; --- 52,62 ---- */ + #include <iostream> + #include "FGFDMExec.h" #include "FGExternalForce.h" #include "input_output/FGXMLElement.h" #include "math/FGPropertyValue.h" #include "math/FGFunction.h" using namespace std; *************** *** 75,79 **** string BasePropertyName = "external_reactions/" + Name; ! // The value sent to the sim through the external_forces/{force name}/magnitude // property will be multiplied against the unit vector, which can come in // initially in the direction vector. The frame in which the vector is defined --- 76,80 ---- string BasePropertyName = "external_reactions/" + Name; ! // The value sent to the sim through the external_reactions/{force name}/magnitude // property will be multiplied against the unit vector, which can come in // initially in the direction vector. The frame in which the vector is defined Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** FGExternalForce.h 28 May 2017 19:01:49 -0000 1.16 --- FGExternalForce.h 3 Jun 2017 19:49:20 -0000 1.17 *************** *** 41,44 **** --- 41,45 ---- #include <string> + #include "models/propulsion/FGForce.h" #include "math/FGColumnVector3.h" *************** *** 57,60 **** --- 58,62 ---- class FGParameter; + class Element; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Index: FGExternalReactions.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** FGExternalReactions.cpp 26 May 2017 10:49:39 -0000 1.22 --- FGExternalReactions.cpp 3 Jun 2017 19:49:20 -0000 1.23 *************** *** 40,43 **** --- 40,44 ---- #include <string> + #include "FGExternalForce.h" #include "FGExternalReactions.h" #include "input_output/FGXMLElement.h" *************** *** 97,101 **** { for (unsigned int i=0; i<Forces.size(); i++) delete Forces[i]; - Forces.clear(); Debug(1); --- 98,101 ---- Index: FGExternalReactions.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** FGExternalReactions.h 26 May 2017 10:49:39 -0000 1.18 --- FGExternalReactions.h 3 Jun 2017 19:49:20 -0000 1.19 *************** *** 41,45 **** #include <vector> #include "FGModel.h" ! #include "FGExternalForce.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 41,45 ---- #include <vector> #include "FGModel.h" ! #include "math/FGColumnVector3.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% *************** *** 56,59 **** --- 56,60 ---- class Element; + class FGExternalForce; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Index: FGGasCell.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGGasCell.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** FGGasCell.h 28 Mar 2015 14:49:02 -0000 1.16 --- FGGasCell.h 3 Jun 2017 19:49:20 -0000 1.17 *************** *** 60,64 **** class FGBallonet; ! class Element; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 60,64 ---- class FGBallonet; ! class FGMassBalance; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
From: Bertrand <bco...@us...> - 2017-06-03 12:06:17
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18048/src/models Modified Files: FGLGear.cpp FGSurface.cpp Log Message: Fixes to the trim on ground feature. * Skip the gears when located over water. They will be skipped by the ground reactions anyway making the trim irrelevant. * Ignore the ground bumpiness during the trim. The trim algorithm seems not to be robust enough to handle that. This does not make much difference to the converged solution anyway since the bumpiness is generally low. * Fixed the WOW status for contacts over water (was 'false' is now 'true'). * All the gear/contact data are now properly reset when WOW==false. The reset code is now common to all the case where WOW is false. Index: FGLGear.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGLGear.cpp,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -r1.125 -r1.126 *** FGLGear.cpp 21 Feb 2017 21:14:13 -0000 1.125 --- FGLGear.cpp 3 Jun 2017 12:06:14 -0000 1.126 *************** *** 299,303 **** // Does this surface contact point interact with another surface? if (surface) { ! height -= (*surface).GetBumpHeight(); staticFFactor = (*surface).GetStaticFFactor(); rollingFFactor = (*surface).GetRollingFFactor(); --- 299,304 ---- // Does this surface contact point interact with another surface? if (surface) { ! if (!fdmex->GetTrimStatus()) ! height -= (*surface).GetBumpHeight(); staticFFactor = (*surface).GetStaticFFactor(); rollingFFactor = (*surface).GetRollingFFactor(); *************** *** 306,311 **** } if (height < 0.0) { ! WOW = isSolid; vGroundNormal = in.Tec2b * normal; --- 307,315 ---- } + FGColumnVector3 vWhlDisplVec; + double LGearProj = 1.0; + if (height < 0.0) { ! WOW = true; vGroundNormal = in.Tec2b * normal; *************** *** 315,320 **** // direction to the ground (STRUCTURE) double normalZ = (in.Tec2l*normal)(eZ); ! double LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ); ! FGColumnVector3 vWhlDisplVec; // The following equations use the vector to the tire contact patch --- 319,323 ---- // direction to the ground (STRUCTURE) double normalZ = (in.Tec2l*normal)(eZ); ! LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ); // The following equations use the vector to the tire contact patch *************** *** 327,332 **** } else { // Gears don't (or hardly) compress in liquids ! compressLength = 0.0; ! vWhlDisplVec = 0.0 * vGroundNormal; } break; --- 330,334 ---- } else { // Gears don't (or hardly) compress in liquids ! WOW = false; } break; *************** *** 336,352 **** break; } FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec; vActingXYZn = vXYZn + Tb2s * vWhlDisplVec; FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec; vBodyWhlVel += in.UVW - in.Tec2b * terrainVel; ! ! if (isSolid) { ! vWhlVelVec = mTGear.Transposed() * vBodyWhlVel; ! } else { ! // wheels don't spin up in liquids: let wheel spin down slowly ! vWhlVelVec(eX) -= 13.0 * in.TotalDeltaT; ! if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0; ! } InitializeReporting(); --- 338,351 ---- break; } + } + else + WOW = false; + if (WOW) { FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec; vActingXYZn = vXYZn + Tb2s * vWhlDisplVec; FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec; vBodyWhlVel += in.UVW - in.Tec2b * terrainVel; ! vWhlVelVec = mTGear.Transposed() * vBodyWhlVel; InitializeReporting(); *************** *** 376,387 **** // forces calculations. ComputeJacobian(vWhlContactVec); - } else { // Gear is NOT compressed - - WOW = false; compressLength = 0.0; compressSpeed = 0.0; WheelSlip = 0.0; StrutForce = 0.0; LMultiplier[ftRoll].value = 0.0; --- 375,384 ---- // forces calculations. ComputeJacobian(vWhlContactVec); } else { // Gear is NOT compressed compressLength = 0.0; compressSpeed = 0.0; WheelSlip = 0.0; StrutForce = 0.0; + vWhlDisplVec.InitMatrix(); LMultiplier[ftRoll].value = 0.0; *************** *** 398,406 **** ResetReporting(); } - - } else if (gearPos < 0.01) { // Gear UP - - WOW = false; - vWhlVelVec.InitMatrix(); } --- 395,398 ---- Index: FGSurface.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGSurface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** FGSurface.cpp 28 Jan 2014 09:42:21 -0000 1.5 --- FGSurface.cpp 3 Jun 2017 12:06:14 -0000 1.6 *************** *** 80,83 **** --- 80,86 ---- bumpiness = 0.0; isSolid = true; + pos[0] = 0.0; + pos[1] = 0.0; + pos[2] = 0.0; } |
From: Bertrand <bco...@us...> - 2017-06-03 12:06:17
|
Update of /cvsroot/jsbsim/JSBSim/src/initialization In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18048/src/initialization Modified Files: FGTrim.cpp Log Message: Fixes to the trim on ground feature. * Skip the gears when located over water. They will be skipped by the ground reactions anyway making the trim irrelevant. * Ignore the ground bumpiness during the trim. The trim algorithm seems not to be robust enough to handle that. This does not make much difference to the converged solution anyway since the bumpiness is generally low. * Fixed the WOW status for contacts over water (was 'false' is now 'true'). * All the gear/contact data are now properly reset when WOW==false. The reset code is now common to all the case where WOW is false. Index: FGTrim.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/initialization/FGTrim.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** FGTrim.cpp 12 Jun 2016 09:09:02 -0000 1.34 --- FGTrim.cpp 3 Jun 2017 12:06:14 -0000 1.35 *************** *** 403,408 **** FGLocation lDummy; double height = gearLoc.GetContactPoint(lDummy, normal, vDummy, vDummy); - c.normal = Tec2b * normal; contacts.push_back(c); --- 403,411 ---- FGLocation lDummy; double height = gearLoc.GetContactPoint(lDummy, normal, vDummy, vDummy); + if (gear->IsBogey() && !GroundReactions->GetSolid()) + continue; + + c.normal = Tec2b * normal; contacts.push_back(c); |
From: Erik H. <eh...@us...> - 2017-05-30 07:41:14
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++ In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15415 Modified Files: Aircraft.cpp Log Message: Remove the roll tendency when starting the ground loop: The reynolds numbers based Roll moment due to beta was trying to get the aircraft into a stall even with weight on wheels |
From: Erik H. <eh...@us...> - 2017-05-30 07:41:14
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15415/Systems Modified Files: Controls.cpp Log Message: Remove the roll tendency when starting the ground loop: The reynolds numbers based Roll moment due to beta was trying to get the aircraft into a stall even with weight on wheels Index: Controls.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Controls.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** Controls.cpp 24 Nov 2016 09:59:34 -0000 1.50 --- Controls.cpp 30 May 2017 07:41:11 -0000 1.51 *************** *** 659,662 **** --- 659,665 ---- file << " <property>aero/beta-rad</property>" << std::endl; + if (_aircraft->_Clbeta.size() > 1) { + file << " <property>fcs/gear-no-wow</property>" << std::endl; + } file << _print_vector(_aircraft->_Clbeta); |
From: Bertrand <bco...@us...> - 2017-05-28 19:01:52
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1380/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h Log Message: More code clean up and some documentation update. Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** FGExternalForce.cpp 26 May 2017 12:25:40 -0000 1.18 --- FGExternalForce.cpp 28 May 2017 19:01:49 -0000 1.19 *************** *** 55,58 **** --- 55,60 ---- #include "FGExternalForce.h" #include "input_output/FGXMLElement.h" + #include "math/FGPropertyValue.h" + #include "math/FGFunction.h" #include <iostream> *************** *** 69,85 **** : FGForce(FDMExec) { - Element* location_element=0; - Element* direction_element=0; - Element* function_element=0; - string sFrame; - string BasePropertyName; - FGColumnVector3 location; - Magnitude_Function = 0; - magnitude = 0.0; - azimuth = 0.0; - FGPropertyManager* PropertyManager = fdmex->GetPropertyManager(); Name = el->GetAttributeValue("name"); ! BasePropertyName = "external_reactions/" + Name; // The value sent to the sim through the external_forces/{force name}/magnitude --- 71,77 ---- : FGForce(FDMExec) { FGPropertyManager* PropertyManager = fdmex->GetPropertyManager(); Name = el->GetAttributeValue("name"); ! string BasePropertyName = "external_reactions/" + Name; // The value sent to the sim through the external_forces/{force name}/magnitude *************** *** 88,104 **** // is specified with the frame attribute. The vector is normalized to magnitude 1. ! function_element = el->FindElement("function"); if (function_element) { ! Magnitude_Function = new FGFunction(PropertyManager, function_element); } else { ! PropertyManager->Tie( BasePropertyName + "/magnitude",(FGExternalForce*)this, &FGExternalForce::GetMagnitude, &FGExternalForce::SetMagnitude); } - // Set frame (from FGForce). ! sFrame = el->GetAttributeValue("frame"); if (sFrame.empty()) { ! cerr << "No frame specified for external force, \"" << Name << "\"." << endl; ! cerr << "Frame set to Body" << endl; ttype = tNone; } else if (sFrame == "BODY") { --- 80,98 ---- // is specified with the frame attribute. The vector is normalized to magnitude 1. ! Element* function_element = el->FindElement("function"); if (function_element) { ! Magnitude = new FGFunction(PropertyManager, function_element); } else { ! string nodeName = BasePropertyName + "/magnitude"; ! FGPropertyNode* node = PropertyManager->GetNode(nodeName, true); ! Magnitude = new FGPropertyValue(node); } // Set frame (from FGForce). ! string sFrame = el->GetAttributeValue("frame"); if (sFrame.empty()) { ! cerr << el->ReadFrom() ! << "No frame specified for external force, \"" << Name << "\"." << endl ! << "Frame set to Body" << endl; ttype = tNone; } else if (sFrame == "BODY") { *************** *** 106,126 **** } else if (sFrame == "LOCAL") { ttype = tLocalBody; - PropertyManager->Tie( BasePropertyName + "/azimuth", (FGExternalForce*)this, &FGExternalForce::GetAzimuth, &FGExternalForce::SetAzimuth); } else if (sFrame == "WIND") { ttype = tWindBody; } else { ! cerr << "Invalid frame specified for external force, \"" << Name << "\"." << endl; ! cerr << "Frame set to Body" << endl; ttype = tNone; } - PropertyManager->Tie( BasePropertyName + "/x", (FGExternalForce*)this, &FGExternalForce::GetX, &FGExternalForce::SetX); - PropertyManager->Tie( BasePropertyName + "/y", (FGExternalForce*)this, &FGExternalForce::GetY, &FGExternalForce::SetY); - PropertyManager->Tie( BasePropertyName + "/z", (FGExternalForce*)this, &FGExternalForce::GetZ, &FGExternalForce::SetZ); ! location_element = el->FindElement("location"); if (!location_element) { ! cerr << "No location element specified in force object." << endl; } else { ! location = location_element->FindElementTripletConvertTo("IN"); SetLocation(location); } --- 100,118 ---- } else if (sFrame == "LOCAL") { ttype = tLocalBody; } else if (sFrame == "WIND") { ttype = tWindBody; } else { ! cerr << el->ReadFrom() ! << "Invalid frame specified for external force, \"" << Name << "\"." ! << endl << "Frame set to Body" << endl; ttype = tNone; } ! Element* location_element = el->FindElement("location"); if (!location_element) { ! cerr << el->ReadFrom() ! << "No location element specified in force object." << endl; } else { ! FGColumnVector3 location = location_element->FindElementTripletConvertTo("IN"); SetLocation(location); } *************** *** 132,138 **** &FGForce::GetLocationZ, &FGForce::SetLocationZ); ! direction_element = el->FindElement("direction"); if (!direction_element) { ! cerr << "No direction element specified in force object. Default is (0,0,0)." << endl; } else { vDirection = direction_element->FindElementTripletConvertTo("IN"); --- 124,132 ---- &FGForce::GetLocationZ, &FGForce::SetLocationZ); ! Element* direction_element = el->FindElement("direction"); if (!direction_element) { ! cerr << el->ReadFrom() ! << "No direction element specified in force object. Default is (0,0,0)." ! << endl; } else { vDirection = direction_element->FindElementTripletConvertTo("IN"); *************** *** 140,143 **** --- 134,144 ---- } + PropertyManager->Tie(BasePropertyName + "/x", (FGExternalForce*)this, + &FGExternalForce::GetDirectionX, &FGExternalForce::SetDirectionX); + PropertyManager->Tie(BasePropertyName + "/y", (FGExternalForce*)this, + &FGExternalForce::GetDirectionY, &FGExternalForce::SetDirectionY); + PropertyManager->Tie(BasePropertyName + "/z", (FGExternalForce*)this, + &FGExternalForce::GetDirectionZ, &FGExternalForce::SetDirectionZ); + Debug(0); } *************** *** 147,151 **** FGExternalForce::~FGExternalForce() { ! delete Magnitude_Function; Debug(1); } --- 148,152 ---- FGExternalForce::~FGExternalForce() { ! delete Magnitude; Debug(1); } *************** *** 153,171 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - void FGExternalForce::SetMagnitude(double mag) - { - magnitude = mag; - vFn = vDirection*mag; - } - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! if (Magnitude_Function) { ! double mag = Magnitude_Function->GetValue(); ! SetMagnitude(mag); ! } ! return FGForce::GetBodyForces(); } --- 154,160 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% const FGColumnVector3& FGExternalForce::GetBodyForces(void) { ! vFn = Magnitude->GetValue() * vDirection; return FGForce::GetBodyForces(); } Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** FGExternalForce.h 26 May 2017 12:25:40 -0000 1.15 --- FGExternalForce.h 28 May 2017 19:01:49 -0000 1.16 *************** *** 8,14 **** This program is free software; you can redistribute it and/or modify it under ! the terms of the GNU Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) any later ! version. This program is distributed in the hope that it will be useful, but WITHOUT --- 8,14 ---- This program is free software; you can redistribute it and/or modify it under ! the terms of the GNU Lesser General Public License as published by the Free ! Software Foundation; either version 2 of the License, or (at your option) any ! later version. This program is distributed in the hope that it will be useful, but WITHOUT *************** *** 17,26 **** details. ! You should have received a copy of the GNU Lesser General Public License along with ! this program; if not, write to the Free Software Foundation, Inc., 59 Temple ! Place - Suite 330, Boston, MA 02111-1307, USA. ! Further information about the GNU Lesser General Public License can also be found on ! the world wide web at http://www.gnu.org. --- 17,26 ---- details. ! You should have received a copy of the GNU Lesser General Public License along ! with this program; if not, write to the Free Software Foundation, Inc., 59 ! Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! Further information about the GNU Lesser General Public License can also be ! found on the world wide web at http://www.gnu.org. *************** *** 41,50 **** #include <string> - #include "FGFDMExec.h" - #include "FGJSBBase.h" #include "models/propulsion/FGForce.h" - #include "input_output/FGPropertyManager.h" #include "math/FGColumnVector3.h" - #include "math/FGFunction.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 41,46 ---- *************** *** 60,63 **** --- 56,61 ---- namespace JSBSim { + class FGParameter; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DOCUMENTATION *************** *** 67,71 **** This class encapsulates an individual force applied at the specified location on the vehicle, and oriented as specified in one of three frames: ! - BODY frame is defined with the X axis positive forward, the Y axis positive out the right wing, and the Z axis completing the set --- 65,69 ---- This class encapsulates an individual force applied at the specified location on the vehicle, and oriented as specified in one of three frames: ! - BODY frame is defined with the X axis positive forward, the Y axis positive out the right wing, and the Z axis completing the set *************** *** 81,92 **** from this WIND frame. ! Much of the substance of this class is located in the FGForce base class, from ! which this class is derived. ! Here is the XML definition of a force (optional items are in []): ! @code <force name="name" frame="BODY | LOCAL | WIND"> ! [<function> ... </function>] --- 79,90 ---- from this WIND frame. ! Much of the substance of this class is located in the FGForce base class, ! from which this class is derived. ! Here is the XML definition of a force (optional items are in []): ! @code <force name="name" frame="BODY | LOCAL | WIND"> ! [<function> ... </function>] *************** *** 105,125 **** The initial direction can optionally be set by specifying a unit vector ! in the chosen frame (body, local, or wind). The direction is specified ! at runtime through setting any/all of the following properties: ! ! @code ! external_reactions/{force name}/x ! external_reactions/{force name}/y ! external_reactions/{force name}/z ! @endcode ! As an example, a parachute can be defined oriented in the wind axis frame so the drag always acts in the drag direction - opposite the positive X axis. That does not include the effects of parachute oscillations, but those could be handled in the calling application. ! The force direction is not actually required to be specified as a unit vector, but prior to the force vector being calculated, the direction ! vector is normalized. The location of the force vector, in structural coordinates, can be set at --- 103,134 ---- The initial direction can optionally be set by specifying a unit vector ! in the chosen frame (body, local, or wind). ! As an example, a parachute can be defined oriented in the wind axis frame so the drag always acts in the drag direction - opposite the positive X axis. That does not include the effects of parachute oscillations, but those could be handled in the calling application. ! The force direction is not actually required to be specified as a unit vector, but prior to the force vector being calculated, the direction ! vector is normalized when initialized. ! ! The direction can be specified at runtime through setting any/all of the ! following properties: ! ! @code ! external_reactions/{force name}/x ! external_reactions/{force name}/y ! external_reactions/{force name}/z ! @endcode ! ! However in that case, the direction is no longer normalized. ! ! When no <function> has been provided in the definition, the force magnitude ! can be specified through the following property: ! ! @code ! external_reactions/{force name}/magnitude ! @endcode The location of the force vector, in structural coordinates, can be set at *************** *** 131,135 **** external_reactions/{force name}/location-z-in @endcode ! */ --- 140,144 ---- external_reactions/{force name}/location-z-in @endcode ! */ *************** *** 144,148 **** @param FDMExec pointer to the main executive class. @param el pointer to the XML element defining an individual force. - @param index the position of this force object in the whole list. */ FGExternalForce(FGFDMExec *FDMExec, Element *el); --- 153,156 ---- *************** *** 156,182 **** ~FGExternalForce(); - void SetMagnitude(double mag); - void SetAzimuth(double az) {azimuth = az;} - const FGColumnVector3& GetBodyForces(void); ! double GetMagnitude(void) const {return magnitude;} ! double GetAzimuth(void) const {return azimuth;} ! double GetX(void) const {return vDirection(eX);} ! double GetY(void) const {return vDirection(eY);} ! double GetZ(void) const {return vDirection(eZ);} ! void SetX(double x) {vDirection(eX) = x;} ! void SetY(double y) {vDirection(eY) = y;} ! void SetZ(double z) {vDirection(eZ) = z;} private: std::string Name; ! FGFunction* Magnitude_Function; FGColumnVector3 vDirection; - double magnitude; - double azimuth; void Debug(int from); }; } #endif - --- 164,182 ---- ~FGExternalForce(); const FGColumnVector3& GetBodyForces(void); ! double GetDirectionX(void) const {return vDirection(eX);} ! double GetDirectionY(void) const {return vDirection(eY);} ! double GetDirectionZ(void) const {return vDirection(eZ);} ! void SetDirectionX(double x) {vDirection(eX) = x;} ! void SetDirectionY(double y) {vDirection(eY) = y;} ! void SetDirectionZ(double z) {vDirection(eZ) = z;} private: std::string Name; ! FGParameter* Magnitude; FGColumnVector3 vDirection; void Debug(int from); }; } #endif |
From: Bertrand <bco...@us...> - 2017-05-26 12:25:43
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25766/src/models/propulsion Modified Files: FGForce.cpp FGForce.h FGPropeller.cpp Log Message: More code clean up: removed unused and outdated copy constructors (they did not copy all the members anyway). Moved data from members to local where applicable. Index: FGForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGForce.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** FGForce.cpp 13 Jan 2014 10:46:10 -0000 1.19 --- FGForce.cpp 26 May 2017 12:25:40 -0000 1.20 *************** *** 65,69 **** vFn.InitMatrix(); vMn.InitMatrix(); - vH.InitMatrix(); vOrient.InitMatrix(); vXYZn.InitMatrix(); --- 65,68 ---- *************** *** 72,76 **** vFb.InitMatrix(); vM.InitMatrix(); - vDXYZ.InitMatrix(); mT.InitMatrix(1., 0., 0., --- 71,74 ---- *************** *** 98,102 **** // CG and RP values are in inches ! vDXYZ = fdmex->GetMassBalance()->StructuralToBody(vActingXYZn); vM = vMn + vDXYZ*vFb; --- 96,100 ---- // CG and RP values are in inches ! FGColumnVector3 vDXYZ = fdmex->GetMassBalance()->StructuralToBody(vActingXYZn); vM = vMn + vDXYZ*vFb; Index: FGForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGForce.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGForce.h 1 Apr 2012 17:05:51 -0000 1.17 --- FGForce.h 26 May 2017 12:25:40 -0000 1.18 *************** *** 228,237 **** /// Constructor FGForce(FGFDMExec *FDMExec); ! FGForce(const FGForce& force) { ! vFn = force.vFn; ! vXYZn = force.vXYZn; ! ttype = force.ttype; ! fdmex = force.fdmex; ! } /// Destructor ~FGForce(); --- 228,233 ---- /// Constructor FGForce(FGFDMExec *FDMExec); ! FGForce(const FGForce& force); ! /// Destructor ~FGForce(); *************** *** 317,321 **** FGColumnVector3 vFn; FGColumnVector3 vMn; - FGColumnVector3 vH; FGColumnVector3 vOrient; TransformType ttype; --- 313,316 ---- *************** *** 327,331 **** FGColumnVector3 vFb; FGColumnVector3 vM; - FGColumnVector3 vDXYZ; void Debug(int from); --- 322,325 ---- Index: FGPropeller.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPropeller.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** FGPropeller.cpp 22 Mar 2017 21:27:47 -0000 1.61 --- FGPropeller.cpp 26 May 2017 12:25:40 -0000 1.62 *************** *** 147,151 **** RPM = 0; vTorque.InitMatrix(); - vH.InitMatrix(); D4 = Diameter*Diameter*Diameter*Diameter; D5 = D4*Diameter; --- 147,150 ---- *************** *** 274,278 **** // FGForce::GetBodyForces() function. ! vH(eX) = Ixx*omega*Sense*Sense_multiplier; if (omega > 0.0) ExcessTorque = PowerAvailable / omega; --- 273,277 ---- // FGForce::GetBodyForces() function. ! FGColumnVector3 vH(Ixx*omega*Sense*Sense_multiplier, 0.0, 0.0); if (omega > 0.0) ExcessTorque = PowerAvailable / omega; |
From: Bertrand <bco...@us...> - 2017-05-26 12:25:43
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25766/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h Log Message: More code clean up: removed unused and outdated copy constructors (they did not copy all the members anyway). Moved data from members to local where applicable. Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGExternalForce.cpp 26 May 2017 10:49:39 -0000 1.17 --- FGExternalForce.cpp 26 May 2017 12:25:40 -0000 1.18 *************** *** 142,156 **** Debug(0); } - - //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - // Copy constructor - - FGExternalForce::FGExternalForce(const FGExternalForce& extForce) : FGForce(extForce) - { - magnitude = extForce.magnitude; - Frame = extForce.Frame; - vDirection = extForce.vDirection; - Name = extForce.Name; - } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- 142,145 ---- *************** *** 208,213 **** if (from == 0) { // Constructor cout << " " << Name << endl; ! cout << " Frame: " << Frame << endl; ! cout << " Location: (" << vXYZn(eX) << ", " << vXYZn(eY) << ", " << vXYZn(eZ) << ")" << endl; } } --- 197,215 ---- if (from == 0) { // Constructor cout << " " << Name << endl; ! cout << " Frame: "; ! switch(ttype) { ! case tNone: ! cout << "BODY"; ! break; ! case tLocalBody: ! cout << "LOCAL"; ! break; ! case tWindBody: ! cout << "WIND"; ! break; ! default: ! cout << "ERROR/UNKNOWN"; ! } ! cout << endl << " Location: (" << vXYZn(eX) << ", " << vXYZn(eY) << ", " << vXYZn(eZ) << ")" << endl; } } Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** FGExternalForce.h 26 May 2017 10:49:39 -0000 1.14 --- FGExternalForce.h 26 May 2017 12:25:40 -0000 1.15 *************** *** 143,151 **** /** Constructor. @param FDMExec pointer to the main executive class. - */ - FGExternalForce(FGFDMExec *FDMExec); - - /** Constructor. - @param FDMExec pointer to the main executive class. @param el pointer to the XML element defining an individual force. @param index the position of this force object in the whole list. --- 143,146 ---- *************** *** 176,180 **** private: - std::string Frame; std::string Name; FGFunction* Magnitude_Function; --- 171,174 ---- |
From: Bertrand <bco...@us...> - 2017-05-26 10:49:43
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21785/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h FGExternalReactions.cpp FGExternalReactions.h Log Message: Code clean up: remove duplicate methods FGExternalForce::GetLoc[XYZ] and deprecated FGExternalReactions members Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** FGExternalForce.cpp 18 Dec 2014 09:56:05 -0000 1.16 --- FGExternalForce.cpp 26 May 2017 10:49:39 -0000 1.17 *************** *** 66,70 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGExternalForce::FGExternalForce(FGFDMExec *FDMExec, Element *el, int index) : FGForce(FDMExec) { --- 66,70 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGExternalForce::FGExternalForce(FGFDMExec *FDMExec, Element *el) : FGForce(FDMExec) { *************** *** 125,131 **** SetLocation(location); } ! PropertyManager->Tie( BasePropertyName + "/location-x-in", (FGExternalForce*)this, &FGExternalForce::GetLocX, &FGExternalForce::SetLocX); ! PropertyManager->Tie( BasePropertyName + "/location-y-in", (FGExternalForce*)this, &FGExternalForce::GetLocY, &FGExternalForce::SetLocY); ! PropertyManager->Tie( BasePropertyName + "/location-z-in", (FGExternalForce*)this, &FGExternalForce::GetLocZ, &FGExternalForce::SetLocZ); direction_element = el->FindElement("direction"); --- 125,134 ---- SetLocation(location); } ! PropertyManager->Tie( BasePropertyName + "/location-x-in", (FGForce*)this, ! &FGForce::GetLocationX, &FGForce::SetLocationX); ! PropertyManager->Tie( BasePropertyName + "/location-y-in", (FGForce*)this, ! &FGForce::GetLocationY, &FGForce::SetLocationY); ! PropertyManager->Tie( BasePropertyName + "/location-z-in", (FGForce*)this, ! &FGForce::GetLocationZ, &FGForce::SetLocationZ); direction_element = el->FindElement("direction"); Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** FGExternalForce.h 25 Nov 2014 01:44:17 -0000 1.13 --- FGExternalForce.h 26 May 2017 10:49:39 -0000 1.14 *************** *** 127,133 **** @code ! external_reactions/{force name}/locx ! external_reactions/{force name}/locy ! external_reactions/{force name}/locz @endcode --- 127,133 ---- @code ! external_reactions/{force name}/location-x-in ! external_reactions/{force name}/location-y-in ! external_reactions/{force name}/location-z-in @endcode *************** *** 151,155 **** @param index the position of this force object in the whole list. */ ! FGExternalForce(FGFDMExec *FDMExec, Element *el, int index); /** Copy Constructor --- 151,155 ---- @param index the position of this force object in the whole list. */ ! FGExternalForce(FGFDMExec *FDMExec, Element *el); /** Copy Constructor *************** *** 173,183 **** void SetY(double y) {vDirection(eY) = y;} void SetZ(double z) {vDirection(eZ) = z;} ! double GetLocX(void) const {return vActingXYZn(eX);} ! double GetLocY(void) const {return vActingXYZn(eY);} ! double GetLocZ(void) const {return vActingXYZn(eZ);} ! void SetLocX(double x) {vXYZn(eX) = x; vActingXYZn(eX) = x;} ! void SetLocY(double y) {vXYZn(eY) = y; vActingXYZn(eY) = y;} ! void SetLocZ(double z) {vXYZn(eZ) = z; vActingXYZn(eZ) = z;} ! private: --- 173,177 ---- void SetY(double y) {vDirection(eY) = y;} void SetZ(double z) {vDirection(eZ) = z;} ! private: Index: FGExternalReactions.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** FGExternalReactions.cpp 31 Jan 2015 14:56:21 -0000 1.21 --- FGExternalReactions.cpp 26 May 2017 10:49:39 -0000 1.22 *************** *** 64,69 **** FGExternalReactions::FGExternalReactions(FGFDMExec* fdmex) : FGModel(fdmex) { - NoneDefined = true; - Debug(0); } --- 64,67 ---- *************** *** 81,90 **** // Parse force elements - int index=0; Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back( new FGExternalForce(FDMExec, force_element, index) ); ! NoneDefined = false; ! index++; force_element = el->FindNextElement("force"); } --- 79,85 ---- // Parse force elements Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back( new FGExternalForce(FDMExec, force_element) ); force_element = el->FindNextElement("force"); } *************** *** 92,96 **** PostLoad(el, PropertyManager); ! if (!NoneDefined) bind(); return true; --- 87,91 ---- PostLoad(el, PropertyManager); ! if (!Forces.empty()) bind(); return true; *************** *** 125,129 **** if (FGModel::Run(Holding)) return true; if (Holding) return false; // if paused don't execute ! if (NoneDefined) return true; RunPreFunctions(); --- 120,124 ---- if (FGModel::Run(Holding)) return true; if (Holding) return false; // if paused don't execute ! if (Forces.empty()) return true; RunPreFunctions(); Index: FGExternalReactions.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGExternalReactions.h 27 Feb 2015 20:36:47 -0000 1.17 --- FGExternalReactions.h 26 May 2017 10:49:39 -0000 1.18 *************** *** 168,173 **** FGColumnVector3 vTotalMoments; - bool NoneDefined; - void bind(void); void Debug(int from); --- 168,171 ---- |
From: Bertrand <bco...@us...> - 2017-05-26 09:44:51
|
Update of /cvsroot/jsbsim/JSBSim/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18951/tests Modified Files: CMakeLists.txt jsbsim.pxd jsbsim.pyx Added Files: TestExternalReactions.py Log Message: Added a new test to check external reactions --- NEW FILE --- # TestExternalReactions.py # # Regression test to check that external reactions are working correctly. # # Copyright (c) 2017 Bertrand Coconnier # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, see <http://www.gnu.org/licenses/> # import os, math import numpy as np from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest class TestExternalReactions(JSBSimTestCase): def getLeverArm(self, fdm, name): lax = (fdm['external_reactions/'+name+'/location-x-in'] - fdm['inertia/cg-x-in']) lay = (fdm['external_reactions/'+name+'/location-y-in'] - fdm['inertia/cg-y-in']) laz = (fdm['external_reactions/'+name+'/location-z-in'] - fdm['inertia/cg-z-in']) # Convert from inches in the structural frame to feet in the body frame. return np.array([-lax, lay, -laz]) * 0.08333333 def test_wind_frame(self): script_path = self.sandbox.path_to_jsbsim_file('scripts', 'ball_chute.xml') fdm = CreateFDM(self.sandbox) fdm.load_script(script_path) fdm.run_ic() self.assertAlmostEqual(fdm['external_reactions/parachute/location-x-in'], 12.0) self.assertAlmostEqual(fdm['external_reactions/parachute/location-y-in'], 0.0) self.assertAlmostEqual(fdm['external_reactions/parachute/location-z-in'], 0.0) self.assertAlmostEqual(fdm['external_reactions/parachute/x'], -1.0) self.assertAlmostEqual(fdm['external_reactions/parachute/y'], 0.0) self.assertAlmostEqual(fdm['external_reactions/parachute/z'], 0.0) while fdm.run(): Tw2b = fdm.get_auxiliary().get_Tw2b() mag = fdm['aero/qbar-psf'] * fdm['fcs/parachute_reef_pos_norm']*20.0 f = Tw2b * np.mat([-1.0, 0.0, 0.0]).T * mag self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], f[0, 0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], f[1, 0]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], f[2, 0]) m = np.cross(self.getLeverArm(fdm,'parachute'), np.array([f[0,0], f[1,0], f[2, 0]])) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0]) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) def test_body_frame(self): fdm = CreateFDM(self.sandbox) aircraft_path = self.sandbox.path_to_jsbsim_file('aircraft') fdm.load_model('f16') aircraft_path = os.path.join(aircraft_path, 'f16') fdm.load_ic(os.path.join(aircraft_path, 'reset00.xml'), False) fdm.run_ic() self.assertAlmostEqual(fdm['external_reactions/pushback/location-x-in'], -2.98081) self.assertAlmostEqual(fdm['external_reactions/pushback/location-y-in'], 0.0) self.assertAlmostEqual(fdm['external_reactions/pushback/location-z-in'], -1.9683) self.assertAlmostEqual(fdm['external_reactions/pushback/x'], 1.0) self.assertAlmostEqual(fdm['external_reactions/pushback/y'], 0.0) self.assertAlmostEqual(fdm['external_reactions/pushback/z'], 0.0) self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], 0.0) self.assertAlmostEqual(fdm['external_reactions/hook/location-x-in'], 100.669) self.assertAlmostEqual(fdm['external_reactions/hook/location-y-in'], 0.0) self.assertAlmostEqual(fdm['external_reactions/hook/location-z-in'], -28.818) dx = -0.9995 dz = 0.01 fhook = np.array([dx, 0.0, dz]) fhook /= np.linalg.norm(fhook) self.assertAlmostEqual(fdm['external_reactions/hook/x'], fhook[0]) self.assertAlmostEqual(fdm['external_reactions/hook/y'], fhook[1]) self.assertAlmostEqual(fdm['external_reactions/hook/z'], fhook[2]) self.assertAlmostEqual(fdm['external_reactions/hook/magnitude'], 0.0) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], 0.0) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], 0.0) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], 0.0) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], 0.0) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], 0.0) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], 0.0) # Check the 'pushback' external force alone fdm['/sim/model/pushback/position-norm'] = 1.0 fdm['/sim/model/pushback/target-speed-fps'] = 1.0 fdm['/sim/model/pushback/kp'] = 0.05 fdm.run() fpb = np.array([1.0, 0.0, 0.0]) * 0.05 self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], 0.05) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], fpb[0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], fpb[1]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], fpb[2]) m = np.cross(self.getLeverArm(fdm, 'pushback'), fpb) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0]) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) # Reset the 'pushback' external force to zero fdm['/sim/model/pushback/position-norm'] = 0.0 fdm.run() self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], 0.0) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], 0.0) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], 0.0) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], 0.0) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], 0.0) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], 0.0) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], 0.0) # Check the 'hook' external force alone fdm['external_reactions/hook/magnitude'] = 10.0 fhook *= 10.0 fdm.run() self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], fhook[0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], fhook[1]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], fhook[2]) m = np.cross(self.getLeverArm(fdm, 'hook'), fhook) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0]) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) # Add the 'pushback' force to the hook force and check that the global # external forces is the sum of the push back force and the hook force. fdm['/sim/model/pushback/position-norm'] = 1.0 fdm.run() fp = fdm['systems/pushback/force'] fpb = np.array([1.0, 0.0, 0.0]) * fp f = fhook + fpb self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], fp) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], f[0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], f[1]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], f[2]) # Modify the push back force direction and check that the global external # force is modified accordingly. fdm['external_reactions/pushback/x'] = 1.5 fdm['external_reactions/pushback/y'] = 0.1 fdm.run() fp = fdm['systems/pushback/force'] fpb = np.array([1.5, 0.1, 0.0]) * fp f = fhook + fpb self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], fp) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], f[0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], f[1]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], f[2]) m = (np.cross(self.getLeverArm(fdm, 'pushback'), fpb) + np.cross(self.getLeverArm(fdm, 'hook'), fhook)) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0]) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) fdm['external_reactions/hook/location-y-in'] = 50.0 fdm.run() fp = fdm['systems/pushback/force'] fpb = np.array([1.5, 0.1, 0.0]) * fp f = fhook + fpb self.assertAlmostEqual(fdm['external_reactions/pushback/magnitude'], fp) self.assertAlmostEqual(fdm['forces/fbx-external-lbs'], f[0]) self.assertAlmostEqual(fdm['forces/fby-external-lbs'], f[1]) self.assertAlmostEqual(fdm['forces/fbz-external-lbs'], f[2]) m = (np.cross(self.getLeverArm(fdm, 'pushback'), fpb) + np.cross(self.getLeverArm(fdm, 'hook'), fhook)) self.assertAlmostEqual(fdm['moments/l-external-lbsft'], m[0]) self.assertAlmostEqual(fdm['moments/m-external-lbsft'], m[1]) self.assertAlmostEqual(fdm['moments/n-external-lbsft'], m[2]) RunTest(TestExternalReactions) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/CMakeLists.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** CMakeLists.txt 11 Mar 2017 19:21:04 -0000 1.32 --- CMakeLists.txt 26 May 2017 09:44:47 -0000 1.33 *************** *** 53,56 **** --- 53,57 ---- TestTurboProp TestEngineIndexedProps + TestExternalReactions ) Index: jsbsim.pxd =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/jsbsim.pxd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** jsbsim.pxd 11 Mar 2017 12:06:34 -0000 1.5 --- jsbsim.pxd 26 May 2017 09:44:47 -0000 1.6 *************** *** 76,79 **** --- 76,84 ---- double GetSteerNorm() + cdef extern from "models/FGAuxiliary.h" namespace "JSBSim": + cdef cppclass c_FGAuxiliary "JSBSim::FGAuxiliary": + c_FGAuxiliary(c_FGFDMExec* fdm) + c_FGMatrix33& GetTw2b() + cdef extern from "FGFDMExec.h" namespace "JSBSim": cdef cppclass c_FGFDMExec "JSBSim::FGFDMExec": *************** *** 137,138 **** --- 142,144 ---- c_FGPropertyManager* GetPropertyManager() c_FGGroundReactions* GetGroundReactions() + c_FGAuxiliary* GetAuxiliary() Index: jsbsim.pyx =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/tests/jsbsim.pyx,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** jsbsim.pyx 11 Mar 2017 12:06:34 -0000 1.14 --- jsbsim.pyx 26 May 2017 09:44:47 -0000 1.15 *************** *** 113,116 **** --- 113,128 ---- return self.thisptr.GetSteerNorm() + cdef class FGAuxiliary: + + cdef c_FGAuxiliary *thisptr + + def __init__(self): + self.thisptr = NULL + + def get_Tw2b(self): + Tw2b = FGMatrix33() + Tw2b.thisptr = new c_FGMatrix33(self.thisptr.GetTw2b()) + return convertToNumpyMat(Tw2b) + # this is the python wrapper class cdef class FGFDMExec: *************** *** 594,595 **** --- 606,612 ---- grndreact.thisptr = self.thisptr.GetGroundReactions() return grndreact + + def get_auxiliary(self): + auxiliary = FGAuxiliary() + auxiliary.thisptr = self.thisptr.GetAuxiliary() + return auxiliary |
From: Erik H. <eh...@us...> - 2017-05-02 11:28:10
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5651/Systems Modified Files: Propulsion.cpp Log Message: Extend the turbine thurst table to 60000ft and fade to zero thrust at 90000ft Index: Propulsion.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Propulsion.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** Propulsion.cpp 7 Apr 2017 07:26:19 -0000 1.39 --- Propulsion.cpp 2 May 2017 11:28:07 -0000 1.40 *************** *** 630,634 **** file << " <independentVar lookup=\"column\">atmosphere/density-altitude</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -10000 0 10000 20000 30000 40000 50000 60000" << std::endl; file << " 0.0 0.0430 0.0488 0.0528 0.0694 0.0899 0.1183 0.1467 0" << std::endl; file << " 0.2 0.0500 0.0501 0.0335 0.0544 0.0797 0.1049 0.1342 0" << std::endl; --- 630,634 ---- file << " <independentVar lookup=\"column\">atmosphere/density-altitude</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -10000 0 10000 20000 30000 40000 50000 90000" << std::endl; file << " 0.0 0.0430 0.0488 0.0528 0.0694 0.0899 0.1183 0.1467 0" << std::endl; file << " 0.2 0.0500 0.0501 0.0335 0.0544 0.0797 0.1049 0.1342 0" << std::endl; *************** *** 646,650 **** file << " <independentVar lookup=\"column\">atmosphere/density-altitude</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -10000 0 10000 20000 30000 40000 50000 60000" << std::endl; for (unsigned i=0; i<8; ++i) --- 646,650 ---- file << " <independentVar lookup=\"column\">atmosphere/density-altitude</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -10000 0 10000 20000 30000 40000 50000 60000 90000" << std::endl; for (unsigned i=0; i<8; ++i) *************** *** 657,660 **** --- 657,661 ---- file << (1.0f - 0.11*M*_bypass_ratio)*_milthrust_t[i][j]; } + file << std::fixed << std::setw(3) << "0"; file << std::endl; } *************** *** 941,952 **** float const TurbineEngine::_milthrust_t[8][8] = { ! { 1.2600f, 1.0000f, 0.7400f, 0.5340f, 0.3720f, 0.2410f, 0.1490f, 0.0f, }, ! { 1.1710f, 0.9340f, 0.6970f, 0.5060f, 0.3550f, 0.2310f, 0.1430f, 0.0f, }, ! { 1.1500f, 0.9210f, 0.6920f, 0.5060f, 0.3570f, 0.2330f, 0.1450f, 0.0f, }, ! { 1.1810f, 0.9510f, 0.7210f, 0.5320f, 0.3780f, 0.2480f, 0.1540f, 0.0f, }, ! { 1.2580f, 1.0200f, 0.7820f, 0.5820f, 0.4170f, 0.2750f, 0.1700f, 0.0f, }, ! { 1.3690f, 1.1200f, 0.8710f, 0.6510f, 0.4750f, 0.3150f, 0.1950f, 0.0f, }, ! { 1.4850f, 1.2300f, 0.9750f, 0.7440f, 0.5450f, 0.3640f, 0.2250f, 0.0f, }, ! { 1.5941f, 1.3400f, 1.0860f, 0.8450f, 0.6280f, 0.4240f, 0.2630f, 0.0f, } }; --- 942,953 ---- float const TurbineEngine::_milthrust_t[8][8] = { ! { 1.2600f, 1.0000f, 0.7400f, 0.5340f, 0.3720f, 0.2410f, 0.1490f, 0.058f }, ! { 1.1710f, 0.9340f, 0.6970f, 0.5060f, 0.3550f, 0.2310f, 0.1430f, 0.040f }, ! { 1.1500f, 0.9210f, 0.6920f, 0.5060f, 0.3570f, 0.2330f, 0.1450f, 0.043f }, ! { 1.1810f, 0.9510f, 0.7210f, 0.5320f, 0.3780f, 0.2480f, 0.1540f, 0.047f }, ! { 1.2580f, 1.0200f, 0.7820f, 0.5820f, 0.4170f, 0.2750f, 0.1700f, 0.053f }, ! { 1.3690f, 1.1200f, 0.8710f, 0.6510f, 0.4750f, 0.3150f, 0.1950f, 0.063f }, ! { 1.4850f, 1.2300f, 0.9750f, 0.7440f, 0.5450f, 0.3640f, 0.2250f, 0.074f }, ! { 1.5941f, 1.3400f, 1.0860f, 0.8450f, 0.6280f, 0.4240f, 0.2630f, 0.090f } }; |
From: Erik H. <eh...@us...> - 2017-05-02 11:28:10
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++ In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5651 Modified Files: Aircraft.cpp types.h Log Message: Extend the turbine thurst table to 60000ft and fade to zero thrust at 90000ft Index: Aircraft.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Aircraft.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -r1.78 -r1.79 *** Aircraft.cpp 7 Apr 2017 07:26:19 -0000 1.78 --- Aircraft.cpp 2 May 2017 11:28:07 -0000 1.79 *************** *** 607,611 **** file << " CD-0: " << _CD0 << std::endl; file << " K: " << _Kdi << std::endl; ! file << " Mcrit: " << _Mcrit << std::endl; file << "-->" << std::endl; file << std::endl; --- 607,620 ---- file << " CD-0: " << _CD0 << std::endl; file << " K: " << _Kdi << std::endl; ! file << " Mcrit: " << _Mcrit << std::endl << std::endl; ! ! float rho = 0.0023769f; ! float V = 1.1f*_stall_speed*KNOTS_TO_FPS; ! float qbar = rho*V*V; ! float L = _CLmax[0]*qbar*_wing.area; ! float n = L/_stall_weight; ! float lfg = G*sqrtf(n*n - 1.0f); ! file << " min. turn radius " << (V*V/lfg) << " ft" << std::endl; ! file << " max. turn rate: " << (lfg/V) << " deg/s" << std::endl; file << "-->" << std::endl; file << std::endl; Index: types.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/types.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** types.h 20 Aug 2016 08:04:10 -0000 1.23 --- types.h 2 May 2017 11:28:07 -0000 1.24 *************** *** 50,53 **** --- 50,56 ---- MKSTR(AEROMATIC_MICRO_VERSION) + #define G 32.0f + #define SPEED_OF_SOUND 1125.0f + #define PI 3.14159265358979323846 #define DEG_TO_RAD 0.01745329251994329547f |
From: Erik H. <eh...@us...> - 2017-04-29 11:17:45
|
Update of /cvsroot/jsbsim/JSBSim/examples In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv587/examples Modified Files: FlightGear.cxx FlightGear.hxx Log Message: Sync with FlightGear Index: FlightGear.cxx =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/examples/FlightGear.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** FlightGear.cxx 25 Feb 2017 15:45:23 -0000 1.25 --- FlightGear.cxx 29 Apr 2017 11:17:42 -0000 1.26 *************** *** 189,192 **** --- 189,197 ---- FGJSBBase::debug_lvl = 0x00; break; + + default: + // silence warning about unhandled cases + FGJSBBase::debug_lvl = 0x00; + break; } } else { |
From: Erik H. <eh...@us...> - 2017-04-29 11:16:49
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv498/src/models/propulsion Modified Files: FGPiston.cpp FGPiston.h Log Message: Add the option to define the oil-pressure-relief-valve-psi, design-oil-temp-degK, oil-pressure-rpm-max and oil-viscosity-index for piston engines Index: FGPiston.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPiston.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -r1.82 -r1.83 *** FGPiston.cpp 2 Jan 2016 17:42:53 -0000 1.82 --- FGPiston.cpp 29 Apr 2017 11:16:46 -0000 1.83 *************** *** 235,238 **** --- 235,251 ---- } + Design_Oil_Temp = 358; // degK; + Oil_Viscosity_Index = 0.25; + Oil_Press_Relief_Valve = 60; // psi + Oil_Press_RPM_Max = MaxRPM*0.75; + if (el->FindElement("oil-pressure-relief-valve-psi")) + Oil_Press_Relief_Valve = el->FindElementValueAsNumberConvertTo("oil-pressure-relief-valve-psi", "PSI"); + if (el->FindElement("design-oil-temp-degK")) + Design_Oil_Temp = el->FindElementValueAsNumberConvertTo("design-oil-temp-degK", "DEGK"); + if (el->FindElement("oil-pressure-rpm-max")) + Oil_Press_RPM_Max = el->FindElementValueAsNumber("oil-pressure-rpm-max"); + if (el->FindElement("oil-viscosity-index")) + Oil_Viscosity_Index = el->FindElementValueAsNumber("oil-viscosity-index"); + while((table_element = el->FindNextElement("table")) != 0) { string name = table_element->GetAttributeValue("name"); *************** *** 921,929 **** void FGPiston::doOilPressure(void) { - double Oil_Press_Relief_Valve = 60; // FIXME: may vary by engine - double Oil_Press_RPM_Max = MaxRPM * 0.75; // 75% of max rpm FIXME: may vary by engine - double Design_Oil_Temp = 358; // degK; FIXME: may vary by engine - double Oil_Viscosity_Index = 0.25; - OilPressure_psi = (Oil_Press_Relief_Valve / Oil_Press_RPM_Max) * RPM; --- 934,937 ---- Index: FGPiston.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPiston.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** FGPiston.h 2 Jan 2016 17:42:53 -0000 1.38 --- FGPiston.h 29 Apr 2017 11:16:46 -0000 1.39 *************** *** 107,110 **** --- 107,114 ---- <ratedaltitude3 unit="{FT | M}"> {number} </ratedaltitude3> <takeoffboost unit="{INHG | PA | ATM}"> {number} </takeoffboost> + <oil-pressure-relief-valve-psi> {number} </oil-pressure-relief-valve=psi> + <design-oil-temp-degK> {number} </design-oil-temp-degK> + <oil-pressure-rpm-max> {number} </oil-pressure-rpm-max> + <oil-viscosity-index> {number} </oil-viscosity-index> </piston_engine> @endcode *************** *** 362,365 **** --- 366,374 ---- int Magnetos; + double Oil_Press_Relief_Valve; + double Oil_Press_RPM_Max; + double Design_Oil_Temp; // degK + double Oil_Viscosity_Index; + // // Outputs (in addition to those in FGEngine). |
From: Erik H. <eh...@us...> - 2017-04-07 07:26:23
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++ In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26167/aeromatic++ Modified Files: Aircraft.cpp version Log Message: Fix a bug: there are exceptions where an turbine engine with a bypass ration > 1.0 does have augmentation Index: version =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/version,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** version 24 Nov 2016 09:59:34 -0000 1.23 --- version 7 Apr 2017 07:26:19 -0000 1.24 *************** *** 1 **** ! 3.3.9 --- 1 ---- ! 3.3.10 |
From: Erik H. <eh...@us...> - 2017-04-07 07:26:23
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26167/aeromatic++/Systems Modified Files: Propulsion.cpp Thruster.cpp Log Message: Fix a bug: there are exceptions where an turbine engine with a bypass ration > 1.0 does have augmentation Index: Propulsion.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Propulsion.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** Propulsion.cpp 28 Jul 2016 10:58:29 -0000 1.38 --- Propulsion.cpp 7 Apr 2017 07:26:19 -0000 1.39 *************** *** 571,580 **** if (_bypass_ratio < 0.07f) _bypass_ratio = 0.07f; tsfc = 0.635f - 0.144f * log10f(_oapr) * log10f(_bypass_ratio); - atsfc = 3.27f - 0.451f * log10f(2.9f * _oapr / _bypass_ratio); } ! else ! { tsfc = 0.7533f - 0.161f * log10f(0.0625f * _oapr * _bypass_ratio); } file.precision(1); --- 571,579 ---- if (_bypass_ratio < 0.07f) _bypass_ratio = 0.07f; tsfc = 0.635f - 0.144f * log10f(_oapr) * log10f(_bypass_ratio); } ! else { tsfc = 0.7533f - 0.161f * log10f(0.0625f * _oapr * _bypass_ratio); } + atsfc = 3.27f - 0.451f * log10f(2.9f * _oapr / _bypass_ratio); file.precision(1); Index: Thruster.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Thruster.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** Thruster.cpp 18 Aug 2016 12:52:40 -0000 1.28 --- Thruster.cpp 7 Apr 2017 07:26:19 -0000 1.29 *************** *** 139,142 **** --- 139,148 ---- * Oak: 46 * Aluminum: 167 + * + * The code is based on: + * PROPELLER BLADE ELEMENT MOMENTUM THEORY WITH VORTEX WAKE DEFLECTION + * M. K. Rwigema, 2010 + * School of Mechanical, Industrial and Aeronautical Engineering + * http://www.icas.org/ICAS_ARCHIVE/ICAS2010/PAPERS/434.PDF */ void Propeller::bladeElement() |
From: Bertrand <bco...@us...> - 2017-03-22 21:35:05
|
Update of /cvsroot/jsbsim/JSBSim/aircraft/Short_S23 In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5416/aircraft/Short_S23 Modified Files: reset03.xml Log Message: Rolled back the IC to their previous value. This is no longer needed since the induced velocity has been removed from the propeller computations. Index: reset03.xml =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/aircraft/Short_S23/reset03.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** reset03.xml 26 Feb 2017 12:18:07 -0000 1.4 --- reset03.xml 22 Mar 2017 21:35:02 -0000 1.5 *************** *** 8,12 **** <longitude unit="DEG">-122.34 </longitude> <phi unit="DEG"> 0.0 </phi> ! <theta unit="DEG"> 1.5 </theta> <psi unit="DEG"> 180.0 </psi> <altitude unit="FT"> 400.0 </altitude> --- 8,12 ---- <longitude unit="DEG">-122.34 </longitude> <phi unit="DEG"> 0.0 </phi> ! <theta unit="DEG"> 2.0 </theta> <psi unit="DEG"> 180.0 </psi> <altitude unit="FT"> 400.0 </altitude> |
From: Bertrand <bco...@us...> - 2017-03-22 21:27:50
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4935/src/models/propulsion Modified Files: FGPropeller.cpp Log Message: Removed the addition of the induced/inflow velocity since its effect is already accounted for in the tables C_THRUST and C_POWER build by aeromatic++ or javaprop. Index: FGPropeller.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPropeller.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** FGPropeller.cpp 3 Mar 2017 23:00:39 -0000 1.60 --- FGPropeller.cpp 22 Mar 2017 21:27:47 -0000 1.61 *************** *** 212,216 **** double omega, PowerAvailable; ! double Vel = localAeroVel(eU) + Vinduced; double rho = in.Density; double RPS = RPM/60.0; --- 212,216 ---- double omega, PowerAvailable; ! double Vel = localAeroVel(eU); double rho = in.Density; double RPS = RPM/60.0; |
From: Bertrand <bco...@us...> - 2017-03-18 16:17:46
|
Update of /cvsroot/jsbsim/JSBSim/src/input_output In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10881/src/input_output Modified Files: FGModelLoader.cpp Log Message: Restored the legacy behavior for file naming: the XML extension is required and is automatically added when not specified. Index: FGModelLoader.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/input_output/FGModelLoader.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** FGModelLoader.cpp 25 Feb 2017 14:23:18 -0000 1.4 --- FGModelLoader.cpp 18 Mar 2017 16:17:42 -0000 1.5 *************** *** 90,94 **** SGPath fullName = path/filename.utf8Str(); ! if (fullName.extension().empty()) fullName.concat(".xml"); --- 90,94 ---- SGPath fullName = path/filename.utf8Str(); ! if (fullName.extension() != "xml") fullName.concat(".xml"); |
From: Bertrand <bco...@us...> - 2017-03-11 19:50:06
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21534/src/models/propulsion Modified Files: FGTurboProp.cpp Log Message: Stricter checking in FGTable revived the bug [#84]. This commit provides a fix to the problem: the table name 'EnginePowerVC' is prepended with 'propulsion/engine[#]' Index: FGTurboProp.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGTurboProp.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** FGTurboProp.cpp 26 Feb 2017 11:41:28 -0000 1.36 --- FGTurboProp.cpp 11 Mar 2017 19:50:03 -0000 1.37 *************** *** 147,151 **** string name = table_element->GetAttributeValue("name"); if (!EnginePowerVC && name == "EnginePowerVC") { ! EnginePowerVC = new FGTable(PropertyManager, table_element); cerr << table_element->ReadFrom() <<"Note: Using the EnginePowerVC without enclosed <function> tag is deprecated" --- 147,158 ---- string name = table_element->GetAttributeValue("name"); if (!EnginePowerVC && name == "EnginePowerVC") { ! // Get a different name for each engines otherwise FGTable::bind() will ! // complain that the property 'EnginePowerVC' is already bound. This is a ! // ugly hack but the functionality is obsolete and will be removed some ! // time in the future. ! table_element->SetAttributeValue("name", string("propulsion/engine[#]/") + name); ! EnginePowerVC = new FGTable(PropertyManager, table_element, ! to_string((int)EngineNumber)); ! table_element->SetAttributeValue("name", name); cerr << table_element->ReadFrom() <<"Note: Using the EnginePowerVC without enclosed <function> tag is deprecated" |
From: Bertrand <bco...@us...> - 2017-03-11 19:31:51
|
Update of /cvsroot/jsbsim/JSBSim/src/math In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20592/src/math Modified Files: FGFunction.cpp FGFunction.h FGTable.cpp FGTable.h Log Message: Fixed the bug [#96] Table Independent Variables Not Indexed Index: FGFunction.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/math/FGFunction.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -r1.58 -r1.59 *** FGFunction.cpp 12 Jul 2015 19:34:08 -0000 1.58 --- FGFunction.cpp 11 Mar 2017 19:31:47 -0000 1.59 *************** *** 267,271 **** Parameters.push_back(new FGRealValue(element->GetDataAsNumber())); } else if (operation == table_string || operation == t_string) { ! Parameters.push_back(new FGTable(PropertyManager, element)); // operations } else if (operation == product_string || --- 267,271 ---- Parameters.push_back(new FGRealValue(element->GetDataAsNumber())); } else if (operation == table_string || operation == t_string) { ! Parameters.push_back(new FGTable(PropertyManager, element, Prefix)); // operations } else if (operation == product_string || *************** *** 324,328 **** } ! bind(); // Allow any function to save its value Debug(0); --- 324,328 ---- } ! bind(el); // Allow any function to save its value Debug(0); *************** *** 785,789 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! void FGFunction::bind(void) { if ( !Name.empty() ) { --- 785,789 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! void FGFunction::bind(Element* el) { if ( !Name.empty() ) { *************** *** 797,803 **** tmp = PropertyManager->mkPropertyName(Name, false); } else { ! cerr << "Malformed function name with number: " << Prefix ! << " and property name: " << Name ! << " but no \"#\" sign for substitution." << endl; } } else { --- 797,804 ---- tmp = PropertyManager->mkPropertyName(Name, false); } else { ! cerr << el->ReadFrom() ! << "Malformed function name with number: " << Prefix ! << " and property name: " << Name ! << " but no \"#\" sign for substitution." << endl; } } else { *************** *** 809,813 **** FGPropertyNode* _property = PropertyManager->GetNode(tmp); if (_property->isTied()) { ! cout << "Property " << tmp << " has already been successfully bound (late)." << endl; throw("Failed to bind the property to an existing already tied node."); } --- 810,815 ---- FGPropertyNode* _property = PropertyManager->GetNode(tmp); if (_property->isTied()) { ! cerr << el->ReadFrom() ! << "Property " << tmp << " has already been successfully bound (late)." << endl; throw("Failed to bind the property to an existing already tied node."); } Index: FGFunction.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/math/FGFunction.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** FGFunction.h 12 Jul 2015 13:03:23 -0000 1.32 --- FGFunction.h 11 Mar 2017 19:31:47 -0000 1.33 *************** *** 813,817 **** unsigned int GetBinary(double) const; ! void bind(void); void Debug(int from); }; --- 813,817 ---- unsigned int GetBinary(double) const; ! void bind(Element*); void Debug(int from); }; Index: FGTable.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/math/FGTable.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** FGTable.cpp 22 May 2016 09:08:05 -0000 1.32 --- FGTable.cpp 11 Mar 2017 19:31:48 -0000 1.33 *************** *** 113,117 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGTable::FGTable(FGPropertyManager* propMan, Element* el) : PropertyManager(propMan) { unsigned int i; --- 113,119 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGTable::FGTable(FGPropertyManager* propMan, Element* el, ! const std::string& prefix) ! : PropertyManager(propMan), Prefix(prefix) { unsigned int i; *************** *** 175,178 **** --- 177,185 ---- while (axisElement) { property_string = axisElement->GetDataLine(); + if (property_string.find("#") != string::npos) { + if (is_number(Prefix)) { + property_string = replace(property_string,"#",Prefix); + } + } // The property string passed into GetNode() must have no spaces or tabs. node = PropertyManager->GetNode(property_string); *************** *** 348,352 **** } ! bind(); if (debug_lvl & 1) Print(); --- 355,359 ---- } ! bind(el); if (debug_lvl & 1) Print(); *************** *** 633,641 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! void FGTable::bind(void) { typedef double (FGTable::*PMF)(void) const; if ( !Name.empty() && !internal) { ! string tmp = PropertyManager->mkPropertyName(Name, false); // Allow upper PropertyManager->Tie( tmp, this, (PMF)&FGTable::GetValue); } --- 640,674 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! void FGTable::bind(Element* el) { typedef double (FGTable::*PMF)(void) const; if ( !Name.empty() && !internal) { ! string tmp; ! if (Prefix.empty()) ! tmp = PropertyManager->mkPropertyName(Name, false); // Allow upper ! else { ! if (is_number(Prefix)) { ! if (Name.find("#") != string::npos) { // if "#" is found ! Name = replace(Name,"#",Prefix); ! tmp = PropertyManager->mkPropertyName(Name, false); // Allow upper ! } else { ! cerr << el->ReadFrom() ! << "Malformed table name with number: " << Prefix ! << " and property name: " << Name ! << " but no \"#\" sign for substitution." << endl; ! } ! } else { ! tmp = PropertyManager->mkPropertyName(Prefix + "/" + Name, false); ! } ! } ! ! if (PropertyManager->HasNode(tmp)) { ! FGPropertyNode* _property = PropertyManager->GetNode(tmp); ! if (_property->isTied()) { ! cerr << el->ReadFrom() ! << "Property " << tmp << " has already been successfully bound (late)." << endl; ! throw("Failed to bind the property to an existing already tied node."); ! } ! } PropertyManager->Tie( tmp, this, (PMF)&FGTable::GetValue); } Index: FGTable.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/math/FGTable.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** FGTable.h 26 Jan 2013 17:06:49 -0000 1.15 --- FGTable.h 11 Mar 2017 19:31:48 -0000 1.16 *************** *** 252,256 **** /// The constructor for a table ! FGTable (FGPropertyManager* propMan, Element* el); FGTable (int ); FGTable (int, int); --- 252,256 ---- /// The constructor for a table ! FGTable (FGPropertyManager* propMan, Element* el, const std::string& prefix=""); FGTable (int ); FGTable (int, int); *************** *** 312,317 **** double** Allocate(void); FGPropertyManager* const PropertyManager; std::string Name; ! void bind(void); unsigned int FindNumColumns(const std::string&); --- 312,318 ---- double** Allocate(void); FGPropertyManager* const PropertyManager; + std::string Prefix; std::string Name; ! void bind(Element*); unsigned int FindNumColumns(const std::string&); |