Skip to content

Commit

Permalink
Made the optimzer calculate radius size by FOM
Browse files Browse the repository at this point in the history
  • Loading branch information
FernCarrera committed May 22, 2019
1 parent 8629a60 commit d49fb57
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
Binary file modified Model/Propulsion/__pycache__/power_comp.cpython-36.pyc
Binary file not shown.
Binary file modified Model/Propulsion/__pycache__/weight_comp.cpython-36.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions Model/Propulsion/power_comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def setup(self):
self.add_input('rho',desc='density at SL')
self.add_input('TS') # tip speed
self.add_input('r')


self.add_output('FM',val=0.0,desc='Figure of Merit')
self.add_output('PH',val=0.0,desc='Power for Hover')
Expand All @@ -30,15 +30,15 @@ def compute(self, inputs, outputs):


S = 3.14*(r**2)
T = W # thrust required
T = W/8 # thrust required per motor
ct = T/( rho *S* (tip_speed**2) )
cp = ( 1.15*( (ct**(3/2)) /(2**.5) ) + (1/8)*0.1*cd0 )
PI = T * ((T/(2*S*rho))**.5)
PH = cp*rho*S*(tip_speed**3)
FM = PI/PH

outputs['FM'] = FM
outputs['PH'] = PH
outputs['PH'] = 8*PH/1000



Expand Down
29 changes: 16 additions & 13 deletions solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,35 @@


model.add_subsystem('weight',WeightComp())
model.add_subsystem('Fig',PowerComp())
model.add_subsystem('FOM',PowerComp())


model.connect('m','weight.m')

model.connect('weight.W','Fig.W')
model.connect('cd0','Fig.cd0')
model.connect('rho','Fig.rho')
model.connect('TS','Fig.TS')
model.connect('r','Fig.r')
model.connect('weight.W','FOM.W')
model.connect('cd0','FOM.cd0')
model.connect('rho','FOM.rho')
model.connect('TS','FOM.TS')
model.connect('r','FOM.r')


prob.driver = ScipyOptimizeDriver()
prob.driver.options['optimizer'] = 'SLSQP'
prob.driver.options['tol'] = 1e-9
prob.driver.options['disp'] = True

model.add_design_var('r', lower=0.5, upper=1)
model.add_constraint('Fig.FM',equals=0.85)
model.add_objective('rho',scaler=-1)
model.add_design_var('r',lower=0.5,upper=1.5)
model.add_constraint('FOM.FM',equals=0.85)
model.add_objective('FOM.PH')

prob.setup()

prob['m'] = 2500
prob['r'] = 0.9
prob['r'] = 1.5


#prob.run_model()
prob.set_solver_print(level=0)
prob.run_driver()
print(prob['Fig.FM'])
print(prob['Fig.r'])
#print(prob['PH'])
print('Figure of Merit:',prob['FOM.FM'])
print('Required Radius:',prob['FOM.r'])

0 comments on commit d49fb57

Please sign in to comment.