Skip to content

Commit

Permalink
fixing values that changed when drag model changed
Browse files Browse the repository at this point in the history
  • Loading branch information
crecine committed Oct 2, 2024
1 parent 256e949 commit 7b8a681
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 43 deletions.
1 change: 1 addition & 0 deletions aviary/interface/methods_for_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ def add_phases(self, phase_info_parameterization=None):
src_indices=[-1],
flat_src_indices=True,
)
self.traj = traj
return traj

def add_subsystem_timeseries_outputs(phase, phase_name):
Expand Down
2 changes: 1 addition & 1 deletion aviary/mission/gasp_based/ode/test/test_ascent_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_ascent_partials(self):
tol = tol = 1e-6
assert_near_equal(
self.prob[Dynamic.Mission.VELOCITY_RATE], np.array(
[641174.75, 641174.75]), tol)
[641262, 641262]), tol)
assert_near_equal(
self.prob[Dynamic.Mission.FLIGHT_PATH_ANGLE_RATE], np.array(
[2260.644, 2260.644]), tol)
Expand Down
8 changes: 4 additions & 4 deletions aviary/mission/gasp_based/ode/test/test_breguet_cruise_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ def test_cruise(self):
[1.0, 1.0]), tol)
assert_near_equal(
self.prob[Dynamic.Mission.DISTANCE], np.array(
[0.0, 881.8116]), tol)
[0.0, 885.4400]), tol)
assert_near_equal(
self.prob["time"], np.array(
[0, 7906.83]), tol)
[0, 7939.36]), tol)
assert_near_equal(
self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], np.array(
[3.429719, 4.433518]), tol)
[3.46954168, 4.47480548]), tol)
assert_near_equal(
self.prob[Dynamic.Mission.ALTITUDE_RATE_MAX], np.array(
[-17.63194, -16.62814]), tol)
[-17.59211761, -16.58685381]), tol)

partial_data = self.prob.check_partials(
out_stream=None, method="cs", excludes=["*USatm*", "*params*", "*aero*"]
Expand Down
30 changes: 14 additions & 16 deletions aviary/mission/gasp_based/ode/test/test_climb_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ def test_start_of_climb(self):
self.prob.run_model()

testvals = {
"alpha": 5.16398,
"CL": 0.59766664,
"CD": 0.03070836,
Dynamic.Mission.ALTITUDE_RATE: 3414.63 / 60, # ft/s
# TAS (kts -> ft/s) * cos(gamma), 253.6827 * 1.68781 * cos(0.13331060446181708)
Dynamic.Mission.DISTANCE_RATE: 424.36918705874785, # ft/s
"alpha": 5.16376881,
"CL": 0.59764714,
"CD": 0.03056306,
Dynamic.Mission.ALTITUDE_RATE: 57.01361283, # ft/s
Dynamic.Mission.DISTANCE_RATE: 424.35532272, # ft/s
Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL: -13448.29, # lbm/h
"theta": 0.22343879616956605, # rad (12.8021 deg)
Dynamic.Mission.FLIGHT_PATH_ANGLE: 0.13331060446181708, # rad (7.638135 deg)
"theta": 0.22367849, # rad
Dynamic.Mission.FLIGHT_PATH_ANGLE: 0.13355372, # rad
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand Down Expand Up @@ -87,15 +86,14 @@ def test_end_of_climb(self):
self.prob.run_model()

testvals = {
"alpha": [4.05559, 4.08245],
"CL": [0.512629, 0.617725],
"CD": [0.02692764, 0.03311237],
Dynamic.Mission.ALTITUDE_RATE: [3053.754 / 60, 429.665 / 60], # ft/s
# TAS (kts -> ft/s) * cos(gamma), [319, 459] kts
Dynamic.Mission.DISTANCE_RATE: [536.2835, 774.4118], # ft/s
"alpha": [4.05545557, 4.08244122],
"CL": [0.51261517, 0.61772367],
"CD": [0.02678719, 0.03296697],
Dynamic.Mission.ALTITUDE_RATE: [51.04282581, 7.34336078], # ft/s
Dynamic.Mission.DISTANCE_RATE: [536.26997036, 774.40958246], # ft/s
Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL: [-11420.05, -6050.26],
"theta": [0.16540479, 0.08049912], # rad ([9.47699, 4.61226] deg),
Dynamic.Mission.FLIGHT_PATH_ANGLE: [0.09462135, 0.00924686], # rad, gamma
"theta": [0.16567639, 0.08073428], # rad
Dynamic.Mission.FLIGHT_PATH_ANGLE: [0.09489533, 0.00948224], # rad, gamma
Dynamic.Mission.THRUST_TOTAL: [25560.51, 10784.25],
}
check_prob_outputs(self.prob, testvals, 1e-6)
Expand Down
27 changes: 12 additions & 15 deletions aviary/mission/gasp_based/ode/test/test_descent_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@ def test_high_alt(self):
self.prob.run_model()

testvals = {
"alpha": np.array([3.23388, 1.203234]),
"CL": np.array([0.51849367, 0.25908653]),
"CD": np.array([0.02794324, 0.01862946]),
"alpha": np.array([3.23393993, 1.20331298]),
"CL": np.array([0.51850073, 0.25909499]),
"CD": np.array([0.02780363, 0.01849853]),
# ft/s
Dynamic.Mission.ALTITUDE_RATE: np.array([-2356.7705, -2877.9606]) / 60,
# TAS (ft/s) * cos(gamma), [458.67774, 437.62297] kts
Dynamic.Mission.DISTANCE_RATE: [773.1637, 737.0653], # ft/s
Dynamic.Mission.ALTITUDE_RATE: np.array([-39.07162618, -47.59435367]),
Dynamic.Mission.DISTANCE_RATE: [773.1742866, 737.08941812], # ft/s
# lbm/h
Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL: np.array([-451.0239, -997.1514]),
"EAS": [417.87419406, 590.73344937], # ft/s ([247.58367, 349.99997] kts)
Dynamic.Mission.MACH: [0.8, 0.697266],
# gamma, rad ([-2.908332, -3.723388] deg)
Dynamic.Mission.FLIGHT_PATH_ANGLE: [-0.05075997, -0.06498538],
Dynamic.Mission.FLIGHT_PATH_ANGLE: [-0.0504911, -0.06448115],
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand All @@ -87,14 +85,13 @@ def test_low_alt(self):
self.prob.run_model()

testvals = {
"alpha": 4.19956,
"CL": 0.507578,
"CD": 0.0268404,
Dynamic.Mission.ALTITUDE_RATE: -1138.583 / 60,
# TAS (ft/s) * cos(gamma) = 255.5613 * 1.68781 * cos(-0.0440083)
Dynamic.Mission.DISTANCE_RATE: 430.9213,
"alpha": 4.19962426,
"CL": 0.50758417,
"CD": 0.02670105,
Dynamic.Mission.ALTITUDE_RATE: -18.85828188,
Dynamic.Mission.DISTANCE_RATE: 430.92650383,
Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL: -1295.11,
Dynamic.Mission.FLIGHT_PATH_ANGLE: -0.0440083, # rad (-2.52149 deg)
Dynamic.Mission.FLIGHT_PATH_ANGLE: -0.04373427, # rad (-2.52149 deg)
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand Down
8 changes: 4 additions & 4 deletions aviary/mission/gasp_based/ode/test/test_flight_path_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ def test_case1(self):

self.prob.run_model()
testvals = {
Dynamic.Mission.VELOCITY_RATE: [14.0673, 14.0673],
Dynamic.Mission.VELOCITY_RATE: [14.06928293, 14.06928293],
Dynamic.Mission.FLIGHT_PATH_ANGLE_RATE: [-0.1429133, -0.1429133],
Dynamic.Mission.ALTITUDE_RATE: [0.0, 0.0],
Dynamic.Mission.DISTANCE_RATE: [168.781, 168.781],
"normal_force": [74910.12, 74910.12],
"fuselage_pitch": [0.0, 0.0],
"load_factor": [0.2508988, 0.2508988],
Dynamic.Mission.ALTITUDE_RATE: [0.0, 0.0],
Dynamic.Mission.ALTITUDE_RATE_MAX: [-0.01812796, -0.01812796],
Dynamic.Mission.ALTITUDE_RATE_MAX: [-0.0181305, -0.0181305],
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand Down Expand Up @@ -77,12 +77,12 @@ def test_case2(self):

self.prob.run_model()
testvals = {
Dynamic.Mission.VELOCITY_RATE: [13.58489, 13.58489],
Dynamic.Mission.VELOCITY_RATE: [13.58686175, 13.58686175],
Dynamic.Mission.DISTANCE_RATE: [168.781, 168.781],
"normal_force": [74910.12, 74910.12],
"fuselage_pitch": [0.0, 0.0],
"load_factor": [0.2508988, 0.2508988],
Dynamic.Mission.ALTITUDE_RATE_MAX: [0.7532356, 0.7532356],
Dynamic.Mission.ALTITUDE_RATE_MAX: [0.75323307, 0.75323307],
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand Down
4 changes: 2 additions & 2 deletions aviary/mission/gasp_based/ode/test/test_groundroll_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def test_groundroll_partials(self):
self.prob.run_model()

testvals = {
Dynamic.Mission.VELOCITY_RATE: [1413548.36, 1413548.36],
Dynamic.Mission.VELOCITY_RATE: [1413741.12, 1413741.12],
Dynamic.Mission.FLIGHT_PATH_ANGLE_RATE: [0.0, 0.0],
Dynamic.Mission.ALTITUDE_RATE: [0.0, 0.0],
Dynamic.Mission.DISTANCE_RATE: [168.781, 168.781],
"normal_force": [0.0, 0.0],
"fuselage_pitch": [0.0, 0.0],
"dmass_dv": [-5.03252493e-06, -5.03252493e-06],
"dmass_dv": [-5.03183878e-06, -5.03183878e-06],
}
check_prob_outputs(self.prob, testvals, rtol=1e-6)

Expand Down
2 changes: 1 addition & 1 deletion aviary/mission/gasp_based/ode/test/test_rotation_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_rotation_partials(self):
tol = 1e-6
assert_near_equal(
self.prob[Dynamic.Mission.VELOCITY_RATE], np.array(
[13.66655, 13.66655]), tol)
[13.66852121, 13.66852121]), tol)
assert_near_equal(
self.prob[Dynamic.Mission.FLIGHT_PATH_ANGLE_RATE], np.array(
[0.0, 0.0]), tol)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ def initialize(self, verbosity=Verbosity.QUIET):
self.adjoint_int_opts['nsteps'] = 5000
self.adjoint_int_opts['name'] = "dop853"

def add_parameter(self, name, units=None, **kwargs):
self.add_input('parameters:'+name, units=units)
self.options["param_dict"].get(name, {}).update({'units': units})

def setup_params(
self,
ODEs,
Expand Down

0 comments on commit 7b8a681

Please sign in to comment.