Good morning all.
I have question about subscripts and the resulting ouput graphs.
The first question is to do with the number of subscripts on one variable. It's a little difficult to explain, but I'll try anyway! I have a variable (called example1) that uses two subscript ranges (aircraft,probabilities). Although the algorithm within example1 uses the full subscript ranges (of both aircraft and probabilities), the output (into a variable called example 2) requires the full range of "aircraft", but only the first element of "probabilities". i.e., example2[aircraft,p1]=example1[aircraft,p1]+1
All the subsequent variables also use the full range of "aircraft" but only the first element of "probabilities" (p1). So the question is, is there any way of reducing the number of subscripts in all of these subsequent variables to just one - i.e. to just "aircraft" - it seems a waste (especially when I come to use the"Table" tool) to use two subscript if only one element of "probabilities" is subesequently used.
The second question is wrt the graph function. I have a variable with three subscripts (one of these is "probabilities", but only 1 element is used, as described above). However, when I plot the graph, all the curves are the same colour - i.e., it doesn't distinguish between the different subscripts which makes the graph next to useless. I suspect this is because there are three subscripts, which is one reason why I asked if there was any way to reduce it to two.
Hope this is clear (probably not).
Thanks
Nik
Subscripts and graphs.
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Use
example2[aircraft]=example1[aircraft,p1]+1
You can mix up variables with different subscripts in equations without difficulty. The main rules are that a subscript on the right must be on the left, and that the same variable is always used with the same number of subscripts.
On the graph, if the variables have the same value they form a single line (so you only see 1 color). This is just because all are on top of each other - you can set the graph to show thick lines to overcome this.
example2[aircraft]=example1[aircraft,p1]+1
You can mix up variables with different subscripts in equations without difficulty. The main rules are that a subscript on the right must be on the left, and that the same variable is always used with the same number of subscripts.
On the graph, if the variables have the same value they form a single line (so you only see 1 color). This is just because all are on top of each other - you can set the graph to show thick lines to overcome this.
As a rule, the left and right side have to have the same number of subscript ranges. They key here is that in
example2[aircraft]=example1[aircraft,p1]+1
p1 is a single _element_ of probabilities, not a _range_. Therefore no corresponding range needs to exist on the left side.
The left and right side ranges might not be the same if you've used subscript mapping.
Tom
example2[aircraft]=example1[aircraft,p1]+1
p1 is a single _element_ of probabilities, not a _range_. Therefore no corresponding range needs to exist on the left side.
The left and right side ranges might not be the same if you've used subscript mapping.
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
*/