I may have found a bug in the implementation of constant elasticity priority profile functions in Vensim.
I have been working with the ALLOCATE AVAILABLE function. I have seen that when the priority profile is a constant elasticity function (numeric value 5), there could be some discontinuities. The example below:
Code: Select all
allocation[branch]=
ALLOCATE AVAILABLE(demand[branch], priority[branch,ptype], available)
~
~ |
available=
20*Time
~
~ |
branch:
Boston, Dayton, Fresno
~
~ |
demand[branch]=
500, 300, 750
~
~ |
pprofile:
ptype, ppriority, pwidth, pextra
~
~ |
priority[branch,pprofile]=
5,5,2,1;
5,7,4,2;
5,3,4,3;
~
~ |
Produces the following output: This happens also when the constant elasticity function is mixed with other profiles:
Code: Select all
allocation 0[branch]=
ALLOCATE AVAILABLE(demand[branch], priority 0[branch,ptype], available)
~
~ |
priority 0[branch,pprofile]=
3,5,1,0;
3,7,2,0;
5,3,2,3;
~
~ |
q(x) = q0 * (x/ppriority)^(-pextra) if x > pwidth
q(x) = q0 * (pwidth/ppriority)^(-pextra)if x <= pwidth
This could easily be solved with a transposition for x and a redefinition for the second equation:
See some examples for both definitions below:q(x) = q0 * ((x-pwidth+ppriority)/ppriority)^(-pextra) if x > pwidth
q(x) = q0 if x <= pwidth
I suppose that a similar problem may happen with the constant elasticity supply function when using the many-to-many allocation.
I hope my explanation was clear.
Cheers,
Eneko