linear-programmingglpkmathprog

colon missing where expected - gusek


I'm new to this program called gusek, and i'm trying to run next formula:

Maximize objekt: 3x + 2y
Subject To objekt1: 2x + y <= 100 objekt2: x + y <= 80
Bounds x >= 0 x <= 40 y >= 0
End

It gives me "or_vaja.mod:1: colon missing where expected" error.

Any help?


Solution

  • The basic error is due to writing "Maximize" uppercase instead of "maximize" lowercase.

    And there are several other Errors in your sourcecode, like a missing * for the multiplication in you objective function, "Subject" in uppercase (you can also write the short version "s.t." for subject to), "End" in uppercase, missing the command delimiter ";" at the end of functions, and a properly definition of variables and their bound.

    Have a look in the Help of Gusek and look at some examples. Your lines should look more like this:

    var x >= 0 <= 40;
    var y >= 0;
    maximize obj: 3*x + 2*y;
    s.t. obj1: 2*x + y <= 100; 
    s.t. obj2: x + y <= 80;
    solve;
    end;