On Wed, May 23, 2012 at 12:35:31AM -0700, kylmala wrote:> Hi,
>
> I have a problem with R optimization. I try to copy excel solver acts to R.
> Solver has some problems with nonlinear optimisation.
>
> Suppose we have resources: (X,Y,Z)=(20, 30, 25) and services:
> matrix(10,11,0, 13,12,10, 0,24,26), nrow=3.
>
> Now we should optimize the problem: max( min(a/10,b/11) +
> min(aa/13,bb/12,cc/10) + min(24/bb,26/cc) ) so that
>
> a+aa<=15
> b+bb+bb<=35
> cc+ccc<=40
Hi.
The criterion function contains two minima of linear functions,
namely min(a/10,b/11) and min(aa/13,bb/12,cc/10), and one
minimum of nonlinear functions, namely min(24/bb,26/cc).
Is this correct?
In a later email, you formulate a problem, where all terms are linear.
If the term min(24/bb,26/cc) is actually min(bb/24,cc/26), then
the problem may be formulated as a linear programming problem
by introducing additional variables m1, m2, m3 and the
constraints
m1 <= a/10
m1 <= b/11
m2 <= aa/13
m2 <= bb/12
m2 <= cc/10
m3 <= bb/24
m3 <= cc/26
and maximizing m1 + m2 + m3. This problem may be solved using
package lpSolve.
Petr Savicky.