我目前有这个功能:
public double Max(double[] x, double[] y)
{
//Get min and max of x array as integer
int xMin = Convert.ToInt32(x.Min());
int xMax = Convert.ToInt32(x.Max());
// Generate a list of x values for input to Lagrange
double i = 2;
double xOld = Lagrange(xMin,x,y);
double xNew = xMax;
do
{
xOld = xNew;
xNew = Lagrange(i,x,y);
i = i + 0.01;
} while (xOld > xNew);
return i;
}
在斜坡下降的曲线上, 这将找到最小值... 不过, < a href=" "http://www.wolflamalpha.com/ input/?? i=Plot% 5B% 280.167% 20B% 20x% 5E5% 2bx% 5E4% 20_ 20_ 3958% 2908.% 225.708% 5E3-%2888.854% 20x%5E2% 29%2b% 202. 202.b% 283. 86. 87.% 20x% 29-70%29,% 7Bx,0. 6% 7D%5D" rel=“ nofollown norerer” < a>
< 坚固> 如何找到三个迷你, 并将其输出为数组 < / 坚固 > 或单个变量? 此曲线只是个示例 - 它可以是反向的 - 不论如何, 我需要找到多个变量 。 所以一旦发现第一分钟, 它需要知道如何跨过透视点并找到下一个变量... : /
a href="http://en.wikipedia.org/wiki/Lagrange_multiplier" rel="不跟随 nofollow noreferrer" 这里可以找到 Lagrange 函数 。 ** 出于所有实际目的, Lagrange 函数会给我f(x), 当我输入 x... 视觉... 时, 它意味着由 wolfram alpha 提供的曲线 。
a href="https://math.stackschange.com/ questions/148762/method-to-find-cent-roid-of-curve" > 这个难题的数学方面可在这里找到 。 **
Possible solution? Generate an array of input, say x[1,1.1,1.2,1.3,1.4...], get an array back from the Lagrange function. Then find the three lowest values of this function? Then get the keys corresponding to the values? How would I do this?