Subscripts and flows

Use this forum to post Vensim related questions.
Post Reply
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Subscripts and flows

Post by Phill »

Hello,

I'm trying to do something I thought would be very simple and I'm ashamed to say I'm going around in circles! In the attached simple model, I have a stock representing a warehouse that receives imported goods. Those goods are then transferred to nearby warehouses for shipment to specific geographic regions and you can see flows from the main warehouse to two others, one for shipments to Scotland and one for shipments to Wales. The real model needs 18 different shipment areas.

This model structure works, but I want to avoid 18 different flows in the sketch by subscripting from the point where goods flow out of 'Warehouse1'. My problem is that the stock in Warehouse1 isn't broken down into regions, the choice being made at that point, so that stock can't be subscripted. How can I introduce subscripted elements at this stage and avoid the 'Subscript appears on the right, but not on the left' error?
Attachments
warehouseSS.mdl
(2.73 KiB) Downloaded 165 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Subscripts and flows

Post by Administrator »

Try this,
warehouseSS.mdl
(3.76 KiB) Downloaded 240 times
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
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Re: Subscripts and flows

Post by Phill »

Thank you very much indeed. I see the part I was missing is to sum the subscripted outflow in the unsubscripted warehouse stock,

Incoming Stock
- sum ( Stockflow[Destinations!] )

Originally, I had that as equivalent to 'Incoming Stock - Stockflow[Destinations]' and that gave rise to the 'subscript on right but not on left' error.

Thanks again,
Phillip
Post Reply