demand and supply at price
demand and supply at price
I'm trying to allocate some capacity within some buyers at a certain price. I tried to do it by using the functions DEMAND AT PRICE and SUPPLY AT PRICE, but sincerely I don't get to do it. It is the typical problem of building a supply curve and dispatching by merit order, such as happens in electricity markets.
For example, let's suppose I have 3 suppliers (a,b,c) with certain capacities and prices at which they sell.
Capacities(suppliers): 500, 300, 700
Cost(suppliers): 1,2,3
Also, suppose 2 buyers who need a certain amount (capacity) and are willing to pay a maximum price for it
Demand(buyers): 600, 500
Price(buyers):3,4
Then, the solution should be: allocated capacity: 500, 300, 300 and price: 3
The problem when using the mentioned functions is that i don't know how to use the pprofile functions in order to indicate the priorities of dispatch and where to include the prices.
Do you have and example that works for both supply and demand functions (and for FIND MARKET PRICE), or something that could be useful to solve this problem.
Thank you
For example, let's suppose I have 3 suppliers (a,b,c) with certain capacities and prices at which they sell.
Capacities(suppliers): 500, 300, 700
Cost(suppliers): 1,2,3
Also, suppose 2 buyers who need a certain amount (capacity) and are willing to pay a maximum price for it
Demand(buyers): 600, 500
Price(buyers):3,4
Then, the solution should be: allocated capacity: 500, 300, 300 and price: 3
The problem when using the mentioned functions is that i don't know how to use the pprofile functions in order to indicate the priorities of dispatch and where to include the prices.
Do you have and example that works for both supply and demand functions (and for FIND MARKET PRICE), or something that could be useful to solve this problem.
Thank you
- Attachments
-
- demand at price.mdl
- (2.62 KiB) Downloaded 287 times
-
- Super Administrator
- Posts: 4589
- Joined: Wed Mar 05, 2003 3:10 am
Re: demand and supply at price
Have you looked at the examples in the Vensim help system? There is a whole section on allocation (including sample models)
http://www.vensim.com/documentation/ind ... erview.htm
http://www.vensim.com/documentation/ind ... _price.htm
http://www.vensim.com/documentation/ind ... _price.htm
http://www.vensim.com/documentation/ind ... erview.htm
http://www.vensim.com/documentation/ind ... _price.htm
http://www.vensim.com/documentation/ind ... _price.htm
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: demand and supply at price
For a situation in which supply and demand are relatively constant, up to fixed willingness to pay/sell, you probably want a rectangular distribution (ptype=1) with a narrow pwidth (i.e. pwidth is smaller than the variation in prices across suppliers).
Another possibility would be to use a linear program via an external function. See http://vensim.com/workbench/#lp-solve-link
Another possibility would be to use a linear program via an external function. See http://vensim.com/workbench/#lp-solve-link
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Finally I got it to work, thank you.
It seems that when formulating the vector of priority, we should use the prices in a positive way. It is different to ALLOCATE BY PRIORITY, where you should use the prices with negative sign in order to give a higher priority to those producer with cheaper marginal costs.
I attach one simple example of FIND MARKET PRICE, ALLOCATE AT PRICE, DEMAND AT PRICE for whom is interested.
It seems that when formulating the vector of priority, we should use the prices in a positive way. It is different to ALLOCATE BY PRIORITY, where you should use the prices with negative sign in order to give a higher priority to those producer with cheaper marginal costs.
I attach one simple example of FIND MARKET PRICE, ALLOCATE AT PRICE, DEMAND AT PRICE for whom is interested.
- Attachments
-
- demand at price.mdl
- (3.26 KiB) Downloaded 299 times
Re: demand and supply at price
Hi,
I would like to ask a question which is related to this post.
I want to do dispatch of power plants with Vensim itself. Assume that I have 3 power plants with specific price(a1,a2,a3) and capacity(b1,b2,b3). They take part in one auction for satisfying the demand(D). Power plants will be sorted based on their price. With this dispatch I want to find winner of each auction. Can I ask you that is it possible to model such this auction with vensim when priority is cheapest price?
Best Regards,
I would like to ask a question which is related to this post.
I want to do dispatch of power plants with Vensim itself. Assume that I have 3 power plants with specific price(a1,a2,a3) and capacity(b1,b2,b3). They take part in one auction for satisfying the demand(D). Power plants will be sorted based on their price. With this dispatch I want to find winner of each auction. Can I ask you that is it possible to model such this auction with vensim when priority is cheapest price?
Best Regards,
Re: demand and supply at price
Yes, that kind of thing can be done. You can also use FIND ZERO for a more general solution to simultaneous problems. There's a sample model for each included in the Help system.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Thank you. I modelled it with ALLOCATE AVAILABLE function. But still I want to know how to define priority dynamicly that power plants with cheaper price can have higher priority. Can I use VECTOR RANK function for it?
Re: demand and supply at price
My model is an hourly based model which simulates electricity market for 35 years. I want to model the auction of technology X only three times per year and winners of auction X can be able to sell their energy for 10 years. Looser of auction X will sell their energy without any premuim, but they have chance for winning in these auction and getting 10 years previlege in next round of these especial auctions.
Firstly ,can you help me how can I model this auction three times per year in an hourly model(for example, I want to model them in first day of Jan, May and Dec).
Secondly, how can I distinguish winner and looser of each auction round? As I want to consider some premuim for winner for 10 years I want to seperate looser and winner of each round.
Firstly ,can you help me how can I model this auction three times per year in an hourly model(for example, I want to model them in first day of Jan, May and Dec).
Secondly, how can I distinguish winner and looser of each auction round? As I want to consider some premuim for winner for 10 years I want to seperate looser and winner of each round.
-
- Super Administrator
- Posts: 4589
- Joined: Wed Mar 05, 2003 3:10 am
Re: demand and supply at price
You'll need to create a variable that is zero or one at those three times of the year. Then use SAMPLE IF TRUE to hold the winning value until the next round.
VECTOR RANK can be used to work out which is the winner at each auction round.
VECTOR RANK can be used to work out which is the winner at each auction round.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: demand and supply at price
The thing is that I want the winners will be able to sell for 20 years(not only for the next round). Isn't it better to use PULSE TRAIN? I have used a pulse train function that is always 0 except three times per year.Administrator wrote: ↑Mon May 06, 2019 8:15 am You'll need to create a variable that is zero or one at those three times of the year. Then use SAMPLE IF TRUE to hold the winning value until the next round.
VECTOR RANK can be used to work out which is the winner at each auction round.
Re: demand and supply at price
It sounds like we need something like an "ALLOC IF" function that's switchable, so it only executes when a flag is true.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
I just multiplied pluse train with allocation function. Do you have any suggestion for filtering the winner and looser of each auction. I want that looser can be able to take part in further auctions and winners sell their energy for 10 yaers.
Re: demand and supply at price
You could use a stock or SAMPLE IF TRUE to identify the winner and set their quantity to 0, or priority very low, for future auctions.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Thanks. I still get this error for a part of model which is related to ALLOCATE AVAILABLE function:
"Error in ALLOCATE_AVAILABLE/FIND_MARKET_PRICE - subscript range error in request quantity"
Do you have any idea why I encounter this?
Re: demand and supply at price
I'd have to see the relevant equations.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
I think you could map the subrange to a distinct (full) subscript range of the same size, sort that, and then map back.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Hi,
How can I use FIND MARKET PRICE(dq,dp,sq,sp) when I have only multi suppliers and no priority for demanders?
I get this error: Argument 2 of FIND MARKET PRICE must be a normal variable
How can I use FIND MARKET PRICE(dq,dp,sq,sp) when I have only multi suppliers and no priority for demanders?
I get this error: Argument 2 of FIND MARKET PRICE must be a normal variable
Re: demand and supply at price
"No priority" = "priority vector with all values the same" would be one option. You can't change the type of an argument from a vector to a single value.
Another, simpler option would be to use one of the one-sided ALLOC functions. In other words, add up the demands to a single value, ALLOC that across the suppliers, then give each demander a share of whatever is received, in proportion to their request.
Another, simpler option would be to use one of the one-sided ALLOC functions. In other words, add up the demands to a single value, ALLOC that across the suppliers, then give each demander a share of whatever is received, in proportion to their request.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Thanks . I found first solution quite applicable. I already used "ALLOCATE AVAILABLE" for it but how can I access price of that allocation when I am using ALLOCATE AVAILABLE?tomfid wrote: ↑Wed Jul 03, 2019 3:19 pm "No priority" = "priority vector with all values the same" would be one option. You can't change the type of an argument from a vector to a single value.
Another, simpler option would be to use one of the one-sided ALLOC functions. In other words, add up the demands to a single value, ALLOC that across the suppliers, then give each demander a share of whatever is received, in proportion to their request.
My problem is as follows: I have n wind suppliers that they bid for providing energy to the grid. So, n suppliers and 1 demand. I want to find market clearance price and accepted amount of energy that they can bid. Priority vector is based on cheaper price.
Re: demand and supply at price
For some distributions, you could compute the price, but using the 2-sided allocation with a one-dimensional demand is probably easier.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
If you're OK with the rectangular distribution, you could use ALLOC P and MARKETP.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Hi,
Following the above question, I would like to ask.
If I have only one demander and the goal is to achieve the balance between supply and demand, how to use the find market price function.
For example, the suppliers (a,b,c) with certain capacityies and prices at which they sell.
capacities (suppliers):500,300,700
Cost (suppliers): 1,2,3
Demand changes over time. In order to achieve market clearing, the market price is equal to the cost of the most expensive capacityies. Such as, T=1, demand is 500, the price only needs 1, and when T=2, demand becomes 700, then the price should change to 2, until the demand is greater than 800, the price will be 3. It is only the situation that the supply can meet demand, if demand exceeds supply is another story.
I looked up the example of Find market price in Vesnim help. My understanding is that the example realizes how the quantity of demand changes when the price curve of supply and demand is certain, and when the price of demand is lower than the price of supply, the supplier will still not sell.
I alos tried the one-to-many Allocation available function, export the lowerest priority price for each allocation. But I didn;t succeed.
So, I was wondering how to do it?
Thank you very mcuh!
Following the above question, I would like to ask.
If I have only one demander and the goal is to achieve the balance between supply and demand, how to use the find market price function.
For example, the suppliers (a,b,c) with certain capacityies and prices at which they sell.
capacities (suppliers):500,300,700
Cost (suppliers): 1,2,3
Demand changes over time. In order to achieve market clearing, the market price is equal to the cost of the most expensive capacityies. Such as, T=1, demand is 500, the price only needs 1, and when T=2, demand becomes 700, then the price should change to 2, until the demand is greater than 800, the price will be 3. It is only the situation that the supply can meet demand, if demand exceeds supply is another story.
I looked up the example of Find market price in Vesnim help. My understanding is that the example realizes how the quantity of demand changes when the price curve of supply and demand is certain, and when the price of demand is lower than the price of supply, the supplier will still not sell.
I alos tried the one-to-many Allocation available function, export the lowerest priority price for each allocation. But I didn;t succeed.
So, I was wondering how to do it?
Thank you very mcuh!
Re: demand and supply at price
It should work as you've described, if the dimensionality of demand is reduced to 1. The demand priority should be greater than the max supply priority, to ensure that demand is always fulfilled. If you want stepwise allocations, the width parameter needs to be narrow.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: demand and supply at price
Yes, it is solved. Thank you for your help.tomfid wrote: ↑Mon Jan 20, 2020 5:19 pm It should work as you've described, if the dimensionality of demand is reduced to 1. The demand priority should be greater than the max supply priority, to ensure that demand is always fulfilled. If you want stepwise allocations, the width parameter needs to be narrow.