Skip to content

Commit

Permalink
finished optimization tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Dec 26, 2020
1 parent ce52e5a commit 64494c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 1 addition & 9 deletions Regional_Jet_Optimization/Optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def main():
#output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
#print (output)

## Uncomment these lines when you want to start an optimization problem from a different initial guess
#inputs = [1.28, 1.38]
#scaling = problem.optimization_problem.inputs[:,3] #have to rescale inputs to start problem from here
#scaled_inputs = np.multiply(inputs,scaling)
#problem.optimization_problem.inputs[:,1] = scaled_inputs
#output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
#print(output)

#print('fuel burn = ', problem.summary.base_mission_fuelburn)
#print('fuel margin = ', problem.all_constraints())

Expand Down Expand Up @@ -131,7 +123,7 @@ def setup():
return nexus

def variable_sweep(problem):
number_of_points = 5
number_of_points = 20
outputs = carpet_plot(problem, number_of_points, 0, 0) #run carpet plot, suppressing default plots
inputs = outputs.inputs
objective = outputs.objective
Expand Down
1 change: 0 additions & 1 deletion Solar_UAV_Optimization/Missions.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def mission(analyses,vehicle):
segment.analyses.extend(analyses.base)

# segment attributes
ones_row = segment.state.numerics.ones_row
segment.state.numerics.number_control_points = 50
segment.dynamic_pressure = 115.0 * Units.pascals
segment.start_time = time.strptime("Tue, Jun 21 11:00:00 2020", "%a, %b %d %H:%M:%S %Y",)
Expand Down
5 changes: 4 additions & 1 deletion Solar_UAV_Optimization/Optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import SUAVE.Optimization.Package_Setups.scipy_setup as scipy_setup
import SUAVE.Optimization.Package_Setups.pyopt_setup as pyopt_setup
from SUAVE.Optimization.Nexus import Nexus
import pylab as plt


# ----------------------------------------------------------------------
# Run the whole thing
Expand Down Expand Up @@ -120,4 +122,5 @@ def setup():
return nexus

if __name__ == '__main__':
main()
main()
plt.show()

0 comments on commit 64494c6

Please sign in to comment.