# Running solver on 4 variable equation

Occasional Visitor

# Running solver on 4 variable equation

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?

# Re: Running solver on 4 variable equation

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 ..