firmaulana

5 Reputation

One Badge

8 years, 345 days

MaplePrimes Activity


These are replies submitted by firmaulana

@Carl Love 

How to passing matrices from Maple to Excel?

I try ExcelTools- Export but when I open the Excel files, it's tell there are something wrong and the file must be repaired.

@Carl Love 

I try these code without quotation marks, and it is work, but its appear as one equation / constraints.

The expected result is like what I mention before (the right-hand side value can be either 1 or 0):

 For e=1, then 2*e-1=1 which means for k=1 and k=2 will be:

x[1,2,1]+x[1,3,1]+x[1,4,1]+...+x[1,17,1]+x[1,18,1]=1;

x[1,2,2]+x[1,3,2]+x[1,4,2]+...+x[1,17,2]+x[1,18,2]=0;

so on.

So for e=1, there would be 17 constraints,

for e=2 also would be produce 17 constraonts,

so for all e=1..9

there would be 17*9=153 constraints.

@tomleslie 

I'll try to explain the second sum:

Here is the second sum:

Constraint

where HAP[2*e-1,k] can be either 1 or 0, this is a complete matrix of HAP: 

HAP

Which 2*e-1 means the odd row and k is stand for the columns.

I defines constraints[2*e-1,k] as the variable for the constraints.

For instance, for e=1, then 2*e-1=1 which means for k=1 and k=2 will be:

constraints[1,1]:= x[1,2,1]+x[1,3,1]+x[1,4,1]+...+x[1,17,1]+x[1,18,1]=1;

constraints[1,2]:= x[1,2,2]+x[1,3,2]+x[1,4,2]+...+x[1,17,2]+x[1,18,2]=0;

and so on.

 

@tomleslie 

 

well, I try your suggestion for the second sum, in this is what I get:

 

if(15=3,0,x[3,15,9])+if(16,3,0,x[3,16,9])+...

I don't know what it's mean.

@John Fredsted 

 

The first sum works perfectly! Thank you

 

About the second sum, it is single sum not triple sum.

Well, the right-hand side value is either 1 or 0 (see the complete matrix for right-hand side value below).

 

matrix

So, 2*e-1 is for the odd row and k is for the columns.

For instance, for e=1, then 2*e-1=1 which means for k=1 and k=2 will be:

x[1,2,1]+x[1,3,1]+x[1,4,1]+...+x[1,17,1]+x[1,18,1]=1;

x[1,2,2]+x[1,3,2]+x[1,4,2]+...+x[1,17,2]+x[1,18,2]=0;

and so on.

 

@John Fredsted 

D, TB, and T are sets. 

T:={1,2,3,4,...,18}

TB:={1,2,3,4,7,8,15,18}

D:={5,7,11,12,14,15,17}

@Carl Love 

 

I already try it at Corei7 3.7 GHz with 8 GB RAM computer, but after 3 or 4 hours Maple still evaluating it.

Well, I don't know, maybe any other solver that can compute this problem? I already try Lingo from Lindo, but I have problem with the syntax.

 

Thank you for your answer.

@Carl Love 

Well, at first it took about 1-1.5 hours, but it said that the iteration limit was reached. So, I add iterationlimit and set it to 1000000, and now -when I write this reply-, Maple still evaluating it even after it spent 10 hours.

 

Is it worth to try if I use higher computer spesification (like Intel Corei7 processor with 3++ GHz speed)?

@Carl Love 

 

Well, now I change kendala to kendalas which contains all constraints (look at the image, just open in new tab / window to see it clearly), and then I assign Solus as LPSolve command. Now, I run it and Maple keep evaluating it. Is this right syntax?

Constraints (kendalas), LPSolve command (Solus)

@Carl Love 

 

So, I try your suggestion by add this:

kendala := {kendala10a, kendala10b, kendala10c, kendala10d, kendala10e, kendala10f, kendala10g, kendala10h, kendala10i, kendala11a, kendala11b, kendala11c, kendala11d, kendala11e, kendala11f, kendala11g, kendala11h, kendala11i, kendala12a, kendala12b, kendala12c, kendala12d, kendala12e, kendala12f, kendala12g, kendala12h, kendala12i, kendala13a, kendala13b, kendala13c, kendala13d, kendala13e, kendala13f, kendala13g, kendala13h, kendala13i, kendala16a, kendala16b, kendala16c, kendala16d, kendala16e, kendala16f, kendala16g, kendala16h, kendala16i, kendala2a, kendala2b, kendala2c, kendala2d, kendala2e, kendala2f, kendala2g, kendala2h, kendala2i, kendala2j, kendala2k, kendala2l, kendala2m, kendala2n, kendala2o, kendala2p, kendala2q, kendala3, kendala4a, kendala4b, kendala5, kendala6, kendala7, kendala8, kendala9}:

and change the LPSolve command to:

Sol := LPSolve(z, kendala, (indets({kendala, z}, name)=~0 ..1)[], maximize)


But, this is what I get:

Error, (in Optimization:-LPSolve) constraints must be specified as a set or list of equalities and inequalities

 

So, now what should I do? I nearly frustated by this.

@Carl Love 

I don't really get about relaxing the assume=binary.

Is it means that I must omitted the assume=binary and then type every variable and set them to value 0 or 1?

Or first omitted the assume=binary and then use binaryvariables option?

 

Well, I want to practice on a smaller version first, but the deadline is close.

Page 1 of 1