Skip to content

Commit

Permalink
Added derivative computation to black box
Browse files Browse the repository at this point in the history
  • Loading branch information
John Jasa committed Jul 2, 2018
1 parent 47ad2fc commit 9a1b9b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions black_box_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,10 @@ def run_aerostruct(twist_cp, thickness_cp, alpha, root_chord, taper_ratio, E):
print('lift: {:18.5f} N'.format(lift))
print('total_weight: {:18.5f} N'.format(total_weight))
print('failure: {:18.5f}'.format(failure)) # Needs to be <0 to not fail
print()

inputs = ['wing.twist_cp', 'wing.thickness_cp', 'alpha']
outputs = ['fuelburn', 'wing_perf.structural_weight', 'wing_perf.L', 'total_weight', 'wing_perf.failure']

derivs = OAS_prob.prob.calc_gradient(inputs, outputs, return_format='dict')
print(derivs)

0 comments on commit 9a1b9b7

Please sign in to comment.