Hello,
I am using Vensim 6.3 DSS, 32-bit, single-point precision. I am working on a large model involving several subscripts, which, due to custom functions involving matrix manipulations, is running really slow. I am interested in using the "Except" feature to avoid subscript combinations that are not possible, thus reducing the size of the matrices involved, and, hopefully, speeding up the model.
However, subscript combinations that are not possible change from simulation to simulation, so I don't want to hard code them into each equation. Instead, I would prefer to create a variable with the subscript combinations that are not possible and hard code this variable into the "except" box of all other variables in the model. is there a way to accomplish that? Thanks for the help!
Subscript combinations as a variable
Re: Subscript combinations as a variable
EXCEPT statements are fixed. For some purposes, VECTOR SELECT might work for you (it doesn't execute elements that are 0 in the select statement). Or you might be able to use GET XLS SUBS.
/*
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
*/
-
- Super Administrator
- Posts: 4592
- Joined: Wed Mar 05, 2003 3:10 am
Re: Subscript combinations as a variable
I cannot think of a way to do it.
Are you compiling your model? That can give a very big improvement in run speed.
Are you compiling your model? That can give a very big improvement in run speed.
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: Subscript combinations as a variable
Thanks for the quick replies. Based on your answers, it doesn't appear that there is an easy way of accomplishing what I need. I think that the best approach is for me to combine all subscripts into a single one. For instance, instead of having 3 subscripts Sub1: A,B,C; Sub2: D,E,F; and Sub3: G,H,I, and finding a way to tell Vensim which of those 3-letter combinations is not possible, having a single subscript, say Sub, with the only possible compinations, say A-D-G and C-D-I, for example. I will have to move some of the computations outside of the model, but it should be possible.
I am not compiling the model at this point, though that is the long-term plan. The problem, however, is in the custom functions which run out the compiled DLL file anyway. The large number of subscripts translate into large matrices, which, in turn, take a very long time to manipulate.
I am not compiling the model at this point, though that is the long-term plan. The problem, however, is in the custom functions which run out the compiled DLL file anyway. The large number of subscripts translate into large matrices, which, in turn, take a very long time to manipulate.
Re: Subscript combinations as a variable
Just in case you haven't discovered it, you can build up subscripts hierarchically, which might make the 1-dimension idea easier:
Code: Select all
thingsthatfly : airplane, helicopter
thingsthatroll : car, truck
transportmode: thingsthatfly, thingsthatroll
/*
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
*/