I`m working with a subscript variable that includes population for different areas.
In order to develop easy equations i am thinking to include n subscripts (for n areas) + a total additional value at the end.
A) is it possible to populate the variable in three steps?
1 POP(1,2.....n)
2 Total = sum POP(1,n)
3 POP(n+1) = Total
B Is it possible to use partial values of the variable subscripts?
1 Pop(1,2......n,totP)
2 MktCuota (1,2.....n,n+1)
3 MktCuota(n+1)= Pop(1....n) * MktCuota(1,... n)/Pop(n+1)
Cheers
Special subscript values
Re: Special subscript values
Hi
Thhere is no restriction to anything as long as it works. But the problem is that you will have variables that have different meaning depending on the value of the subscript, a very bad practice, one of the very good practive of SD being the correct and unambiguous naming of variables!
Regards.
JJ
Thhere is no restriction to anything as long as it works. But the problem is that you will have variables that have different meaning depending on the value of the subscript, a very bad practice, one of the very good practive of SD being the correct and unambiguous naming of variables!
Regards.
JJ
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Special subscript values
One other thing to remember. Your profile indicates that you are a PLE user, subscripts are not possible with PLE.
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: Special subscript values
A) It would be better to write:
B) Subranges are easy:
See http://www.vensim.com/documentation/usr17.htm and http://www.vensim.com/documentation/exc ... ations.htm
Code: Select all
category : (c1-c10) ~~ population categories (age cohorts?)
population[category] = ... ~ people ~ (dynamics of population go here)
total population = SUM(population[category!]) ~ people
Code: Select all
subcategory : c1, c3, c5
total subcat population = SUM(population[subcategory!]) ~ people
/*
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
*/