- userLoginStatus
Welcome
Our website is made possible by displaying online advertisements to our visitors.
Please disable your ad blocker to continue.
Energy Engineering - Energy and Climate Change Modeling and Scenarios
Full exam
Exam 06/06/24 PROBLEM You have two types of factories (plant1, plant2) that produce two types of final products (prod1,prod2) at a certain unit cost (plant1 = 7 $/unit, plant2 = 10 $/unit). Plant 1 can only produce prod1, while plant2 can produce only prod1, only prod2 or a mix or both at the same unit cost (i.e. producing one unit of prod1 or one unit of prod2 has the same cost of 10 $/unit). A total demand must be satisfied for each product (prod1 = 100 units, prod2 = 10 units). Write a GAMS problem to satisfy the demand for all products minimizing the total cost of production. NB defining redundant variables and/or equations when proper set definition and assignment can be used will penalize your final score. *SOLUTION Set supply /'plant1', 'plant2'/; Set demand /'prod1','prod2'/; Set can_produce(supply, demand); can_produce('plant1','prod1') = yes ; can_produce('plant2','prod1') = yes ; can_produce('plant2','prod2') = yes ; Parameter request(demand) 'Units/yr'; request('prod1') = 100; request('prod2') = 10; Parameter unitcost(supply) 'dollars/unit'; unitcost('plant1') = 7; unitcost('plant2') = 10; Variable COST, ACTIVITY(supply,demand); ACTIVITY.lo(supply,demand) = 0; Equations eq_demand, eq_cost; eq_demand(demand).. sum (supply$(can_produce(supply,demand)), ACTIVITY(supply,demand)) =G= request(demand); eq_cost.. COST =E= sum (supply, unitcost(supply) * sum (demand, ACTIVITY(supply,demand))); model costmin /all/; solve costmin minimizing COST using lp ; Now, instead, modify the problem to model that, at the same unit cost, plant2 now produces one unit of prod1 and two units of prod2 together *SOLUTION Set supply /'plant1', 'plant2'/; Set demand /'prod1','prod2'/; Paremeter can_produce(supply, demand); can_produce('plant1','prod1') = 1; can_produce('plant2','prod1') = 1; can_produce('plant2','prod2') = 2; Parameter request(demand) 'Units/yr'; request('prod1') = 100; request('prod2') = 10; Parameter unitcost(supply) 'dollars/unit'; unitcost('plant1') = 7; unitcost('plant2') = 10; Variable COST, ACTIVITY(supply,demand); ACTIVITY.lo(supply,demand) = 0; Equations eq_demand, eq_cost; eq_demand(demand).. sum (supply, ACTIVITY(supply,demand)*can_produce(supply,demand) ) =G= request(demand); eq_cost.. COST =E= sum (supply, unitcost(supply) * sum (demand, ACTIVITY(supply,demand))); model costmin /all/; solve costmin minimizing COST using lp ;