Using actions to change stock values

A place for Ventity software questions & answers
Post Reply
niallmnaidoo
Junior Member
Posts: 2
Joined: Wed May 09, 2018 3:56 pm
Vensim version: PLE

Using actions to change stock values

Post by niallmnaidoo » Fri Nov 29, 2019 9:42 am

Hi, I see the instructions on how to change attribute values. The manual says that it's also possible to change stock values or the values of flows related to stocks but I'm not clear on how this is done. Specifically, I would like a triggered action to record the value of an external time series data variable in a stock. Stock is preferable to attribute as the value should be numerical not a string. It would be helpful to know how command actions can change both stock values directly and via once-off changes to flows.
Thank you

tomfid
Administrator
Posts: 2776
Joined: Wed May 24, 2006 4:54 am

Re: Using actions to change stock values

Post by tomfid » Sat Nov 30, 2019 6:28 pm

1. Drag a copy of the target stock onto the action diagram (using the parent or invoker reference)
2. Add an inflow to the stock.
3. Set the inflow equation for the stock to = newValue-stock

Note that the units on this flow are the same as the stock (unlike a normal dynamic equation where flow = stock/time).

Post Reply