Linear programming add weight

241 Views Asked by At

I have been tasked with writing a linear program that will tell the user where to add weight onto a cylindrical drum in order to balance the center of gravity. The weights are 2 lbs and 5 lbs, and a Maximum of 10 lbs can be added into one location. The 2 lb weights are 2" tall and the 5 lb weights are 6" tall. I think the best way to go about this is to use polar coordinates and assume a perfect cyinder for now, as it will be within 1% of perfect. I also think I should start only changing the X and Y axis and keep the Z axis at 0 for now. Any tips to head me in the right direction would be appreciated.

!Drum weight problem;

!sets;
Sets:
Weight: Pounds, Height;
Location: X, Y, Angle;
Set(Weight, Location): PX, PY, PAngle;
Endsets

!data;
Data:
Weight = W1 W2 W3 W4;
Location = L1 L2 L3 L4;

!attribute values;
Pounds = 2 4 5 10;
Height = 2 4 6 12;
X = 0 1 2 3;
Y = 0 1 2 3;
Angle = 0 90 180 270;
Enddata


!objective;
Min = @MIN(Set(I, J): Weight (I, J), Location (K, L, M);

!constraints;
@FOR( Weight(I): [Weight_row]
  Pounds >= 2;
  Height >= 2;
@FOR( Location(J): [Location_row]
  X >=0;
  Y >=0;
  Angle >=0;
End
0

There are 0 best solutions below