コード例 #1
0
 def test_optim(self):
     N = 10
     Target_Lift = 606570.049598
     opt_problem = AerodynamicOptimization(N=N, Target_Lift=Target_Lift)
     Initial_drag = 15805.247796847883
     Initial_LoD = Target_Lift / Initial_drag
     print "Running optimization"
     opt_problem.run()
     self.assertAlmostEqual(Target_Lift,
                            opt_problem.llw_comp.Lift,
                            places=3)
     self.assertGreater(Initial_drag, opt_problem.llw_comp.Drag)
     self.assertGreater(opt_problem.llw_comp.LoD, Initial_LoD)
     return
コード例 #2
0
# 
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
# 
#  https://github.com/matthieu-meaux/DLLM.git
#
# @author : Damien Guenot

from DLLMWrappers.OpenMDAOWrapper import AerodynamicOptimization
        

import time
tt = time.time()
N = 10
opt_problem = AerodynamicOptimization(N)
opt_problem.configure()
opt_problem.DLLMOpenMDAO.execute()
print "Initial lift =", opt_problem.DLLMOpenMDAO.Lift
print "Initial drag =", opt_problem.DLLMOpenMDAO.Drag
print "Initial lift over drag =", opt_problem.DLLMOpenMDAO.LoD
print "Running optimization"
opt_problem.run()
print "*** Elapsed time: ", time.time() - tt, "seconds ***"

print "Number of function evaluations =", opt_problem.DLLMOpenMDAO.exec_count
print "Number of gradient evaluations =", opt_problem.DLLMOpenMDAO.derivative_exec_count
print "Final lift =", opt_problem.DLLMOpenMDAO.Lift
print "Final drag =", opt_problem.DLLMOpenMDAO.Drag
print "Final lift over drag =", opt_problem.DLLMOpenMDAO.LoD
for i_dv_info in opt_problem.DLLMOpenMDAO.get_dv_info_list():