Scipy error using optimization module. Failure converting array to fortran
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Trying to use scipy's optimize module to find the minimum of a function using slsqp and I'm running into some issues. The actual code calling the function is shown below: def minimizeWebEnergyLost ( x , parameters ): """values = [theta, velocity]""" firstTerm = lambda values : ( x * values [ 1 ]** 2 / 2.0 ) sqrtTerm = lambda values : np . sqrt (( parameters . gravity ** 2 * x ** 2 ) / ( 4 * values [ 1 ]** 4 * np . cos ( values [ 0 ])** 4 ) + 1 ) secondTerm = lambda values : ( values [ 1 ]** 4 * np . cos ( values [ 0 ])** 2 ) /