Items tagged with optimization

i use optimization package with constraint hello >= 0

Minimize(xx=0, {hello >= 0})

but solution only return the case when hello = 0

how about hello > 0?

i would like to find all possible set of solutions using this constraint

do i need to set upper bound, such as {hello <= 7, hello >=0}

can it return solution when hello = 1.1, 1.2, ...2, 2.1, 2.2, 2.3, ....7

hello, i have problem here.

> restart;
> with(linalg);
> NULL;
> fungsi1 := sum(d1[h]+b1[h], h = 1 .. 7);
> fungsi2 := sum(sum(d2[h, t]+b2[h, t], t = 1 .. 23), h = 1 .. 7);
> fungsi3 := sum(sum(d3[h, t]+b3[h, t], t = 1 .. 23), h = 1 .. 7);
> fungsi4 := sum(d4[k]+b4[k], k = 1 .. 3);
> fungsi := fungsi1+fungsi2+fungsi3+fungsi4;
> NULL;
> NULL;
> k1 := seq(sum(X[h, t], t = 1 .. 23) >= 9, h = 1 .. 6);
> k2 := seq(sum(Y[h, t], t = 1 .. 23) >= 2, h = 1 .. 6);
> k3 := seq(sum(Z[h, t], t = 1 .. 23) >= 2, h = 1 .. 6);
> NULL;
> k4 := seq(seq(X[h, t]+Y[h, t]+Z[h, t] <= 1, h = 1 .. 6), t = 1 .. 23);
> NULL;
> k5 := seq(seq(Z[h, t]+Z[h+1, t] <= 1, h = 1 .. 6), t = 1 .. 23);
> NULL;
> k6 := seq(sum(X[h, t]+Y[h, t]+Z[h, t], t = 1 .. 23) >= 5, h = 1 .. 7);
> k7 := seq(sum(X[h, t]+Y[h, t]+Z[h, t], t = 1 .. 23) <= 6, h = 1 .. 7);
> NULL;
> k8 := seq(sum(X[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 15, h = 1 .. 6);
> k9 := seq(sum(Y[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 4, h = 1 .. 6);
> k10 := seq(sum(Z[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 4, h = 1 .. 6);
> NULL;
> k11 := seq(seq(Y[h, t]+Y[h+1, t]+b2[h, t]-d2[h, t] <= 1, t = 1 .. 23), h = 1 .. 6);
> NULL;
> k12 := seq(seq(Z[h, t]+Z[h+1, t]+b3[h, t]-d3[h, t] <= 1, t = 1 .. 23), h = 1 .. 6);
> NULL;
> k13 := sum(X[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> k14 := sum(Y[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> k15 := sum(Z[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> with(Optimization);
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, 

  NLPSolve, QPSolve]
> CodeTools:-Usage(LPSolve(fungsi, {k1, k10, k11, k12, k13, k14, k15, k2, k3, k4, k5, k6, k7, k8, k9}, assume = {integer, nonnegative}));
Error, (in Optimization:-LPSolve) no feasible point found for LP subproblem

why it can be? please i need help. 

I was looking to see if anyone has come across a Maple routine for a savings algorithm - specifically, Clarke and Wright. In fact, any classical savings heuristic would also be interesting.

Any guidance would be truly appreciated.

If binary constraints are imposed on an optimization problem and LPSolve presents a solution, is it possible to extract the variables that have zero or one assigned to them? This would be most useful if there are many variables, for example...

If a solution is returned that looks like ...

[x[001]=0, x[101]=1, x[201]=0, x[301]=1, ....], how can I filter those solutions that equal zero?

Thanks for reading!

I was curious to know if one can extract a specific solution from a LPSolve routine. 

As an example, consider the following output to a constrained linear problem. The objective value is 8 and the decision variable values (binary) are given.

Sol := [8, [w[1, 1] = 1., x[0, 0, 1] = 0, x[0, 1, 1] = 1, x[0, 2, 1] = 0, x[1, 0, 1] = 0, x[1, 1, 1] = 0, x[1, 2, 1] = 1, x[2, 0, 1] = 0, x[2, 1, 1] = 0, x[2, 2, 1] = 0, y[0, 0] = 0., y[0, 1] = 0., y[1, 1] = 2.]]

I am interested to know if we can isolate any variable value from this solution. I know that Sol[1] will return 8, and Sol[2] will return the remaining terms. But what if I wanted, say, x[1,2,1] alone?

Thanks for reading!

guys, need your help. i've been trying to find 9 pamater which are psi1,psi2,psi3,m1,m2,m3,sigma1,sigma2,sigma3. I need to minimize one function. i have datas and several contraints. i will share this with you guys. Really need your help and i'll appreciate any suggestion. Thanks

data:

a(x):=qtopi[x];

this is my objective function:

fungsikerugian := sum((1-(1-(psi1*exp(-((x+1)/m1)^(m1/sigma1))+psi2*(1-exp(-((x+1)/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x+1-m3)/sigma3)))/(psi1*exp(-(x/m1)^(m1/sigma1))+psi2*(1-exp(-(x/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x-m3)/sigma3))))/a(x))^2, x = 0 .. 111);

these are my contraints

a := psi1+psi2+psi3 = 1;
         
b := 0 <= exp(-((x+1)/m1)^(m1/sigma1));
                          
c := 1 >= exp(-((x+1)/m1)^(m1/sigma1));
                       
d := 0 <= 1-exp(-((x+1)/m2)^(-m2/sigma2));
                        
e := 1 >= 1-exp(-((x+1)/m2)^(-m2/sigma2));
                 
f := 0 <= exp(exp(-m3/sigma3)-exp((x+1-m3)/sigma3));
                  
g := 1 >= exp(exp(-m3/sigma3)-exp((x+1-m3)/sigma3));
            
h := 0 <= exp(-(x/m1)^(m1/sigma1));
                        
i := 1 >= exp(-(x/m1)^(m1/sigma1));
                     
j := 0 <= 1-exp(-(x/m2)^(-m2/sigma2));
                           
k := 1 >= 1-exp(-(x/m2)^(-m2/sigma2));
                      
l := 0 <= exp(exp(-m3/sigma3)-exp((x-m3)/sigma3));
                   
m := 1 >= exp(exp(-m3/sigma3)-exp((x-m3)/sigma3));
               
n := 0 <= 1-(psi1*exp(-((x+1)/m1)^(m1/sigma1))+psi2*(1-exp(-((x+1)/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x+1-m3)/sigma3)))/(psi1*exp(-(x/m1)^(m1/sigma1))+psi2*(1-exp(-(x/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x-m3)/sigma3)));

o := 1 >= 1-(psi1*exp(-((x+1)/m1)^(m1/sigma1))+psi2*(1-exp(-((x+1)/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x+1-m3)/sigma3)))/(psi1*exp(-(x/m1)^(m1/sigma1))+psi2*(1-exp(-(x/m2)^(-m2/sigma2)))+psi3*exp(exp(-m3/sigma3)-exp((x-m3)/sigma3)));
 
i use this to solve that but seems to not going anywhere
NLPSolve(fungsikerugian, {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o}, assume = nonnegative);
 
Thanks

I wish to apply several i-j constraints to an optimization problem that involves minimizing a function x[i,j]. 

Does anyone know of a simple way to exclude values for i and j? For instance, how do we specify the conditions, i not equal to j, i is not equal to 1, etc.?

Thanks in advance!

 

 

Can somebody suggest an efficient way to specify / input a large list of binary variables in the LPSolve command, for example:

> LPSolve(objective function, constraints, binaryvariables={ x[0,0,1], .x[0,0,2], ...., x[i,j,k]}

Is it possible to assign a name to the set rather than input each element, x[i,j,k], manually?

Thanks in advance!

Friends in Maple

I have a Vehicle Routing Problem I wish to cast as a integer model. VRP is a kind of TSP and knapsack problem hybrid  I would be grateful if someone can finish it. answers included. This isn't homework BTW.

VRP_IP.mw

Dear all

I would like to minimuze the following function 4 x ^2 + 4 x y  under constraint  16=x^2 y  and both x , y  nonnegative real number 

this is my code

with(Optimization)

Minimize(4*x^2+4*x*y, {x^2*y = 16}, assume = nonnegative)

 

The result obtained from this code is strange

because when i do directly the computation without maple by substituting y =16/x^2 and simple derivation i get the minimum is at x=2 and so y=4 and therefore the minimum is 48

But as i say using my code I obtained a different solution

whats is the problem occurs in this situation

Many thanks

 

Hello

I know there are other methods to solve this classic probem, but I wanted to cast it as a linear program. I wonder if an expert can look at my IP coding and please correct my error.

TSP_IP.mw

sorry its a mishmash of 1D and 2D inputs

I'm inputting an optimization problem into Maple, and somewhere along the way my code stops working.  (Code is at the bottom.)

I need to find the second derviative for my Profit statement [(p-c)d]. I know the first derivative, deriving for p is, is d. d=ap-b, so deriving that statement for p should equal −abp−b−1 . For some reason, Maple is showing my second derivative as equal to zero.

Can anybody help me? TIA!

restart;

Profit := (p-c)*d;

d;=ap-b;

print(Solution); 

dProfit1 := diff(Profit, p); 

dProfit2 := diff(dProfit1, p); 

ddProfit2 := diff(Profit, p, p); 

pOpt := solve(diff(Profit, p));

                           Profit:=(p-c)ap-b

                          d:=ap-b

                            Solution

                          dProfit1:=ap-b

                             dProfit2:=0

                           ddProfit2:=0

                         pOpt:={ap=0, b=b)

 

 

I'm curious to know if anyone has written a procedure to optimize the VRP with time windows / constraints.

Hello,

I have a optimization question in the following picture.

 

Question: find matrix T(t). 

 

I writed a maple code. Could you view it ? You think that it is right?

The code file I writed: maple_code_of_theory.mw

 It is really very important for me. Can you help me?

Thank you. 

 

I am working to minimize an objective function concerning a facility location problem (p-median technique).

Can somebody explain how to formulate the constraint equation that involves  1 or 0?

For instance, the constraint x[i,j]  is an element of {0,1}; namely, x[i,j] = 1 if a point is assigned to a facility located at the point j; 0 otherwise.

Thanks in advance.

 

1 2 3 4 5 6 7 Last Page 1 of 16