Combine output

Use this forum to post Vensim related questions.
Post Reply
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Combine output

Post by husnafezaahmad »

Hello all!

I'm back with another confusion in my life with Vensim :cry: :cry:
Screen Shot 2020-11-24 at 15.02.25.png
Screen Shot 2020-11-24 at 15.02.25.png (309.15 KiB) Viewed 2312 times
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.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Combine output

Post by Administrator »

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.
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
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Combine output

Post by husnafezaahmad »

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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Combine output

Post by tomfid »

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.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Combine output

Post by tomfid »

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.
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Combine output

Post by husnafezaahmad »

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?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Combine output

Post by Administrator »

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
Post Reply