Hi,
I have solved the question that I asked above and there is only one demander.
but when I discretize the demand into multiple segments to represent different needs at different times of every year, and each segment should be equalibrium.
the model reports an error, but I don't know how to solve it.
I uploadded a simple example, I was wodering what's wrong with it?
Thank you very mcuh!
Best wishes
demand and supply at price
Re: demand and supply at price
- Attachments
-
- EXAMPLE.mdl
- (4.87 KiB) Downloaded 155 times
Re: demand and supply at price
If you step through the elements of "priority vector" you will find that the first element has [duration,supplier,ptype] and the next has [duration,supplier,pprofile]. That doesn't work because pprofile is the range. If you replace it with the element ppriority it should work.
/*
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, thanks.tomfid wrote: ↑Tue Jan 21, 2020 5:41 am If you step through the elements of "priority vector" you will find that the first element has [duration,supplier,ptype] and the next has [duration,supplier,pprofile]. That doesn't work because pprofile is the range. If you replace it with the element ppriority it should work.
that is my mistake.
Now the model can running, but it did not achieve the results I thought, the each segment can reach the supply-demand equlibrium at a certain market price. Is there a problem with my subscript usage or a problem with subscript setting? So, I have so many questions.
- Attachments
-
- EXAMPLE.mdl
- (4.94 KiB) Downloaded 159 times
Re: demand and supply at price
You've mixed up the subscripting by deleting the "demander" dimension. Therefore FIND MARKET PRICE is iterating over suppliers on one side of the market, and durations on the other side.
The solution is to preserve the demander range, with length 1:
Then use that in the demand variables:
You can compute the net demand-supply as a check (should be 0 for each duration):
The solution is to preserve the demander range, with length 1:
Code: Select all
demander : total
Code: Select all
FIND MARKET PRICE(demand[duration,total], demand priority vector[duration,total,ptype]
,supply capacity[Coal], priority vector[duration,Coal,ptype])
DEMAND AT PRICE( demand[duration,demander], demand priority vector[duration,demander,ptype] ,market price[duration])
demand priority vector[duration,demander,ptype]=
demand priority type ~~|
demand priority vector[duration,demander,ppriority]=
demand priority[duration] ~~|
demand priority vector[duration,demander,pwidth]=
demand priority width ~~|
demand priority vector[duration,demander,pextra]=
extra
Code: Select all
SUM(amount demanded[duration,demander!])-SUM(amount supplied[duration,supplier!])
/*
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 very much.tomfid wrote: ↑Tue Jan 21, 2020 3:52 pm You've mixed up the subscripting by deleting the "demander" dimension. Therefore FIND MARKET PRICE is iterating over suppliers on one side of the market, and durations on the other side.
The solution is to preserve the demander range, with length 1:
Then use that in the demand variables:Code: Select all
demander : total
You can compute the net demand-supply as a check (should be 0 for each duration):Code: Select all
FIND MARKET PRICE(demand[duration,total], demand priority vector[duration,total,ptype] ,supply capacity[Coal], priority vector[duration,Coal,ptype]) DEMAND AT PRICE( demand[duration,demander], demand priority vector[duration,demander,ptype] ,market price[duration]) demand priority vector[duration,demander,ptype]= demand priority type ~~| demand priority vector[duration,demander,ppriority]= demand priority[duration] ~~| demand priority vector[duration,demander,pwidth]= demand priority width ~~| demand priority vector[duration,demander,pextra]= extra
Code: Select all
SUM(amount demanded[duration,demander!])-SUM(amount supplied[duration,supplier!])