I have been working on a Vensim model that uses the ALLOCATE AVAILABLE function and I've noticed that there appears to be an error when working with very large numbers. I'm attaching a simple model that demonstrates this. The model has a single input and three firms that compete for the input. The model allocates the input based on the firm's ppriority. There is a 'large number' variable that subtracts from firm 3's ppriority, so when this 'large number' gets larger firm 3's allocation goes to zero. The error occurs when this 'large number' gets much larger. Once the allocation of firm 3 is driven to zero, making the 'large number' larger shouldn't have any effect on the model; however, in the model when the 'large number' gets very large the allocation of firm 1 and 2 changes unpredictably, and can exceed the total amount of the input available. I would be interested to know if anyone has an explanation of this error.
Thanks
allocation error
allocation error
- Attachments
-
- Error Example2.mdl
- (2.6 KiB) Downloaded 206 times
-
- Super Administrator
- Posts: 4613
- Joined: Wed Mar 05, 2003 3:10 am
I see problems for large_number >= 100e6 roughly. I'm guessing that it's some kind of numerical issue, e.g. a scaling that assumes that the priorities are within a few orders of magnitude of one another.
ALLOCATE is essentially integrating the supply and demand curves, so my guess is that setting a huge negative step size makes the integration step too coarse.
If you're trying to suppress demand for one firm, it's probably better to either work directly on the demand or at least use a limited adjustment to the priority.
Tom
ALLOCATE is essentially integrating the supply and demand curves, so my guess is that setting a huge negative step size makes the integration step too coarse.
If you're trying to suppress demand for one firm, it's probably better to either work directly on the demand or at least use a limited adjustment to the priority.
Tom
/*
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
*/
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm