Allocation by Priority and Demand Values

Use this forum to post Vensim related questions.
Post Reply
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Allocation by Priority and Demand Values

Post by JudeChen »

Hi, I am trying to model an energy investment process here where a proportion of GDP is allocated to investments in energy generating capacities. I was trying to use the Allocation by Priority function to portion the amount of GDP which requires a demand value. Using the basis of Stock Management Structure (Figure 17-6, pg. 676, Sterman 2000), I assumed that using the Desired Stock or perhaps the Indicated Orders would form the demand required for the Allocation by Priority equation but that runs into the simultaneous equation problem.

Could I get some guidance from mentors here who have had similar experiences on what should be the right way to think about this?

I am using the academic license of Vensim DSS.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Oh nvm. Figured it out the issue. Thanks for creating the allocation by priority feature. Useful!
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

OK, nice work!
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Hello!

I was trying to use the FIND MARKET PRICE feature to model the market clearing price for the electricity market.

I got the following errors:
ALLOCATE_AVAILABLE/FIND_MARKET_PRICE = bad ptype error.
Floating point error computing - Market Clearing Priority - at time = 2010.0000

So the formula I used is:
FIND MARKET PRICE( "Input Demand [Total Demand] , Demand Curve[Total Demand,ptype] , Supply Available[Natural Gas Fired] , Supply Curve[Natural Gas Fired,ptype] )

For the supply available side, there are multiple suppliers but some of the technologies are not deployed yet, so they have 0 supply available at the start.

For the supply curve, I am using ptype 1, pwidth 0.001 for simplification. ppriority is based on the LCOE calculated for the different technology type.
For the demand curve, I am assuming inelastic demand so I used the simplification: 1,1,1,0.

I did try to follow the example i found in another forum thread that the admins posted but the error threw me off, so I am not sure what is going on here.

I was wondering if I could get some help on the error here? Thank you!
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

You might compare your version to the sample model in the Help system.

I think we can't diagnose this without more information - a model, or at least the relevant subscripts and related equations.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Thank you!

i did manage to get it to work, there was upstream information that required an initial value for it to work. I was wondering who can I can email my model to if I have further queries? The issue i am facing is that the SUPPLY AT PRICE function seems to not work quite right and I am not sure what exactly is the problem here.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Allocation by Priority and Demand Values

Post by Administrator »

Please upload your model to the forum if you have further queries.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

Or email us.

What are the symptoms of not working quite right? This has been tested and used extensively, so a bug is possible but unlikely.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Hi,

Thanks for the information. I have attached my model for discussion here. The Find Market Price portion can be found in the Pricing view.

Thank you!!
Attachments
Electricity Market.mdl
(169.74 KiB) Downloaded 277 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

What is the problem symptom?
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

I am not sure if I am doing it right but the amount supplied variable that I am getting is not showing what I would be expecting, where its total is supposed to be input demand. Since the input demand should match amount supplied in the scenario, where there is clearly a case where there is an excess of supply to demand.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

We'll need the data file to run it.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Oh yes, sorry about that. Forgot to upload the data file as well.
Attachments
Natural Gas Price Database.xlsx
(10.08 KiB) Downloaded 246 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

I see what you mean - investigating.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

Ah ... I should have seen this before. You're using the "Estimated Energy Price" in the Amount Supplied and Amount Demanded. But for the SUPPLY and DEMAND functions to work, they need the market clearing priority as input.

Fixing that reconciles the input/output discrepancy, but there's still something wrong. It could simply be that the demand priority is extremely low compared to the supply priorities.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

Yes - I think the problem is priorities that don't overlap. Demand has priority 0.1 with width .001, and all the supplies are at ~125 with width 1e-6. That yields a nonoverlapping set - there is no price at which demanders and suppliers want nonzero throughput.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

I see. Thanks for the pointer!

So in order to generate a proper Supply at Price, the following things are important:

1) Supply at Price requires Market Clearing Priority as input.
2) ppriority of demand and supply curves should be in the same order of magnitude.
3) pwidth of demand and supply curves should be the same.
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Tom, thanks for the guidance. It was really useful.

I just tested it. Seems like for a dynamic input to supply curves priority would require a dynamic input to the demand curve priority. It did not occur to me that such a setup is required as I only had a single demander.

I tried using a dynamic value (like a base value similar to the supply curves' priority) which then grow at a rate such as the yearly demand growth rate. That did not seem too well in generating the supply at price output though. If I do set a high static value, I would get the error about the curves failing to converge. Is there a way to think about how to go about setting the right priority and width values for the demand curve in this case?

Another small question which might not be related to Vensim functionality directly. In your experience, would the effected LCOE or total variable cost be the right factor to use here for determining the supply curve priority values?

I have attached the updated model and database for your quick reference. Thanks!
Attachments
Henry Hub NG Price Data.xlsx
(10.08 KiB) Downloaded 244 times
Electricity Market v2.mdl
(173.46 KiB) Downloaded 251 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

The allocation function section of the help explains the algorithm for market clearing.
https://www.vensim.com/documentation/fn_allocations.htm
Specifically:
https://www.vensim.com/documentation/24325.htm

On your points:
1) true
2) not strictly required, but should be true if you expect to see supply and demand fully utilized
3) not required

You can think of the priority as the price at which suppliers are willing to sell, or demanders are willing to purchase (except that it has to be dimensionless, rather than $/item). The with parameter essentially describes the variance among suppliers or demanders. So, with priority=100 and width = 10, supply ramps up between 95 and 105, for example. If you use Normal rather than Rectangular, this is a smoother process.

The problem with your original formulation was that suppliers were bidding $100/mwh, but demanders were willing to pay $0.1. So, given the narrow widths, there was no overlapping region with nonzero quantity.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Allocation by Priority and Demand Values

Post by tomfid »

Normally the LCOE or similar will determine investment in various sources.

In the short run, the decision to generate or not should be based only on variable costs (fuel, variable O&M).
JudeChen
Member
Posts: 20
Joined: Thu Jul 04, 2019 7:42 am
Vensim version: DSS

Re: Allocation by Priority and Demand Values

Post by JudeChen »

Tom,

Thank you very much for the clarifications!
Post Reply