Skip to content

Commit

Permalink
Remove the hardcoded value of the parachute area.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoconni committed Sep 24, 2023
1 parent ad47b90 commit 3055b01
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/TestExternalReactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def test_body_frame(self):
def test_moment(self):
script_path = self.sandbox.path_to_jsbsim_file('scripts',
'ball_chute.xml')
tree, aircraft_name, _ = CopyAircraftDef(script_path,
self.sandbox)
tree, aircraft_name, _ = CopyAircraftDef(script_path, self.sandbox)
extReact_element = tree.getroot().find('external_reactions')
moment_element = et.SubElement(extReact_element, 'moment')
moment_element.attrib['name'] = 'parachute'
Expand Down Expand Up @@ -229,9 +228,14 @@ def test_moment(self):

fdm['external_reactions/parachute/magnitude-lbsft'] = -3.5

# Compute the parachute_area
parachute_area = 1.0
for value in extReact_element.findall('force/function/product/value'):
parachute_area *= float(value.text)

while fdm.run():
Tw2b = fdm.get_auxiliary().get_Tw2b()
mag = fdm['aero/qbar-psf'] * fdm['fcs/parachute_reef_pos_norm']*20.0
mag = fdm['aero/qbar-psf'] * fdm['fcs/parachute_reef_pos_norm']*parachute_area
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])
Expand Down

0 comments on commit 3055b01

Please sign in to comment.