Running solver on 4 variable equation

%3CLINGO-SUB%20id%3D%22lingo-sub-1669613%22%20slang%3D%22en-US%22%3ERunning%20solver%20on%204%20variable%20equation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1669613%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%204%20variable%20equation%2024A%2B22B%2B20C%2B14D%3D300%2C123%20so%20i%20set%20my%20equation%20%3D(24*B4)%2B(22*C4)%2B(20*D4)%2B(14*E4)%20as%20my%20set%20objective.%20I%20would%20like%20to%20get%20as%20close%20to%20300%2C123%20as%20i%20can%2C%20my%20objective%20is%20to%20be%20%26gt%3B%3D%20300%2C123.%20I%20have%20set%20my%20A%2C%20B%20and%20C%20variables%20as%20int%20because%20they%20need%20to%20be%20whole%20numbers%2C%20I%20also%20want%20to%20prioritize%20A%20as%20high%20as%20possible%20(maxed)%20with%20B%20as%20second%20maxed%20ect.%20attached%20is%20an%20image%20of%20what%20i%20have%20so%20far.%20Im%20thinking%20that%20my%20function%20can%20not%20be%20set%20to%20%22value%20of%22%20because%20i%20am%20allowed%20to%20go%20slightly%20higher%20and%20that%20A%20should%20be%20set%20to%20max%2C%20but%20A%20is%20not%20a%20formula.%20Thoughts%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22tpitera_0-1600186610657.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F218408i5A8AAA74EE9C4D2A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22tpitera_0-1600186610657.png%22%20alt%3D%22tpitera_0-1600186610657.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1669613%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1674433%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20solver%20on%204%20variable%20equation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1674433%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F794485%22%20target%3D%22_blank%22%3E%40tpitera%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20specify%20a%20target%20value%2C%20since%20you%20said%20you%20can%20slightly%20increase%20over%20300112%2C%20I%20assumed%20you%20mean%2010%25%20more.%20We%20can%20add%20a%20constraint%20the%20the%20OF%20%26lt%3B%201.1*300112%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20assumed%20when%20you%20said%20you%20wanted%20to%20max%20A%20more%20than%20B%20and%20B%20than%20C%2C%20each%20is%2010%25%20more.%20add%20them%20as%20constraints.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20get%20an%20optimal%20value%20this%20way.%20please%20see%20my%20implementation%3C%2FP%3E%3CP%3Ehope%20it%20makes%20sense%20..%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewaiting%20for%20your%20feedbak%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

I have a 4 variable equation 24A+22B+20C+14D=300,123 so i set my equation =(24*B4)+(22*C4)+(20*D4)+(14*E4) as my set objective. I would like to get as close to 300,123 as i can, my objective is to be >= 300,123. I have set my A, B and C variables as int because they need to be whole numbers, I also want to prioritize A as high as possible (maxed) with B as second maxed ect. attached is an image of what i have so far. Im thinking that my function can not be set to "value of" because i am allowed to go slightly higher and that A should be set to max, but A is not a formula. Thoughts?

tpitera_0-1600186610657.png

 

1 Reply
Highlighted

@tpitera 

You need to specify a target value, since you said you can slightly increase over 300112, I assumed you mean 10% more. We can add a constraint the the OF < 1.1*300112

 

I also assumed when you said you wanted to max A more than B and B than C, each is 10% more. add them as constraints. 

 

You will get an optimal value this way. please see my implementation

hope it makes sense ..

 

waiting for your feedbak