Optimization - Production planning

46 Views Asked by At

I have been given the following problem to solve in ampl, but firstly I need to write a mathematical model, but am kind of struggling with that A bit, below is the question nad my attemp.

SunTech Electronics produces DVD recorders in their city plant. The estimated demand for the product for next four periods is 3,000, 8,000, 5,000, and 2,000. At the beginning of period 1, SunTech has 50 workers.

SunTech spends 1,500USD to hire a worker and 5,000USD to fire a worker.

Workers are paid 12,000USD per period. A newly hired worker can make 50 recorders per period, whereas a previously hired worker can make 80 recorders per period.Each DVD recorder is sold for 295USD.

It costs $15 to hold a DVD recorder in inventory for a period. Assume that workers are hired and fired at the beginning of each period and the products produced in any period are available to meet demand of that period.

Inventory at the beginning of period 1 is 500.

Assume that demand is lost if it cannot be met from either current stock or production of current period. Develop a mathematical model for determining the worker level in each period in order to maximize SunTech’s profit.

my attempt:

I. VARIABLES

$H_{j}$ -Number of workers we hire in period j

$W_{j}$ -Number of workers in period j

$L_{j}$ -Number of workers we fire in period j

$O_{j}$ -Number of old workers in period j

$X_{j}$ -Number of recorders produced by new workers in period j

$Y_{j}$ -Number of recorders produced by old workers in period j

$T_{j}$ -Number of recorders traded/sold in period j

$S_{j}$ -Number of recorders store in period j $Demand_{j}$ Demand of recorders in period j

II. CONSTRAINTS

since we cannot have half a worker or half a recorder; we need that H,W,L,O,X,Y,T,S => 0 and integers.

$O_{1}$ =50 we have 50 workers at the beginning

$L_{1}$ <=50 since we cannt fire more workers than we have.

$L_{j}$ <= $W_{j-1} \forall_{j>1}$ for the same reason as previous

$O_{j} = W_{j-1} - l_{j} \forall_{j>1}$ this is how we obtain old workers

$W_{1} = O_{1} + H_{1} - L_{1}$

$W_{j} = O_{j} + H_{j} \forall_{j > 1}$

For balance of workers:

O_{1}+ H_{1}-L_{1}- L_{2} =O_{2}$

O_{j-1} + H_{j}- L_{j} = O_{j} \forall_{j>2}$

For Balance of products:

$ 500 + X_{1} + Y_{1} = T_{1} + S_{1}$

$S_{j-1} + X_{j} + Y_{j} = T_{j} + S_{j}$

$X_{j} = 50*H_{j}$

$Y_{j} = 80*O_{j}$

$ T_{j} <= Demand_{j} $

III. OBJECTIVE FUNCTION

max $\sum_{j}(295*T_{j} -1500*H_{j}-5000*L_{j}-15*S_{j}-12000*W_{j})$

But when am putting this into ampl, it shows that my problem is unbounded, It gives zeros everywhere, please help.

Here is my ampl code :

set PERIODS;

param demands{PERIODS};

var w{PERIODS} integer >=0;
var h{PERIODS} integer >=0;
var l{PERIODS} integer>=0;
var s{PERIODS} integer>=0;
var sell{PERIODS} integer>=0;
var o{PERIODS} integer>=0;
var x{PERIODS} integer>=0;
var y{PERIODS} integer>=0;

maximize profit: sum{j in PERIODS} 
(295*sell[j]-5000*l[j]-1500*h[j]-15*s[j]-12000*w[j]);

subject to oldWorkers_season1: o[1] =50;
subject to firing_season1: l[1]<=50;
subject to firing{j in PERIODS : j>1}:l[j] <= w[j-1];
subject to oldworkers{j in PERIODS : j> 1}:o[j] = w[j-1]-l[j];
subject to workerLevel_season1: w[1]= o[1] + h[1]-l[1];
subject to workerLevel{ j in PERIODS : j>1}: w[j]= w[j-1]-l[j] + h[j];
subject to balance1: o[1]+h[1]-l[1]-l[2]= o[2];
subject to balance2{j in PERIODS : j > 2}: o[j-1] + h[j]- l[j] = o[j]
subject to selling1: 500+x[1]+y[1]= sell[1]+ s[1];
subject to selling{j in PERIODS :j >1}:s[j-1] +x[j]+y[j] = 
sell[j]+s[j];
subject to soldGoods{j in PERIODS}:sell[j]<=demands[j];
subject to new_workers{j in PERIODS}: x[j]= 50*h[j];
subject to old_worker{j in PERIODS}: y[j] = 80*o[j];

Please assist.