Vensim is an excellent SD modeling tool, the world standard, but I've run across a problem using the current version of DSS, version 8.2.1, on Windows 10, 64 bit.
When I add a second subscript, the first one disappears. When I add another one, the second one disappears. However, now all three are in the Subscripts list in the equation editor. This is a showstopper, as it makes it impossible to tune the model for the missing subscripts using the current selection in Subscript Control. Perhaps I'm missing something and doing something wrong?
On the same version of DSS, on a small test model I'm able to add a second subscript and it doesn't disappear.
I've attached a screen shot of the problem after the third subscript was added, as well as the model. As you can see, I'm converting sets of identical structures into fewer ones, using subscripts.
Thanks, Jack
Problem with subscripts being lost
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Problem with subscripts being lost
- Attachments
-
- TransportV1 09 Problem report.mdl
- (88.29 KiB) Downloaded 123 times
-
- VensimSubscriptBugLosingRanges.png (225.28 KiB) Viewed 2430 times
Re: Problem with subscripts being lost
I'm going to guess that these subranges are overlapping. For example, if you have:
Rural Trip : horse, walk
Urban Trip : bike, walk
They will collapse into a single entry because the shared "walk" element indicates that they're part of the same family.
If you visit the Subscript Control and click the "full" button in the corner, you'll be able to see the subrange/range relationships. However, the structure above won't work, because you need a master range. Adding:
All Trips : bike, horse, walk
will take care of that.
Rural Trip : horse, walk
Urban Trip : bike, walk
They will collapse into a single entry because the shared "walk" element indicates that they're part of the same family.
If you visit the Subscript Control and click the "full" button in the corner, you'll be able to see the subrange/range relationships. However, the structure above won't work, because you need a master range. Adding:
All Trips : bike, horse, walk
will take care of that.
/*
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: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Problem with subscripts being lost
Thanks for the quick reply. So a range element name must be unique for the entire model? I don't recall seeing that in the documentation. Nor does the software complain if it's tried. Collapsing into a single entry without complaining is, to me, bad tool behavior. It's like units that don't match.
To explain, the model has 3 types of areas to live: urban, suburban, and rural. Each area type has the same 5 options for travel: public (bus), private (car), shared (car), bike, and walking. The model needs to calculate average trip cost for all permutations, which is 3 x 5 = 15. Since some input is dynamics, this must be done in the model rather than prior in a spreadsheet.
"Master range" returns no hits in the Vensim documentation.
The Full mode of Subscript Control shows Subranges of All, None, Suburban Trip, Urban Trip. The Available Elements are public, private, shared, bike, walk.
I wonder if my best solution is to use element name prefixes or suffixes to indicate urban, suburban, and rural, like "public_U". This would keep the subscripts conceptually simple. However, I suspect that because you understand master range, that is even better. Is there a model example of that approach somewhere, or some documentation? Thanks again, Jack
To explain, the model has 3 types of areas to live: urban, suburban, and rural. Each area type has the same 5 options for travel: public (bus), private (car), shared (car), bike, and walking. The model needs to calculate average trip cost for all permutations, which is 3 x 5 = 15. Since some input is dynamics, this must be done in the model rather than prior in a spreadsheet.
"Master range" returns no hits in the Vensim documentation.
The Full mode of Subscript Control shows Subranges of All, None, Suburban Trip, Urban Trip. The Available Elements are public, private, shared, bike, walk.
I wonder if my best solution is to use element name prefixes or suffixes to indicate urban, suburban, and rural, like "public_U". This would keep the subscripts conceptually simple. However, I suspect that because you understand master range, that is even better. Is there a model example of that approach somewhere, or some documentation? Thanks again, Jack
Re: Problem with subscripts being lost
Collapsing subranges into a single entry under the master range is the intended tool behavior. There's a new Subscript Control coming, which you can preview via Tools>Switch to New Sketch.
The challenge here is that the situation is fundamentally ambiguous, so it's difficult for the parser to determine what the user intends. It attempts to give an informative error message when you Check Model:
yields:
I'll take a look at the docs to see if we can clarify the constraint.
The challenge here is that the situation is fundamentally ambiguous, so it's difficult for the parser to determine what the user intends. It attempts to give an informative error message when you Check Model:
Code: Select all
bob:
b,c,d
~
~ |
fred:
a,b,c
~
~ |
Code: Select all
ERROR: -d- is an element of -bob- which appears to be a subfamily of -fred-.
But -d- is not an element of the family -fred-.
Check for two uses of the same symbol.
/*
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: Problem with subscripts being lost
In general, whether you want a single master range with overlapping subranges, or distinct ranges, depends on whether you'll ever use the master range. If, for example, you want to calculate SUM(distance[all trips!]) the master range would be convenient.
On the other hand, if rural and urban trips have distinct structures, you might instead want:
Rural Trip : horse, r_walk
Urban Trip : bike, u_walk
If you go the master range route, you can still define some structures for only the rural or urban subsets. I think a little extra memory will be allocated for the undefined elements, but that's unlikely to be much of a penalty.
On the other hand, if rural and urban trips have distinct structures, you might instead want:
Rural Trip : horse, r_walk
Urban Trip : bike, u_walk
If you go the master range route, you can still define some structures for only the rural or urban subsets. I think a little extra memory will be allocated for the undefined elements, but that's unlikely to be much of a penalty.
/*
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: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Re: Problem with subscripts being lost
Thanks so much Tom, I will explore this. I especially appreciate you high level design thoughts.
The new Subscripts Control sure solves the lots of tabs problem. It seems to handle subranges much more clearly. I actually could not understand these by reading the documentation, but I've not been using subscripts much.
The new Subscripts Control sure solves the lots of tabs problem. It seems to handle subranges much more clearly. I actually could not understand these by reading the documentation, but I've not been using subscripts much.
Re: Problem with subscripts being lost
Exactly - kudos to Tony for creating the new control, I think (nothing to do with me).
/*
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
*/