Error with Allocate Available - subscript range error

Use this forum to post Vensim related questions.
Post Reply
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Error with Allocate Available - subscript range error

Post by warrick »

Hello,

Please refer to the link for background to my model:
http://www.ventanasystems.co.uk/forum/v ... 957#p22610

I have the same error as a post of over a decade ago:
http://www.ventanasystems.co.uk/forum/v ... 633#p22633

Unfortunately, the solution is not provided. Hence this post. The actual error is:
"ERROR: Error in ALLOCATE_AVAILABLE/FIND_MARKET_PRICE - subscript range error in request quantity.
ERROR: Floating point error computing - Electricity Dispatched by Least Cost Vector[coal new] - at time = 2015.000000.
Trying to save the results anyway"

I checked subscripts and divide by zeros. The error comes up with ALLOCATE AVAILABLE used to calculate electricity least cost dispatching (as shown above). This ONLY occurs when I link the ALLOCATE AVAILABLE used to calculate required generation expansion upstream of least cost dispatching ALLOCATE AVAILABLE. If the output is not linked back then no problems. It is strange and seems to be a glitch of some sort. Please assist.

Let me know if I should send the model.

Regards
Warrick
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Error with Allocate Available - subscript range error

Post by tomfid »

We'll need the model to see what's going on.

My suspicion is that the two ALLOCs you mention are overlapping somehow (i.e. share common variables that aren't stocks or constants). That causes problems, because you're then trying to solve one big simultaneous equation problem via two independent iterations.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Error with Allocate Available - subscript range error

Post by warrick »

Thank you for the reply tomfid.

I have attached the model with input data (excel spreadsheet).

The two ALLOCATIONS are for 1. Generation Capacity (new generation plants required to satisfy demand "New Allocated Capacity") and 2. Least Cost Dispatch (how to dispatch the generation plants in the system "Electricity Dispatched by Least Cost Vector"). Thus, item 1 feeds into item 2. When this feedback is made by including "New Allocated Capacity" into "New Generation Capacity" the error occurs. A similar approach was used in the EPS model (https://www.energypolicy.solutions/).

I think your suspicion regarding simultaneous equations may be valid but I am not sure how to fix it.

I look forward to your reply and getting this model working :)
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Error with Allocate Available - subscript range error

Post by tomfid »

Got it. I don't get the same error though. What version are you running?

Code: Select all

ERROR:       Simultaneous equations involving:  Contracted Dispatch Quantity by Priority[coal,new,priority1].    
                                             :  Electricity Dispatched by Contract Priority[coal,new,priority1].    
                                             :  Output Generation by Type[coal,new].    
                                             :  Actual Capacity Factor[coal,new].    
                                             :  "Annulized Fixed Costs per MWh - Actual CF"[coal].    
                                             :  "LCOE - Actual CF"[coal].    
                                             :  New Output Priority Profile[coal,ppriority].    
                                             :  New Output Allocated[coal].    
                                             :  New Allocated Capacity[coal].    
                                             :  New Generation Capacity[coal,new].    
                                             :  Generation Capacity[coal,new].    
                                             :  Potential Electricity Output by Type[coal,new].    
                                             :  Contracted Dispatch Quantity by Priority[coal,new,priority1].    
ERROR:       Simultaneous equations involving:  Electricity Dispatched by Least Cost Vector[coal new].    
                                             :  Electricity Dispatched by Least Cost[coal,new].    
                                             :  Output Generation by Type[coal,new].    
                                             :  Actual Capacity Factor[coal,new].    
                                             :  "Annulized Fixed Costs per MWh - Actual CF"[coal].    
                                             :  "LCOE - Actual CF"[coal].    
                                             :  New Output Priority Profile[coal,ppriority].    
                                             :  New Output Allocated[coal].    
                                             :  New Allocated Capacity[coal].    
                                             :  New Generation Capacity[coal,new].    
                                             :  Generation Capacity[coal,new].    
                                             :  Potential Electricity Output by Type[coal,new].    
                                             :  Potential Electricty Output by Type after Contract Based Dispatch[coal,new].    
                                             :  Temp Vector Potential Electricity[coal new].    
                                             :  Electricity Dispatched by Least Cost Vector[coal preexisting].    
                                             :  Electricity Dispatched by Least Cost[coal,preexisting].    
                                             :  Output Generation by Type[coal,preexisting].    
                                             :  Actual Capacity Factor[coal,preexisting].    
ERROR:       Simultaneous equations involving:  "Annulized Fixed Costs per MWh - Actual CF"[coal].    
                                             :  "LCOE - Actual CF"[coal].    
                                             :  New Output Priority Profile[coal,ppriority].    
                                             :  New Output Allocated[coal].    
                                             :  New Allocated Capacity[coal].    
                                             :  New Generation Capacity[coal,new].    
                                             :  Generation Capacity[coal,new].    
                                             :  Potential Electricity Output by Type[coal,new].    
                                             :  Potential Electricty Output by Type after Contract Based Dispatch[coal,new].    
                                             :  Temp Vector Potential Electricity[coal new].    
                                             :  Electricity Dispatched by Least Cost Vector[coal preexisting].    
                                             :  Electricity Dispatched by Least Cost[coal,new].    
                                             :  Output Generation by Type[coal,new].    
                                             :  Actual Capacity Factor[coal,new].    
                                             :  "Annulized Fixed Costs per MWh - Actual CF"[coal].    
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Error with Allocate Available - subscript range error

Post by tomfid »

Here's a version with the first simultaneous loop highlighted in red.
GEP tf.mdl
(54.77 KiB) Downloaded 270 times
The diagram is very readable, but the way this feedback loop jumps around suggests to me that shadow variables have been overused.

The conceptual issue here is that you're treating the flow of capacity installation like a stock, with *one year as a units converter to conceal the mismatch between MW and MW/year. This means that the need for capacity is perceived and capacity is installed and allocated all in the same instant. I think if you treat capacity conventionally, as a stock, the problem will be solved.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Error with Allocate Available - subscript range error

Post by warrick »

Thank you so much tomfid. :D The model is working!

I am using Vensim DSS for Windows Version 6.3 (x32). The simultaneous equation error is a lot more useful than "ALLOCATE_AVAILABLE/FIND_MARKET_PRICE" error. It is strange that the former did not show with my version as I did have such an error with a previous more direct simultaneous equation.

The issue was the feedback coming via the capacity factor "Actual Capacity Factor" which was used to calculate "Annualized Fixed Costs per MW" and eventually feed into the priority profile for capacity allocation. I rather used the target capacity factors and problem solved. I wanted to use the actual capacity factors as when there is ample generation capacity from a demand perspective the lower marginal costs units would be dispatched first and reach their target capacity factors but the higher marginal costs units would not achieve theirs. However, actual capacity factor would not really solve the problem either as only one year is considered. The better approach would be to consider the entire time period (all actual capacity factors). This I am investigating with the optimiser as discussed in previous post (http://www.ventanasystems.co.uk/forum/v ... f=2&t=6349). Still busy on that one.

Thanks again.
Post Reply