Common Stock with subscripted structures

Use this forum to post Vensim related questions.
Post Reply
Pepe
Junior Member
Posts: 3
Joined: Fri Nov 20, 2009 3:35 pm

Common Stock with subscripted structures

Post by Pepe »

Is it possible to have subscripted structures draw from a common un-subscripted stock, and update the value of that stock during the current time step, so that subsequent subscripted structures in the same time step can use the update stock value?

For example:
A car parts store has a stock of 3 alternators (the common stock). Five customers come in at the same time needing the same alternator for their car (the car is the subscripted structure). Three will go home happy, but 2 will need to wait until the stock has been replenished.

The problem arises when I try to remove a part from the common stock using the subscripted structure. The subscript appears on the right hand of the equation, but not the left.

Thanks!
Attachments
simple_spare.JPG
simple_spare.JPG (58.3 KiB) Viewed 2915 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

posting the model will help
JJ
Pepe
Junior Member
Posts: 3
Joined: Fri Nov 20, 2009 3:35 pm

Post by Pepe »

Here is the model.

Thanks!
Attachments
simple_spares_02.mdl
(4.72 KiB) Downloaded 312 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

the equation for part stock outflow should be

part stock outflow = SUM(parts replaced[part!])

you need to fix the equation for parts replaced - perhaps using ALLOCATE AVAILABLE - to prevent too many replacements given the common stock.

Also it would be good to add units to everything and do units checking.
Pepe
Junior Member
Posts: 3
Joined: Fri Nov 20, 2009 3:35 pm

Post by Pepe »

This worked, thank you! I replaced the equation for part stock outflow with the sum of parts replaced, as suggested.

I also updated the parts replaced equation using Allocate Available and a couple of other variables (needed to get a discrete output, since I can't withdraw 80% of a part). Seems to be working very well.

I learned a lot about the allocation functions in Vensim doing this, and it was very helpful. Thanks again.
Post Reply