Hello all!
I'm back with another confusion in my life with Vensim
How do i combine all outputs into one matrix/under one variable? But i do not want it to be accummulated.
Please send me some help. Thanks in advance.
Combine output
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Combine output
It might have been much easier to do this with subscripts, all the structures look identical so subscripts would have been perfect.
If you upload the model, it should be easy to demonstrate how to do this.
If you upload the model, it should be easy to demonstrate how to do this.
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
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Combine output
Administrator wrote: ↑Tue Nov 24, 2020 4:45 pm It might have been much easier to do this with subscripts, all the structures look identical so subscripts would have been perfect.
If you upload the model, it should be easy to demonstrate how to do this.
But i've learnt that we can only have up to 8 subscripts.
Please enlight me on this, Admin. Here is the model.
- Attachments
-
- combine.mdl
- (15.43 KiB) Downloaded 131 times
Re: Combine output
You can have as many subscript ranges as you want, and a particular range can have a large number of elements. The only limit is that a particular variable can't have more than 8 subscript ranges. I don't think I've ever seen more than 5 or 6 in a real model.
/*
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: Combine output
If you have unsubscripted variables that you want to combine, you can do something like the following:
item : a,b
price a = 10
price b = 20
price[a] = price a
price = price b
revenue[item] = price[item]*quantity[item]
http://www.vensim.com/documentation/21265.htm
Sometimes it's useful to have the explicit visual layout, as in your example model, but in this case it seems much easier to dispense with the individual variables and use subscripts throughout.
item : a,b
price a = 10
price b = 20
price[a] = price a
price = price b
revenue[item] = price[item]*quantity[item]
http://www.vensim.com/documentation/21265.htm
Sometimes it's useful to have the explicit visual layout, as in your example model, but in this case it seems much easier to dispense with the individual variables and use subscripts throughout.
/*
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: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Combine output
Thanks a lot, Tom & Admin.
Tried the solutions suggested, and i get to do what exactly i want to do.
But now i encountered another problem which is, an error put as "Arguments out of range in VECTOR SORT_ORDER".
What does that means?
Tried the solutions suggested, and i get to do what exactly i want to do.
But now i encountered another problem which is, an error put as "Arguments out of range in VECTOR SORT_ORDER".
What does that means?
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Combine output
Look at the help system for vector sort order (it has an example on how to use the function). My guess is that you have one of the arguments wrong.
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