开发者

Find maximum of a function

开发者 https://www.devze.com 2023-02-08 09:38 出处:网络
I need to find a maximum of the function: a1^x1 * const1 + a2^x2 * const2 +....+ ak^xk * constk = qaulity

I need to find a maximum of the function:

a1^x1 * const1 + a2^x2 * const2 +....+ ak^xk * constk = qaulity

where xk>0 and xk is integer. ak is constant.

constraint: a1^x1 * const1*func(x1) + a2^x2 * const2*func(x2) +....+ ak^xk * constk*func(xk) < Budget开发者_高级运维

Where func is a discrete function:

func(x)
{
    switch(x)
    {
        case 1: return 423;
        case 2: return 544;
        ...
        etc
    }
}

k may be big(over 1000). x less then 100. What is the best method?


There are techniques like nelder-mead optimization (which I believe GSL implements), but most techniques assume some sort of special structure (i.e. convexity or continuity). Depending on the values of the function, there may not exist a unique optimum or even an optimum that a normal downhill method can find.

0

精彩评论

暂无评论...
验证码 换一张
取 消