I want to calculate “Plant Fuel Cost” from two arrays: “Plant Fuel Type” and “Area Fuel Prices”. The first array (Plant Fuel Type) lists the fuel codes for all power plants, while the second array (Area Fuel Prices) list the actual fuel prices in an area for the next 10 time periods.
I wonder is there a function that will match the fuel type with the price in every cycle and return the price in place of the code?
Thank you very much for your help.
Jozef
Is there a function to match a code with a value and return
Is there a function to match a code with a value and return
- Attachments
-
- MatchCode2Value.mdl
- (1.97 KiB) Downloaded 470 times
The attached file is the input table for the model.
- Attachments
-
- Input3.xls
- (15 KiB) Downloaded 495 times
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
From the spreadsheet you have data on
Fuel Cost[Area,FuelType]
so all you need to do is associate an Area and FuelType with each plant. Probably it is easiest to do this as two vectors
Plant Area[plant]=2,4,1,5
Plant Fuel Type[plant] = 4,2,1,2
where the number correspond the subscript elements in Area and FuelType.
Then use
plant cost[plant] = VECTOR ELM MAP(Fuel Cost[Area1,FuleType1],(Plant Area[plant]-1) * ELMCOUNT(FuelType) + Plant Fuel Type[plant]-1)
Note the use of multiplication by ELMCOUNT to map the 2 dimensional offset off Fuel Cost.
Fuel Cost[Area,FuelType]
so all you need to do is associate an Area and FuelType with each plant. Probably it is easiest to do this as two vectors
Plant Area[plant]=2,4,1,5
Plant Fuel Type[plant] = 4,2,1,2
where the number correspond the subscript elements in Area and FuelType.
Then use
plant cost[plant] = VECTOR ELM MAP(Fuel Cost[Area1,FuleType1],(Plant Area[plant]-1) * ELMCOUNT(FuelType) + Plant Fuel Type[plant]-1)
Note the use of multiplication by ELMCOUNT to map the 2 dimensional offset off Fuel Cost.
Bob, thank you very much for your help. The VECTOR ELM MAP is rather a tricky function, but I feel I am finally getting closer to understand it. Attached is a model that illustrates the solution. Again thank you very much for your help.
Jozef
Jozef
- Attachments
-
- MatchCode2Value_3.mdl
- (2.5 KiB) Downloaded 544 times