Optimizing the Mission Profile of a Conventional Aircraft#
Building upon our previous example, this notebook introduces more complexity into the Aviary optimization process. Please see the simple mission example if you haven’t already.
Increasing Complexity in Phase Information#
We will now modify the phase_info
object from our prior example by increasing num_segments
to 3 and setting mach_optimize
to True
in each of the three phases.
This means that we’ll query the aircraft performance at more points along the mission and also give the optimizer the freedom to choose an optimal Mach profile.
Note
We are still using a mach_polynomial_order
and altitude_polynomial_order
of 1, which means that the optimal Mach profiles for each phase will be linear (straight lines).
Later in this example, we increase this order which will allow the optimizer to choose a more complex Mach profile.
phase_info = {
'pre_mission': {'include_takeoff': False, 'optimize_mass': True},
'climb_1': {
'subsystem_options': {'core_aerodynamics': {'method': 'computed'}},
'user_options': {
'num_segments': 3,
'order': 3,
'distance_solve_segments': False,
'mach_optimize': True,
'mach_polynomial_order': 1,
'mach_initial': (0.2, 'unitless'),
'mach_final': (0.72, 'unitless'),
'mach_bounds': ((0.18, 0.74), 'unitless'),
'altitude_optimize': False,
'altitude_polynomial_order': 1,
'altitude_initial': (0.0, 'ft'),
'altitude_final': (30500.0, 'ft'),
'altitude_bounds': ((0.0, 31000.0), 'ft'),
'throttle_enforcement': 'path_constraint',
'time_initial_bounds': ((0.0, 0.0), 'min'),
'time_duration_bounds': ((27.0, 81.0), 'min'),
},
'initial_guesses': {'time': ([0, 54], 'min')},
},
'cruise': {
'subsystem_options': {'core_aerodynamics': {'method': 'computed'}},
'user_options': {
'num_segments': 3,
'order': 3,
'mach_optimize': True,
'mach_polynomial_order': 1,
'mach_initial': (0.72, 'unitless'),
'mach_final': (0.72, 'unitless'),
'mach_bounds': ((0.7, 0.74), 'unitless'),
'altitude_optimize': False,
'altitude_initial': (30500.0, 'ft'),
'altitude_final': (31000.0, 'ft'),
'altitude_bounds': ((30000.0, 31500.0), 'ft'),
'throttle_enforcement': 'boundary_constraint',
'time_initial_bounds': ((27.0, 81.0), 'min'),
'time_duration_bounds': ((85.5, 256.5), 'min'),
},
'initial_guesses': {'time': ([54, 171], 'min')},
},
'descent_1': {
'subsystem_options': {'core_aerodynamics': {'method': 'computed'}},
'user_options': {
'num_segments': 3,
'order': 3,
'mach_optimize': True,
'mach_polynomial_order': 1,
'mach_initial': (0.72, 'unitless'),
'mach_final': (0.2, 'unitless'),
'mach_bounds': ((0.18, 0.74), 'unitless'),
'altitude_optimize': False,
'altitude_initial': (31000.0, 'ft'),
'altitude_final': (500.0, 'ft'),
'altitude_bounds': ((0.0, 31500.0), 'ft'),
'throttle_enforcement': 'path_constraint',
'time_initial_bounds': ((112.5, 337.5), 'min'),
'time_duration_bounds': ((26.5, 79.5), 'min'),
},
'initial_guesses': {'time': ([225, 53], 'min')},
},
'post_mission': {
'include_landing': False,
'constrain_range': True,
'target_range': (1915, 'nmi'),
},
}
Running Aviary with Updated Parameters#
Let’s run the Aviary optimization with our updated phase_info
object in the same way as before.
import aviary.api as av
prob = av.run_aviary(
'models/test_aircraft/aircraft_for_bench_FwFm.csv',
phase_info,
optimizer='SLSQP',
make_plots=True,
)
Warning: The 'solve_alpha' flag has been set, but is not used for FLOPS-based aerodynamics.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.climb_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.cruise.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.descent_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/recorders/sqlite_recorder.py:231: UserWarning:The existing case recorder file, /home/runner/work/Aviary/Aviary/aviary/docs/examples/aircraft_for_bench_FwFm_out/problem_history.db, is being overwritten.
Warning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/total_jac.py:1757: DerivativesWarning:Design variables [('traj.climb_1.t_initial', inds=[0])] have no impact on the constraints or objective.
Singular matrix C in LSQ subproblem (Exit mode 6)
Current function value: 0.3
Iterations: 1
Function evaluations: 1
Gradient evaluations: 1
Optimization FAILED.
Singular matrix C in LSQ subproblem
-----------------------------------
Warning:
Aviary run failed. See the dashboard for more details.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/driver.py:144: OMDeprecationWarning:boolean evaluation of DriverResult is temporarily implemented to mimick the previous `failed` return behavior of run_driver.
Use the `success` attribute of the returned DriverResult object to test for successful driver completion.
Now that we’ve run Aviary, we can look at the results.
Open up the automatically generated traj_results_report.html
and scroll through it to visualize the results.
Here are the altitude and Mach profiles:
We note two major changes compared to our first example.
The first is that we have many more points where the flight dynamics were evaluated because we increased num_segments
to 3.
This means that we have more points shown on the resulting plots.
The second is that the optimizer chose the optimal Mach profile.
Again, each phase’s Mach profile is constrained to be linear because we set mach_polynomial_order
and altitude_polynomial_order
to 1.
However, we see that the optimizer chose to decrease the Mach number during the cruise-climb segment to minimize fuel burn.
Note
Remember, we did not allow the optimizer to control the altitude profile, so that remains fixed.
Let’s take a look at the optimization objective, mission:summary:fuel_burned
:
print(prob.get_val(av.Mission.Summary.FUEL_BURNED, units='kg')[0])
0.0
We can print fuel_burned
in pounds easily, thanks to OpenMDAO’s automatic unit conversion feature:
print(prob.get_val(av.Mission.Summary.FUEL_BURNED, units='lb')[0])
0.0
Modifying the Aircraft Configuration#
Next, we’ll modify the aircraft configuration by decreasing the wing aspect ratio by 0.2.
This results in a less slender wing, which will increase the induced drag.
We’ve made this change and have a modified aircraft data file called modified_aircraft.csv
.
Show code cell source
import csv
filename = 'models/test_aircraft/aircraft_for_bench_FwFm.csv'
filename = av.get_path(filename)
# Read the file
with open(filename, 'r') as file:
reader = csv.reader(file)
lines = list(reader)
# Find the index of the line containing 'aircraft:wing:span'
index = None
for i, line in enumerate(lines):
if 'aircraft:wing:aspect_ratio' in line:
index = i
break
# Modify the value in the line
if index is not None:
aspect_ratio = float(lines[index][1]) - 0.2
lines[index][1] = str(aspect_ratio)
# Write the modified content to a new CSV file
with open(new_filename, 'w', newline='') as file:
writer = csv.writer(file)
writer.writerows(lines)
Re-running the Optimization with Modified Aircraft#
Now, let’s re-run the optimization with the modified aircraft configuration.
We’ll use the same phase_info
object as before, but we’ll change the input deck to point to our new aircraft file.
prob = av.run_aviary('modified_aircraft.csv', phase_info, optimizer='SLSQP', make_plots=True)
Warning: The 'solve_alpha' flag has been set, but is not used for FLOPS-based aerodynamics.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.climb_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.cruise.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.descent_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
Warning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/total_jac.py:1757: DerivativesWarning:Design variables [('traj.climb_1.t_initial', inds=[0])] have no impact on the constraints or objective.
Singular matrix C in LSQ subproblem (Exit mode 6)
Current function value: 0.3
Iterations: 1
Function evaluations: 1
Gradient evaluations: 1
Optimization FAILED.
Singular matrix C in LSQ subproblem
-----------------------------------
Warning:
Aviary run failed. See the dashboard for more details.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/driver.py:144: OMDeprecationWarning:boolean evaluation of DriverResult is temporarily implemented to mimick the previous `failed` return behavior of run_driver.
Use the `success` attribute of the returned DriverResult object to test for successful driver completion.
The case again converged in relatively few iterations. Let’s take a look at the fuel burn value:
print(prob.get_val(av.Mission.Summary.FUEL_BURNED, units='kg')[0])
0.0
As expected, it’s a bit higher than our prior run that had a larger aspect ratio.
Increasing the Polynomial Control Order#
Next, we’ll increase the mach_polynomial_order
and altitude_polynomial_order
to 3 for the climb and descent phases.
This means that the optimizer will be able to choose a cubic Mach and altitude profile per phase instead of a straight line.
We’ll use the original aircraft configuration for this run.
Note
We’ll use the IPOPT optimizer for this problem as it will handle the increased complexity better than SLSQP.
phase_info['climb_1']['user_options']['mach_polynomial_order'] = 3
phase_info['climb_1']['user_options']['altitude_polynomial_order'] = 3
phase_info['cruise']['user_options']['mach_polynomial_order'] = 1
phase_info['cruise']['user_options']['altitude_polynomial_order'] = 1
phase_info['descent_1']['user_options']['mach_polynomial_order'] = 3
phase_info['descent_1']['user_options']['altitude_polynomial_order'] = 3
prob = av.run_aviary(
'models/test_aircraft/aircraft_for_bench_FwFm.csv',
phase_info,
optimizer='IPOPT',
make_plots=True,
)
Warning: The 'solve_alpha' flag has been set, but is not used for FLOPS-based aerodynamics.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.climb_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.cruise.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/solvers/linear/linear_rhs_checker.py:177: SolverWarning:DirectSolver in 'traj.phases.descent_1.indep_states' <class StateIndependentsComp>: 'rhs_checking' is active but no redundant adjoint dependencies were found, so caching has been disabled.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/recorders/sqlite_recorder.py:231: UserWarning:The existing case recorder file, /home/runner/work/Aviary/Aviary/aviary/docs/examples/aircraft_for_bench_FwFm_out/problem_history.db, is being overwritten.
Warning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/total_jac.py:1757: DerivativesWarning:Design variables [('traj.climb_1.t_initial', inds=[0])] have no impact on the constraints or objective.
Total number of variables............................: 70
variables with only lower bounds: 2
variables with lower and upper bounds: 68
variables with only upper bounds: 0
Total number of equality constraints.................: 66
Total number of inequality constraints...............: 26
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 26
inequality constraints with only upper bounds: 0
Number of Iterations....: 50
(scaled) (unscaled)
Objective...............: 2.4563406732471225e+00 2.4563406732471225e+00
Dual infeasibility......: 1.5650431210410872e-03 1.5650431210410872e-03
Constraint violation....: 1.7538280482759537e-08 1.7538280482759537e-08
Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 1.0000000000000026e-05 1.0000000000000026e-05
Overall NLP error.......: 1.5650431210410872e-03 1.5650431210410872e-03
Number of objective function evaluations = 84
Number of objective gradient evaluations = 51
Number of equality constraint evaluations = 84
Number of inequality constraint evaluations = 84
Number of equality constraint Jacobian evaluations = 51
Number of inequality constraint Jacobian evaluations = 51
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 21.149
EXIT: Maximum Number of Iterations Exceeded.
minimal_print is not available for this solution
Optimization Problem -- Optimization using pyOpt_sparse
================================================================================
Objective Function: _objfunc
Solution:
--------------------------------------------------------------------------------
Total Time: 21.1508
User Objective Time : 17.2963
User Sensitivity Time : 3.6294
Interface Time : 0.1447
Opt Solver Time: 0.0804
Calls to Objective Function : 85
Calls to Sens Function : 52
Objectives
Index Name Value
0 mission:objectives:fuel 2.456341E+00
Variables (c - continuous, i - integer, d - discrete)
Index Name Type Lower Bound Value Upper Bound Status
0 mission:design:gross_mass_0 c 5.714286E-05 9.070541E-01 1.000000E+30
1 mission:summary:gross_mass_0 c 5.714286E-05 9.070541E-01 1.000000E+30
2 traj.climb_1.t_initial_0 c 0.000000E+00 0.000000E+00 0.000000E+00 lu
3 traj.climb_1.t_duration_0 c 5.000000E-01 5.001697E-01 1.500000E+00
4 traj.climb_1.states:mass_0 c 0.000000E+00 7.200074E+00 1.000000E+17
5 traj.climb_1.states:mass_1 c 0.000000E+00 7.178933E+00 1.000000E+17
6 traj.climb_1.states:mass_2 c 0.000000E+00 7.157000E+00 1.000000E+17
7 traj.climb_1.states:mass_3 c 0.000000E+00 7.149458E+00 1.000000E+17
8 traj.climb_1.states:mass_4 c 0.000000E+00 7.122984E+00 1.000000E+17
9 traj.climb_1.states:mass_5 c 0.000000E+00 7.087323E+00 1.000000E+17
10 traj.climb_1.states:mass_6 c 0.000000E+00 7.076521E+00 1.000000E+17
11 traj.climb_1.states:mass_7 c 0.000000E+00 7.061636E+00 1.000000E+17
12 traj.climb_1.states:mass_8 c 0.000000E+00 7.041785E+00 1.000000E+17
13 traj.climb_1.states:mass_9 c 0.000000E+00 7.035618E+00 1.000000E+17
14 traj.climb_1.states:distance_0 c 0.000000E+00 1.397248E-02 1.000000E+15
15 traj.climb_1.states:distance_1 c 0.000000E+00 4.205445E-02 1.000000E+15
16 traj.climb_1.states:distance_2 c 0.000000E+00 5.259460E-02 1.000000E+15
17 traj.climb_1.states:distance_3 c 0.000000E+00 9.674949E-02 1.000000E+15
18 traj.climb_1.states:distance_4 c 0.000000E+00 1.664470E-01 1.000000E+15
19 traj.climb_1.states:distance_5 c 0.000000E+00 1.895735E-01 1.000000E+15
20 traj.climb_1.states:distance_6 c 0.000000E+00 2.229929E-01 1.000000E+15
21 traj.climb_1.states:distance_7 c 0.000000E+00 2.700051E-01 1.000000E+15
22 traj.climb_1.states:distance_8 c 0.000000E+00 2.850684E-01 1.000000E+15
23 traj.climb_1.controls:mach_0 c 3.600000E-01 4.000000E-01 1.480000E+00
24 traj.climb_1.controls:mach_1 c 3.600000E-01 9.504928E-01 1.480000E+00
25 traj.climb_1.controls:mach_2 c 3.600000E-01 1.328979E+00 1.480000E+00
26 traj.climb_1.controls:mach_3 c 3.600000E-01 1.440000E+00 1.480000E+00
27 traj.cruise.t_duration_0 c 5.000000E-01 1.337688E+00 1.500000E+00
28 traj.cruise.states:mass_0 c 0.000000E+00 6.957070E+00 1.000000E+17
29 traj.cruise.states:mass_1 c 0.000000E+00 6.849592E+00 1.000000E+17
30 traj.cruise.states:mass_2 c 0.000000E+00 6.815789E+00 1.000000E+17
31 traj.cruise.states:mass_3 c 0.000000E+00 6.691415E+00 1.000000E+17
32 traj.cruise.states:mass_4 c 0.000000E+00 6.521974E+00 1.000000E+17
33 traj.cruise.states:mass_5 c 0.000000E+00 6.468852E+00 1.000000E+17
34 traj.cruise.states:mass_6 c 0.000000E+00 6.394072E+00 1.000000E+17
35 traj.cruise.states:mass_7 c 0.000000E+00 6.291663E+00 1.000000E+17
36 traj.cruise.states:mass_8 c 0.000000E+00 6.259442E+00 1.000000E+17
37 traj.cruise.states:distance_0 c 0.000000E+00 5.784482E-01 1.000000E+15
38 traj.cruise.states:distance_1 c 0.000000E+00 9.831500E-01 1.000000E+15
39 traj.cruise.states:distance_2 c 0.000000E+00 1.111212E+00 1.000000E+15
40 traj.cruise.states:distance_3 c 0.000000E+00 1.585595E+00 1.000000E+15
41 traj.cruise.states:distance_4 c 0.000000E+00 2.239878E+00 1.000000E+15
42 traj.cruise.states:distance_5 c 0.000000E+00 2.446891E+00 1.000000E+15
43 traj.cruise.states:distance_6 c 0.000000E+00 2.739810E+00 1.000000E+15
44 traj.cruise.states:distance_7 c 0.000000E+00 3.143876E+00 1.000000E+15
45 traj.cruise.states:distance_8 c 0.000000E+00 3.271737E+00 1.000000E+15
46 traj.cruise.controls:mach_0 c 1.400000E+00 1.440000E+00 1.480000E+00
47 traj.cruise.controls:mach_1 c 1.400000E+00 1.440000E+00 1.480000E+00
48 traj.descent_1.t_duration_0 c 5.000000E-01 6.183858E-01 1.500000E+00
49 traj.descent_1.states:mass_0 c 0.000000E+00 6.255086E+00 1.000000E+17
50 traj.descent_1.states:mass_1 c 0.000000E+00 6.249633E+00 1.000000E+17
51 traj.descent_1.states:mass_2 c 0.000000E+00 6.247926E+00 1.000000E+17
52 traj.descent_1.states:mass_3 c 0.000000E+00 6.241799E+00 1.000000E+17
53 traj.descent_1.states:mass_4 c 0.000000E+00 6.233913E+00 1.000000E+17
54 traj.descent_1.states:mass_5 c 0.000000E+00 6.231609E+00 1.000000E+17
55 traj.descent_1.states:mass_6 c 0.000000E+00 6.228390E+00 1.000000E+17
56 traj.descent_1.states:mass_7 c 0.000000E+00 6.223660E+00 1.000000E+17
57 traj.descent_1.states:mass_8 c 0.000000E+00 6.221974E+00 1.000000E+17
58 traj.descent_1.states:distance_0 c 0.000000E+00 3.311103E+00 1.000000E+15
59 traj.descent_1.states:distance_1 c 0.000000E+00 3.358512E+00 1.000000E+15
60 traj.descent_1.states:distance_2 c 0.000000E+00 3.372287E+00 1.000000E+15
61 traj.descent_1.states:distance_3 c 0.000000E+00 3.419610E+00 1.000000E+15
62 traj.descent_1.states:distance_4 c 0.000000E+00 3.477232E+00 1.000000E+15
63 traj.descent_1.states:distance_5 c 0.000000E+00 3.493981E+00 1.000000E+15
64 traj.descent_1.states:distance_6 c 0.000000E+00 3.515621E+00 1.000000E+15
65 traj.descent_1.states:distance_7 c 0.000000E+00 3.540363E+00 1.000000E+15
66 traj.descent_1.states:distance_8 c 0.000000E+00 3.546580E+00 1.000000E+15
67 traj.descent_1.controls:mach_0 c 3.600000E-01 1.440000E+00 1.480000E+00
68 traj.descent_1.controls:mach_1 c 3.600000E-01 1.025301E+00 1.480000E+00
69 traj.descent_1.controls:mach_2 c 3.600000E-01 7.171814E-01 1.480000E+00
70 traj.descent_1.controls:mach_3 c 3.600000E-01 4.000000E-01 1.480000E+00
Constraints (i - inequality, e - equality)
Index Name Type Lower Value Upper Status Lagrange Multiplier (N/A)
0 mission:constraints:range_residual e 0.000000E+00 2.273737E-14 0.000000E+00 9.00000E+100
1 gtow_constraint.GTOW e 0.000000E+00 1.035923E-13 0.000000E+00 9.00000E+100
2 link_climb_1_mass.mass e 0.000000E+00 8.053030E-13 0.000000E+00 9.00000E+100
3 mission:constraints:mass_residual e 0.000000E+00 -8.850475E-13 0.000000E+00 9.00000E+100
4 traj.linkages.climb_1:mach_final|cruise:mach_initial e 0.000000E+00 -6.084022E-14 0.000000E+00 9.00000E+100
5 traj.linkages.cruise:mach_final|descent_1:mach_initial e 0.000000E+00 2.096101E-13 0.000000E+00 9.00000E+100
6 traj.climb_1.mach[initial] e 4.000000E-01 4.000000E-01 4.000000E-01 9.00000E+100
7 traj.climb_1.mach[final] e 1.440000E+00 1.440000E+00 1.440000E+00 9.00000E+100
8 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -4.319080E-13 0.000000E+00 9.00000E+100
9 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 2.758899E-10 0.000000E+00 9.00000E+100
10 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 1.532264E-08 0.000000E+00 9.00000E+100
11 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -2.616900E-09 0.000000E+00 9.00000E+100
12 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -6.675826E-09 0.000000E+00 9.00000E+100
13 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -4.598945E-09 0.000000E+00 9.00000E+100
14 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -2.109938E-09 0.000000E+00 9.00000E+100
15 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -9.625789E-10 0.000000E+00 9.00000E+100
16 traj.climb_1.collocation_constraint.defects:mass e 0.000000E+00 -6.210563E-11 0.000000E+00 9.00000E+100
17 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 9.122981E-13 0.000000E+00 9.00000E+100
18 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 5.032798E-12 0.000000E+00 9.00000E+100
19 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 4.044662E-12 0.000000E+00 9.00000E+100
20 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 2.304226E-12 0.000000E+00 9.00000E+100
21 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 5.059175E-12 0.000000E+00 9.00000E+100
22 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 3.278615E-12 0.000000E+00 9.00000E+100
23 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 9.536970E-13 0.000000E+00 9.00000E+100
24 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 3.904113E-12 0.000000E+00 9.00000E+100
25 traj.climb_1.collocation_constraint.defects:distance e 0.000000E+00 2.735696E-12 0.000000E+00 9.00000E+100
26 traj.cruise.mach[initial] e 1.440000E+00 1.440000E+00 1.440000E+00 9.00000E+100
27 traj.cruise.mach[final] e 1.440000E+00 1.440000E+00 1.440000E+00 9.00000E+100
28 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -1.693348E-12 0.000000E+00 9.00000E+100
29 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -5.181346E-12 0.000000E+00 9.00000E+100
30 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -3.197852E-12 0.000000E+00 9.00000E+100
31 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -1.699422E-12 0.000000E+00 9.00000E+100
32 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -3.144869E-12 0.000000E+00 9.00000E+100
33 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -1.280675E-12 0.000000E+00 9.00000E+100
34 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -6.711733E-13 0.000000E+00 9.00000E+100
35 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -2.156014E-13 0.000000E+00 9.00000E+100
36 traj.cruise.collocation_constraint.defects:mass e 0.000000E+00 -2.015022E-13 0.000000E+00 9.00000E+100
37 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 7.722710E-13 0.000000E+00 9.00000E+100
38 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 3.488542E-12 0.000000E+00 9.00000E+100
39 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 2.525889E-12 0.000000E+00 9.00000E+100
40 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 7.485499E-13 0.000000E+00 9.00000E+100
41 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 3.467194E-12 0.000000E+00 9.00000E+100
42 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 2.671880E-12 0.000000E+00 9.00000E+100
43 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 8.522817E-13 0.000000E+00 9.00000E+100
44 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 4.077840E-12 0.000000E+00 9.00000E+100
45 traj.cruise.collocation_constraint.defects:distance e 0.000000E+00 3.262360E-12 0.000000E+00 9.00000E+100
46 traj.descent_1.mach[initial] e 1.440000E+00 1.440000E+00 1.440000E+00 9.00000E+100
47 traj.descent_1.mach[final] e 4.000000E-01 4.000000E-01 4.000000E-01 9.00000E+100
48 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 7.572095E-12 0.000000E+00 9.00000E+100
49 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 4.008018E-09 0.000000E+00 9.00000E+100
50 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 4.178148E-09 0.000000E+00 9.00000E+100
51 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 9.566943E-09 0.000000E+00 9.00000E+100
52 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 1.753828E-08 0.000000E+00 9.00000E+100
53 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 2.625537E-09 0.000000E+00 9.00000E+100
54 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 7.673547E-10 0.000000E+00 9.00000E+100
55 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 1.539146E-10 0.000000E+00 9.00000E+100
56 traj.descent_1.collocation_constraint.defects:mass e 0.000000E+00 -7.814119E-12 0.000000E+00 9.00000E+100
57 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 1.068852E-12 0.000000E+00 9.00000E+100
58 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -1.183992E-10 0.000000E+00 9.00000E+100
59 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -2.099469E-10 0.000000E+00 9.00000E+100
60 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -3.645874E-10 0.000000E+00 9.00000E+100
61 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -3.466530E-10 0.000000E+00 9.00000E+100
62 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -1.920680E-10 0.000000E+00 9.00000E+100
63 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -8.315232E-11 0.000000E+00 9.00000E+100
64 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 -3.144570E-11 0.000000E+00 9.00000E+100
65 traj.descent_1.collocation_constraint.defects:distance e 0.000000E+00 3.698722E-12 0.000000E+00 9.00000E+100
66 traj.climb_1.throttle[path] i 0.000000E+00 6.810482E-01 1.000000E+00 9.00000E+100
67 traj.climb_1.throttle[path] i 0.000000E+00 5.043644E-01 1.000000E+00 9.00000E+100
68 traj.climb_1.throttle[path] i 0.000000E+00 5.099191E-01 1.000000E+00 9.00000E+100
69 traj.climb_1.throttle[path] i 0.000000E+00 5.286416E-01 1.000000E+00 9.00000E+100
70 traj.climb_1.throttle[path] i 0.000000E+00 5.286416E-01 1.000000E+00 9.00000E+100
71 traj.climb_1.throttle[path] i 0.000000E+00 5.979883E-01 1.000000E+00 9.00000E+100
72 traj.climb_1.throttle[path] i 0.000000E+00 7.161999E-01 1.000000E+00 9.00000E+100
73 traj.climb_1.throttle[path] i 0.000000E+00 7.567690E-01 1.000000E+00 9.00000E+100
74 traj.climb_1.throttle[path] i 0.000000E+00 7.567690E-01 1.000000E+00 9.00000E+100
75 traj.climb_1.throttle[path] i 0.000000E+00 8.308372E-01 1.000000E+00 9.00000E+100
76 traj.climb_1.throttle[path] i 0.000000E+00 9.513043E-01 1.000000E+00 9.00000E+100
77 traj.climb_1.throttle[path] i 0.000000E+00 9.998092E-01 1.000000E+00 9.00000E+100
78 traj.cruise.throttle[initial] i 0.000000E+00 6.607427E-01 1.000000E+00 9.00000E+100
79 traj.cruise.throttle[final] i 0.000000E+00 6.303794E-01 1.000000E+00 9.00000E+100
80 traj.descent_1.throttle[path] i 0.000000E+00 2.357691E-01 1.000000E+00 9.00000E+100
81 traj.descent_1.throttle[path] i 0.000000E+00 1.863926E-01 1.000000E+00 9.00000E+100
82 traj.descent_1.throttle[path] i 0.000000E+00 1.554976E-01 1.000000E+00 9.00000E+100
83 traj.descent_1.throttle[path] i 0.000000E+00 1.474062E-01 1.000000E+00 9.00000E+100
84 traj.descent_1.throttle[path] i 0.000000E+00 1.474062E-01 1.000000E+00 9.00000E+100
85 traj.descent_1.throttle[path] i 0.000000E+00 1.186508E-01 1.000000E+00 9.00000E+100
86 traj.descent_1.throttle[path] i 0.000000E+00 6.371932E-02 1.000000E+00 9.00000E+100
87 traj.descent_1.throttle[path] i 0.000000E+00 3.679611E-02 1.000000E+00 9.00000E+100
88 traj.descent_1.throttle[path] i 0.000000E+00 3.679611E-02 1.000000E+00 9.00000E+100
89 traj.descent_1.throttle[path] i 0.000000E+00 4.706092E-04 1.000000E+00 9.00000E+100
90 traj.descent_1.throttle[path] i 0.000000E+00 2.004013E-04 1.000000E+00 9.00000E+100
91 traj.descent_1.throttle[path] i 0.000000E+00 4.840669E-02 1.000000E+00 9.00000E+100
--------------------------------------------------------------------------------
Warning:
Aviary run failed. See the dashboard for more details.
/usr/share/miniconda/envs/test/lib/python3.12/site-packages/openmdao/core/driver.py:144: OMDeprecationWarning:boolean evaluation of DriverResult is temporarily implemented to mimick the previous `failed` return behavior of run_driver.
Use the `success` attribute of the returned DriverResult object to test for successful driver completion.
And let’s print out the objective value, fuel burned:
print(prob.get_val(av.Mission.Summary.FUEL_BURNED, units='kg')[0])
9780.996765055579
The added flexibility in the mission allowed the optimizer to reduce the fuel burn compared to the linear Mach profile case.
Looking at the altitude and Mach profiles, we see that the optimizer chose a more subtly complex Mach profile:
Conclusion#
This example demonstrated how to use Aviary to optimize a more complex mission. We increased the number of segments in the mission, allowed the optimizer to choose the optimal Mach profile, and increased the polynomial control order to allow for more complex Mach profiles. We also modified the aircraft configuration to demonstrate how Aviary can be used to quickly evaluate the impact of design changes on the mission performance.