Question: Im trying to integrate mathematical modelformulation into lingo but im getting syntax errors what are my mistakes and how can i correct them. Please provide
Im trying to integrate mathematical modelformulation into lingo but im getting syntax errors what are my mistakes and how can i correct them. Please provide me the correct runnable code.
Formulation of model:Qt Number of cars to be produced in period t t
It Inventory level of cars at the end of period t t
zt if production is initiated in period t and otherwise. Binary
Dt Assumed demand forecasts for the next months are, and respectively.
ht $ per car per month. The cost of storing an unsold car in month t t
At $ per setup at month tt
ct $ per car
Min ZzQIzQIzQIzQI
Subject to:
IQ
I IQ
I IQ
I IQ
I is assumed to to be zero
Qzt
Qzt
Qzt
Qzt
It Qt t
zt in for each period t
Lingo Code:
SETS:
TIME ;
Define parameters for each period directly;
DATA:
Demand :;
Demand :;
Demand :;
Demand :;
Define constants;
SetupCost :;
UnitProdCost :;
HoldingCost :;
VARIABLES:
QTIME; Number of cars to be produced in each period;
ITIME; Inventory level at the end of each period;
zTIME binary; if production is initiated, otherwise;
Objective function to minimize total costs;
MIN @SUMTIME: SetupCost zTIME UnitProdCost QTIME HoldingCost ITIME;
Inventory balance constraints;
@FORTIME:
IFTIME THEN
I Q Demand;
ELSE
ITIME ITIME QTIME DemandTIME;
ENDIF;
;
Ordering link constraint ensuring that orders only occur if indicated by zTIME;
@FORTIME:
QTIME zTIME;
;
Set initial inventory to zero;
I :;
MODEL:
END;
Lingo Model Lingo
SETS:
TIME ;
Define parameters for each period directly;
DATA :
Demand :;
Demand :;
Demand :;
Demand :;
Define constants;
SetupCost : :;
UnitProdCost : ;
HoldingCost :;
VARIABLES:
QTIME; Number of cars to be produced in each period;
I TIME; Inventory level at the end of each period;
z TIME binary; l if production is initiated, otherwise;
Objective function to minimize total costs;
MIN @SUMTIME: SetupCost TIME UnitProdCost HoldingCost ITIME;
Inventory balance constraints;
IF TIME THEN
Demand ;
ELSE
Demand TIME;
ENDIF;
;
Ordering link constraint ensuring that orders only occur if indicated by zTIME;
@FOR TIME:
TIME;
; Lingo Model Lingo
Lingo Model Lingo
MODEL :
END;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
