Skip to content

Commit

Permalink
fixing units issue
Browse files Browse the repository at this point in the history
  • Loading branch information
crecine committed May 17, 2024
1 parent b3ef408 commit c01e2e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions aviary/examples/level2_shooting_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def run_aviary(aircraft_filename, phase_info, optimizer=None, analysis_scheme=An
),
)
cruise_vals = {
'mach': {'val': prob.cruise_mach, 'units': cruise_kwargs['input_speed_units']},
'distance_trigger': {'val': 300, 'units': 'NM'},
'mach': (prob.cruise_mach, cruise_kwargs['input_speed_units']),
'distance_trigger': (300, 'NM'),
}

descent1_kwargs = dict(
Expand All @@ -75,9 +75,9 @@ def run_aviary(aircraft_filename, phase_info, optimizer=None, analysis_scheme=An
),
)
descent1_vals = {
'alt_trigger': {'val': 10000, 'units': 'ft'},
'mach': {'val': prob.cruise_mach, 'units': None},
'speed_trigger': {'val': 350, 'units': 'kn'}}
'alt_trigger': (10000, 'ft'),
'mach': (prob.cruise_mach, None),
'speed_trigger': (350, 'kn')}

phases = {
**ascent_phases,
Expand Down
3 changes: 1 addition & 2 deletions aviary/interface/methods_for_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,7 @@ def add_phases(self, phase_info_parameterization=None):

# based on reserve_fuel
estimated_descent_fuel = descent_estimation['refined_guess']['fuel_burned']
cruise_options['descent_fuel'] = {
'val': estimated_descent_fuel, 'units': 'lbm'}
cruise_options['descent_fuel'] = (estimated_descent_fuel, 'lbm')

full_traj = FlexibleTraj(
Phases=self.phase_info,
Expand Down
1 change: 1 addition & 0 deletions aviary/mission/gasp_based/phases/time_integration_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def compute(self, inputs, outputs):
vals_to_set = self.options['Phases'][phase_name]['user_options']
if vals_to_set:
for name, data in vals_to_set.items():
print(data)
var, units = data
if name.startswith('attr:'):
new_val = (
Expand Down

0 comments on commit c01e2e4

Please sign in to comment.