本文整理汇总了Python中openopt.NLP.minTime方法的典型用法代码示例。如果您正苦于以下问题:Python NLP.minTime方法的具体用法?Python NLP.minTime怎么用?Python NLP.minTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openopt.NLP
的用法示例。
在下文中一共展示了NLP.minTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NLP
# 需要导入模块: from openopt import NLP [as 别名]
# 或者: from openopt.NLP import minTime [as 别名]
p = NLP(lambda x: ((x-M)**2).sum(), cos(arange(N)))
p.lb, p.ub = -6*ones(N), 6*ones(N)
p.lb[3] = 5.5
p.ub[4] = 4.5
p.c = lambda x: [2* x[0] **4-32, x[1]**2+x[2]**2 - 8]
p.h = (lambda x: 1e1*(x[-1]-1)**4, lambda x: (x[-2]-1.5)**4)
"""
minTime is used here
for to provide enough time for user
to play with GUI
"""
minTime = 1.5 # sec
p.name = 'GUI_example'
p.minTime = minTime
"""
hence maxIter, maxFunEvals etc
will not trigger till minTime
only same iter point x_k-1=x_k
or some coords = nan
can stop calculations
other antistop criteria: minFunEvals, minIter, minCPUTime
however, some solvers cannot handle them
"""
# start=True means don't wait for user to press "Run"
r = manage(p,'ralg', plot=1, start=True)