Page 1 of 1

Allocation by Priority and Demand Values

Posted: Tue Oct 29, 2019 4:19 am
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.

Re: Allocation by Priority and Demand Values

Posted: Tue Oct 29, 2019 8:38 pm
by JudeChen
Oh nvm. Figured it out the issue. Thanks for creating the allocation by priority feature. Useful!

Re: Allocation by Priority and Demand Values

Posted: Tue Oct 29, 2019 9:31 pm
by tomfid
OK, nice work!

Re: Allocation by Priority and Demand Values

Posted: Sat Nov 02, 2019 8:06 pm
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!

Re: Allocation by Priority and Demand Values

Posted: Sun Nov 03, 2019 4:32 pm
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.

Re: Allocation by Priority and Demand Values

Posted: Mon Nov 04, 2019 2:13 am
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.

Re: Allocation by Priority and Demand Values

Posted: Mon Nov 04, 2019 10:51 am
by Administrator
Please upload your model to the forum if you have further queries.

Re: Allocation by Priority and Demand Values

Posted: Mon Nov 04, 2019 3:13 pm
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.

Re: Allocation by Priority and Demand Values

Posted: Mon Nov 04, 2019 7:48 pm
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!!

Re: Allocation by Priority and Demand Values

Posted: Mon Nov 04, 2019 9:53 pm
by tomfid
What is the problem symptom?

Re: Allocation by Priority and Demand Values

Posted: Tue Nov 05, 2019 1:22 am
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.

Re: Allocation by Priority and Demand Values

Posted: Tue Nov 05, 2019 3:18 pm
by tomfid
We'll need the data file to run it.

Re: Allocation by Priority and Demand Values

Posted: Tue Nov 05, 2019 6:33 pm
by JudeChen
Oh yes, sorry about that. Forgot to upload the data file as well.

Re: Allocation by Priority and Demand Values

Posted: Wed Nov 06, 2019 1:28 am
by tomfid
I see what you mean - investigating.

Re: Allocation by Priority and Demand Values

Posted: Wed Nov 06, 2019 1:37 am
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.

Re: Allocation by Priority and Demand Values

Posted: Wed Nov 06, 2019 1:41 am
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.

Re: Allocation by Priority and Demand Values

Posted: Thu Nov 07, 2019 1:28 am
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.

Re: Allocation by Priority and Demand Values

Posted: Thu Nov 07, 2019 2:35 am
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!

Re: Allocation by Priority and Demand Values

Posted: Thu Nov 07, 2019 3:17 pm
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.

Re: Allocation by Priority and Demand Values

Posted: Thu Nov 07, 2019 3:19 pm
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).

Re: Allocation by Priority and Demand Values

Posted: Thu Nov 07, 2019 3:27 pm
by JudeChen
Tom,

Thank you very much for the clarifications!