Skip to content

Commit 0292a5e

Browse files
committed
updated regional jet tutorial
1 parent 5e1189c commit 0292a5e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

_posts/2016-02-11-Regional_Jet_Optimization.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,22 @@ Then run the program again. This could take a few minutes. The results should lo
112112

113113
![2D Sweep](/images/wing_area_v_cruise_altitude_v_fuel_burn_5_steps.png)
114114

115-
The labeled lines depict the fuel margin (i.e. fraction of the aircraft remaining weight that can be loaded with fuel). Positive values indicate a feasible design. Fuel burn is shown in the colored contours. Note that a smoother plot may be created by changing the number of points in the sweep function, but this will take more time. A carpet plot run using 20 points can be seen below.
115+
The labeled lines depict the fuel margin (i.e. fraction of the aircraft remaining weight that can be loaded with fuel). Positive values indicate a feasible design. Fuel burn is shown in the colored contours. Note that a smoother plot may be created by changing the number of points in the sweep function, but this will take more time. A carpet plot run using 20 points can be seen below. A local minimum is now visible.
116116

117117
![2D Sweep_20](/images/wing_area_v_cruise_altitude_v_fuel_burn.png)
118118

119+
Note: If you run this 20 point case yourself you may see messages indicating that a segment did not converge. This is normal and can happen when a mission is run far from a feasible point. In this case, it does not have a negative impact on the results.
119120

120121
### Optimizing:
121122

122-
Now try running an Optimization. Recomment `variable_sweep(problem)` then uncomment the line below:
123+
Now try running an Optimization. Recomment `variable_sweep(problem)` then uncomment the lines below:
123124

124125
output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
126+
print output
125127

126128
and run the file again.
127129

128-
From the default inputs, the terminal (or IDE output) should display an optimum of [ 1.14127857 1.05251198], which corresponds to a wing area of 114.1 m^2, and 10.5 km (which, from the 2D sweep section of this tutorial, is not quite the true minimum, but it is close). A zoomed-in-plot of the objective function shape near the optimum is shown below to illustrate.
129-
130-
![2D Sweep_zoom](/images/wing_area_v_cruise_altitude_v_fuel_burn_5_steps_zoomed.png)
131-
132-
133-
As can be seen in the plot above, there is a local optimum near the true optimum.
130+
From the default inputs, the terminal (or IDE output) should display an optimum of [ 1.08980937 1.02089232], which corresponds to a wing area of 109 m^2, and 10.2 km. It appears to have found the local minimum.
134131

135132
Now try starting the optimization from a different initial guess. You can either modify the input parameters in the initial formulation (the relevant lines are repeated below with the modification)
136133

@@ -149,11 +146,10 @@ or set up the optimization problem and change the inputs manually by uncommentin
149146
rescale inputs to start problem from here
150147
scaled_inputs = np.multiply(inputs,scaling)
151148
problem.optimization_problem.inputs[:,1] = scaled_inputs
149+
output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
150+
print output
152151

153152

154-
This starts the optimization problem above the feasible region (wing area = 128 m^2, altitude = 13.8 km), and results in a fuel burn that is 30 kg lower than the result using the initial guess. This illustrates the important of choosing a starting point when running optimization problem. Additionally, this demonstrates SUAVE's ability to handle infeasible cases, showing that it can converge to a feasible case even when starting from an infeasible set of initial inputs. Plots of the default optimization history for both sets of inputs can be seen below.
155-
156-
![Opt History](/images/optimization_path.png)
157-
153+
This starts the optimization problem above the feasible region (wing area = 128 m^2, altitude = 13.8 km), and results in a fuel burn that is 30 kg lower than the result using the initial guess. This illustrates the important of choosing a starting point when running optimization problem. Additionally, this demonstrates SUAVE's ability to handle infeasible cases, showing that it can converge to a feasible case even when starting from an infeasible set of initial inputs.
158154

159155
At this point, you can explore other starting points, or alter the vehicle or mission properties in Vehicles.py or Missions.py. Additionally, feel free to start using this as the basis for creating custom optimization scripts.

0 commit comments

Comments
 (0)