[英]Optimization algorithm to find acceptable limits of a concave function
I have a black box function f(x)
with the following criteria:我有一个具有以下条件的黑盒函数
f(x)
:
Within Python, I would like to get an algorithm that delivers to me - with the least amount of steps - the positions x0
, x1
where f
is greater or equal to a
.在 Python 中,我想获得一种算法,该算法以最少的步数提供给我的位置
x0
、 x1
,其中f
大于或等于a
。
It can be assumed that there exist values for x
where f(x)
is greater/equal than a
.可以假设存在
x
值,其中f(x)
大于/等于a
。
See this picture for visualizing the problem:请参阅此图片以可视化问题:
So my questions are:所以我的问题是:
bubble sort algorithm
when the task is to sort a list)?bubble sort algorithm
)?Looking for points where a function crosses the x-axis is zero-finding
or x-axis intercept finding.寻找函数与 x 轴交叉的点是
zero-finding
或 x 轴截距查找。 You can define a new function g(x) = f(x) - a then find the 'zeros' of the g(x) function.您可以定义一个新函数 g(x) = f(x) - a 然后找到 g(x) 函数的“零点”。
The simplest way of finding intercepts is to find an xa and xb where g(xa) < 0 and g(xb) > 0. Then choose an xc midway between those and continue using xc and one of xa or xb (that has the opposite sign as xc).找到截距的最简单方法是找到 xa 和 xb,其中 g(xa) < 0 和 g(xb) > 0。然后在它们之间选择一个 xc 并继续使用 xc 和 xa 或 xb 之一(具有相反的签名为 xc)。 Repeat these steps again until the interval between x's is small enough to be considered 'found'.
再次重复这些步骤,直到 x 之间的间隔小到足以被视为“找到”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.